Skip to content

Commit 65a60e8

Browse files
Christoph Hellwigdjwong
authored andcommitted
iomap: better document the IOMAP_F_* flags
The documentation for IOMAP_F_* is a bit disorganized, and doesn't mention the fact that most flags are set by the file system and consumed by the iomap core, while IOMAP_F_SIZE_CHANGED is set by the core and consumed by the file system. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Allison Collins <[email protected]> Reviewed-by: Darrick J. Wong <[email protected]> Signed-off-by: Darrick J. Wong <[email protected]>
1 parent 9cd0ed6 commit 65a60e8

File tree

1 file changed

+23
-8
lines changed

1 file changed

+23
-8
lines changed

include/linux/iomap.h

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,23 +30,38 @@ struct vm_fault;
3030
#define IOMAP_INLINE 0x05 /* data inline in the inode */
3131

3232
/*
33-
* Flags for all iomap mappings:
33+
* Flags reported by the file system from iomap_begin:
34+
*
35+
* IOMAP_F_NEW indicates that the blocks have been newly allocated and need
36+
* zeroing for areas that no data is copied to.
3437
*
3538
* IOMAP_F_DIRTY indicates the inode has uncommitted metadata needed to access
3639
* written data and requires fdatasync to commit them to persistent storage.
3740
* This needs to take into account metadata changes that *may* be made at IO
3841
* completion, such as file size updates from direct IO.
42+
*
43+
* IOMAP_F_SHARED indicates that the blocks are shared, and will need to be
44+
* unshared as part a write.
45+
*
46+
* IOMAP_F_MERGED indicates that the iomap contains the merge of multiple block
47+
* mappings.
48+
*
49+
* IOMAP_F_BUFFER_HEAD indicates that the file system requires the use of
50+
* buffer heads for this mapping.
3951
*/
40-
#define IOMAP_F_NEW 0x01 /* blocks have been newly allocated */
41-
#define IOMAP_F_DIRTY 0x02 /* uncommitted metadata */
42-
#define IOMAP_F_BUFFER_HEAD 0x04 /* file system requires buffer heads */
43-
#define IOMAP_F_SIZE_CHANGED 0x08 /* file size has changed */
52+
#define IOMAP_F_NEW 0x01
53+
#define IOMAP_F_DIRTY 0x02
54+
#define IOMAP_F_SHARED 0x04
55+
#define IOMAP_F_MERGED 0x08
56+
#define IOMAP_F_BUFFER_HEAD 0x10
4457

4558
/*
46-
* Flags that only need to be reported for IOMAP_REPORT requests:
59+
* Flags set by the core iomap code during operations:
60+
*
61+
* IOMAP_F_SIZE_CHANGED indicates to the iomap_end method that the file size
62+
* has changed as the result of this write operation.
4763
*/
48-
#define IOMAP_F_MERGED 0x10 /* contains multiple blocks/extents */
49-
#define IOMAP_F_SHARED 0x20 /* block shared with another file */
64+
#define IOMAP_F_SIZE_CHANGED 0x100
5065

5166
/*
5267
* Flags from 0x1000 up are for file system specific usage:

0 commit comments

Comments
 (0)