@@ -12,21 +12,10 @@ returns a list of extents.
12
12
Request Basics
13
13
--------------
14
14
15
- A fiemap request is encoded within struct fiemap::
16
-
17
- struct fiemap {
18
- __u64 fm_start; /* logical offset (inclusive) at
19
- * which to start mapping (in) */
20
- __u64 fm_length; /* logical length of mapping which
21
- * userspace cares about (in) */
22
- __u32 fm_flags; /* FIEMAP_FLAG_* flags for request (in/out) */
23
- __u32 fm_mapped_extents; /* number of extents that were
24
- * mapped (out) */
25
- __u32 fm_extent_count; /* size of fm_extents array (in) */
26
- __u32 fm_reserved;
27
- struct fiemap_extent fm_extents[0]; /* array of mapped extents (out) */
28
- };
15
+ A fiemap request is encoded within struct fiemap:
29
16
17
+ .. kernel-doc :: include/uapi/linux/fiemap.h
18
+ :identifiers: fiemap
30
19
31
20
fm_start, and fm_length specify the logical range within the file
32
21
which the process would like mappings for. Extents returned mirror
@@ -60,6 +49,8 @@ FIEMAP_FLAG_XATTR
60
49
If this flag is set, the extents returned will describe the inodes
61
50
extended attribute lookup tree, instead of its data tree.
62
51
52
+ FIEMAP_FLAG_CACHE
53
+ This flag requests caching of the extents.
63
54
64
55
Extent Mapping
65
56
--------------
@@ -77,18 +68,10 @@ complete the requested range and will not have the FIEMAP_EXTENT_LAST
77
68
flag set (see the next section on extent flags).
78
69
79
70
Each extent is described by a single fiemap_extent structure as
80
- returned in fm_extents::
81
-
82
- struct fiemap_extent {
83
- __u64 fe_logical; /* logical offset in bytes for the start of
84
- * the extent */
85
- __u64 fe_physical; /* physical offset in bytes for the start
86
- * of the extent */
87
- __u64 fe_length; /* length in bytes for the extent */
88
- __u64 fe_reserved64[2];
89
- __u32 fe_flags; /* FIEMAP_EXTENT_* flags for this extent */
90
- __u32 fe_reserved[3];
91
- };
71
+ returned in fm_extents:
72
+
73
+ .. kernel-doc :: include/uapi/linux/fiemap.h
74
+ :identifiers: fiemap_extent
92
75
93
76
All offsets and lengths are in bytes and mirror those on disk. It is valid
94
77
for an extents logical offset to start before the request or its logical
@@ -175,6 +158,8 @@ FIEMAP_EXTENT_MERGED
175
158
userspace would be highly inefficient, the kernel will try to merge most
176
159
adjacent blocks into 'extents'.
177
160
161
+ FIEMAP_EXTENT_SHARED
162
+ This flag is set to request that space be shared with other files.
178
163
179
164
VFS -> File System Implementation
180
165
---------------------------------
@@ -191,14 +176,10 @@ each discovered extent::
191
176
u64 len);
192
177
193
178
->fiemap is passed struct fiemap_extent_info which describes the
194
- fiemap request::
195
-
196
- struct fiemap_extent_info {
197
- unsigned int fi_flags; /* Flags as passed from user */
198
- unsigned int fi_extents_mapped; /* Number of mapped extents */
199
- unsigned int fi_extents_max; /* Size of fiemap_extent array */
200
- struct fiemap_extent *fi_extents_start; /* Start of fiemap_extent array */
201
- };
179
+ fiemap request:
180
+
181
+ .. kernel-doc :: include/linux/fiemap.h
182
+ :identifiers: fiemap_extent_info
202
183
203
184
It is intended that the file system should not need to access any of this
204
185
structure directly. Filesystem handlers should be tolerant to signals and return
0 commit comments