Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/ShExBy/shex_roo.../usr/include/linux
File: fsmap.h
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
[0] Fix | Delete
/*
[1] Fix | Delete
* FS_IOC_GETFSMAP ioctl infrastructure.
[2] Fix | Delete
*
[3] Fix | Delete
* Copyright (C) 2017 Oracle. All Rights Reserved.
[4] Fix | Delete
*
[5] Fix | Delete
* Author: Darrick J. Wong <darrick.wong@oracle.com>
[6] Fix | Delete
*/
[7] Fix | Delete
#ifndef _LINUX_FSMAP_H
[8] Fix | Delete
#define _LINUX_FSMAP_H
[9] Fix | Delete
[10] Fix | Delete
#include <linux/types.h>
[11] Fix | Delete
[12] Fix | Delete
/*
[13] Fix | Delete
* Structure for FS_IOC_GETFSMAP.
[14] Fix | Delete
*
[15] Fix | Delete
* The memory layout for this call are the scalar values defined in
[16] Fix | Delete
* struct fsmap_head, followed by two struct fsmap that describe
[17] Fix | Delete
* the lower and upper bound of mappings to return, followed by an
[18] Fix | Delete
* array of struct fsmap mappings.
[19] Fix | Delete
*
[20] Fix | Delete
* fmh_iflags control the output of the call, whereas fmh_oflags report
[21] Fix | Delete
* on the overall record output. fmh_count should be set to the
[22] Fix | Delete
* length of the fmh_recs array, and fmh_entries will be set to the
[23] Fix | Delete
* number of entries filled out during each call. If fmh_count is
[24] Fix | Delete
* zero, the number of reverse mappings will be returned in
[25] Fix | Delete
* fmh_entries, though no mappings will be returned. fmh_reserved
[26] Fix | Delete
* must be set to zero.
[27] Fix | Delete
*
[28] Fix | Delete
* The two elements in the fmh_keys array are used to constrain the
[29] Fix | Delete
* output. The first element in the array should represent the
[30] Fix | Delete
* lowest disk mapping ("low key") that the user wants to learn
[31] Fix | Delete
* about. If this value is all zeroes, the filesystem will return
[32] Fix | Delete
* the first entry it knows about. For a subsequent call, the
[33] Fix | Delete
* contents of fsmap_head.fmh_recs[fsmap_head.fmh_count - 1] should be
[34] Fix | Delete
* copied into fmh_keys[0] to have the kernel start where it left off.
[35] Fix | Delete
*
[36] Fix | Delete
* The second element in the fmh_keys array should represent the
[37] Fix | Delete
* highest disk mapping ("high key") that the user wants to learn
[38] Fix | Delete
* about. If this value is all ones, the filesystem will not stop
[39] Fix | Delete
* until it runs out of mapping to return or runs out of space in
[40] Fix | Delete
* fmh_recs.
[41] Fix | Delete
*
[42] Fix | Delete
* fmr_device can be either a 32-bit cookie representing a device, or
[43] Fix | Delete
* a 32-bit dev_t if the FMH_OF_DEV_T flag is set. fmr_physical,
[44] Fix | Delete
* fmr_offset, and fmr_length are expressed in units of bytes.
[45] Fix | Delete
* fmr_owner is either an inode number, or a special value if
[46] Fix | Delete
* FMR_OF_SPECIAL_OWNER is set in fmr_flags.
[47] Fix | Delete
*/
[48] Fix | Delete
struct fsmap {
[49] Fix | Delete
__u32 fmr_device; /* device id */
[50] Fix | Delete
__u32 fmr_flags; /* mapping flags */
[51] Fix | Delete
__u64 fmr_physical; /* device offset of segment */
[52] Fix | Delete
__u64 fmr_owner; /* owner id */
[53] Fix | Delete
__u64 fmr_offset; /* file offset of segment */
[54] Fix | Delete
__u64 fmr_length; /* length of segment */
[55] Fix | Delete
__u64 fmr_reserved[3]; /* must be zero */
[56] Fix | Delete
};
[57] Fix | Delete
[58] Fix | Delete
struct fsmap_head {
[59] Fix | Delete
__u32 fmh_iflags; /* control flags */
[60] Fix | Delete
__u32 fmh_oflags; /* output flags */
[61] Fix | Delete
__u32 fmh_count; /* # of entries in array incl. input */
[62] Fix | Delete
__u32 fmh_entries; /* # of entries filled in (output). */
[63] Fix | Delete
__u64 fmh_reserved[6]; /* must be zero */
[64] Fix | Delete
[65] Fix | Delete
struct fsmap fmh_keys[2]; /* low and high keys for the mapping search */
[66] Fix | Delete
struct fsmap fmh_recs[]; /* returned records */
[67] Fix | Delete
};
[68] Fix | Delete
[69] Fix | Delete
/* Size of an fsmap_head with room for nr records. */
[70] Fix | Delete
static __inline__ size_t
[71] Fix | Delete
fsmap_sizeof(
[72] Fix | Delete
unsigned int nr)
[73] Fix | Delete
{
[74] Fix | Delete
return sizeof(struct fsmap_head) + nr * sizeof(struct fsmap);
[75] Fix | Delete
}
[76] Fix | Delete
[77] Fix | Delete
/* Start the next fsmap query at the end of the current query results. */
[78] Fix | Delete
static __inline__ void
[79] Fix | Delete
fsmap_advance(
[80] Fix | Delete
struct fsmap_head *head)
[81] Fix | Delete
{
[82] Fix | Delete
head->fmh_keys[0] = head->fmh_recs[head->fmh_entries - 1];
[83] Fix | Delete
}
[84] Fix | Delete
[85] Fix | Delete
/* fmh_iflags values - set by FS_IOC_GETFSMAP caller in the header. */
[86] Fix | Delete
/* no flags defined yet */
[87] Fix | Delete
#define FMH_IF_VALID 0
[88] Fix | Delete
[89] Fix | Delete
/* fmh_oflags values - returned in the header segment only. */
[90] Fix | Delete
#define FMH_OF_DEV_T 0x1 /* fmr_device values will be dev_t */
[91] Fix | Delete
[92] Fix | Delete
/* fmr_flags values - returned for each non-header segment */
[93] Fix | Delete
#define FMR_OF_PREALLOC 0x1 /* segment = unwritten pre-allocation */
[94] Fix | Delete
#define FMR_OF_ATTR_FORK 0x2 /* segment = attribute fork */
[95] Fix | Delete
#define FMR_OF_EXTENT_MAP 0x4 /* segment = extent map */
[96] Fix | Delete
#define FMR_OF_SHARED 0x8 /* segment = shared with another file */
[97] Fix | Delete
#define FMR_OF_SPECIAL_OWNER 0x10 /* owner is a special value */
[98] Fix | Delete
#define FMR_OF_LAST 0x20 /* segment is the last in the dataset */
[99] Fix | Delete
[100] Fix | Delete
/* Each FS gets to define its own special owner codes. */
[101] Fix | Delete
#define FMR_OWNER(type, code) (((__u64)type << 32) | \
[102] Fix | Delete
((__u64)code & 0xFFFFFFFFULL))
[103] Fix | Delete
#define FMR_OWNER_TYPE(owner) ((__u32)((__u64)owner >> 32))
[104] Fix | Delete
#define FMR_OWNER_CODE(owner) ((__u32)(((__u64)owner & 0xFFFFFFFFULL)))
[105] Fix | Delete
#define FMR_OWN_FREE FMR_OWNER(0, 1) /* free space */
[106] Fix | Delete
#define FMR_OWN_UNKNOWN FMR_OWNER(0, 2) /* unknown owner */
[107] Fix | Delete
#define FMR_OWN_METADATA FMR_OWNER(0, 3) /* metadata */
[108] Fix | Delete
[109] Fix | Delete
#define FS_IOC_GETFSMAP _IOWR('X', 59, struct fsmap_head)
[110] Fix | Delete
[111] Fix | Delete
#endif /* _LINUX_FSMAP_H */
[112] Fix | Delete
[113] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function