diff mbox series

[01/19] iomap: better document the IOMAP_F_* flags

Message ID 20190909182722.16783-2-hch@lst.de (mailing list archive)
State Deferred, archived
Headers show
Series [01/19] iomap: better document the IOMAP_F_* flags | expand

Commit Message

Christoph Hellwig Sept. 9, 2019, 6:27 p.m. UTC
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 <hch@lst.de>
---
 include/linux/iomap.h | 31 +++++++++++++++++++++++--------
 1 file changed, 23 insertions(+), 8 deletions(-)

Comments

Allison Henderson Sept. 14, 2019, 12:42 a.m. UTC | #1
Looks good to me, I think the new comments are a lot more helpful
Reviewed-by: Allison Collins <allison.henderson@oracle.com>

On 9/9/19 11:27 AM, Christoph Hellwig wrote:
> 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 <hch@lst.de>
> ---
>   include/linux/iomap.h | 31 +++++++++++++++++++++++--------
>   1 file changed, 23 insertions(+), 8 deletions(-)
> 
> diff --git a/include/linux/iomap.h b/include/linux/iomap.h
> index e79af6b28410..8adcc8dd4498 100644
> --- a/include/linux/iomap.h
> +++ b/include/linux/iomap.h
> @@ -30,21 +30,36 @@ struct vm_fault;
>   #define IOMAP_INLINE	0x05	/* data inline in the inode */
>   
>   /*
> - * Flags for all iomap mappings:
> + * Flags reported by the file system from iomap_begin:
> + *
> + * IOMAP_F_NEW indicates that the blocks have been newly allocated and need
> + * zeroing for areas that no data is copied to.
>    *
>    * IOMAP_F_DIRTY indicates the inode has uncommitted metadata needed to access
>    * written data and requires fdatasync to commit them to persistent storage.
> + *
> + * IOMAP_F_SHARED indicates that the blocks are shared, and will need to be
> + * unshared as part a write.
> + *
> + * IOMAP_F_MERGED indicates that the iomap contains the merge of multiple block
> + * mappings.
> + *
> + * IOMAP_F_BUFFER_HEAD indicates that the file system requires the use of
> + * buffer heads for this mapping.
>    */
> -#define IOMAP_F_NEW		0x01	/* blocks have been newly allocated */
> -#define IOMAP_F_DIRTY		0x02	/* uncommitted metadata */
> -#define IOMAP_F_BUFFER_HEAD	0x04	/* file system requires buffer heads */
> -#define IOMAP_F_SIZE_CHANGED	0x08	/* file size has changed */
> +#define IOMAP_F_NEW		0x01
> +#define IOMAP_F_DIRTY		0x02
> +#define IOMAP_F_SHARED		0x04
> +#define IOMAP_F_MERGED		0x08
> +#define IOMAP_F_BUFFER_HEAD	0x10
>   
>   /*
> - * Flags that only need to be reported for IOMAP_REPORT requests:
> + * Flags set by the core iomap code during operations:
> + *
> + * IOMAP_F_SIZE_CHANGED indicates to the iomap_end method that the file size
> + * has changed as the result of this write operation.
>    */
> -#define IOMAP_F_MERGED		0x10	/* contains multiple blocks/extents */
> -#define IOMAP_F_SHARED		0x20	/* block shared with another file */
> +#define IOMAP_F_SIZE_CHANGED	0x100
>   
>   /*
>    * Flags from 0x1000 up are for file system specific usage:
>
Darrick J. Wong Sept. 16, 2019, 6:08 p.m. UTC | #2
On Mon, Sep 09, 2019 at 08:27:04PM +0200, Christoph Hellwig wrote:
> 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 <hch@lst.de>

Wooooooo,
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>

--D

> ---
>  include/linux/iomap.h | 31 +++++++++++++++++++++++--------
>  1 file changed, 23 insertions(+), 8 deletions(-)
> 
> diff --git a/include/linux/iomap.h b/include/linux/iomap.h
> index e79af6b28410..8adcc8dd4498 100644
> --- a/include/linux/iomap.h
> +++ b/include/linux/iomap.h
> @@ -30,21 +30,36 @@ struct vm_fault;
>  #define IOMAP_INLINE	0x05	/* data inline in the inode */
>  
>  /*
> - * Flags for all iomap mappings:
> + * Flags reported by the file system from iomap_begin:
> + *
> + * IOMAP_F_NEW indicates that the blocks have been newly allocated and need
> + * zeroing for areas that no data is copied to.
>   *
>   * IOMAP_F_DIRTY indicates the inode has uncommitted metadata needed to access
>   * written data and requires fdatasync to commit them to persistent storage.
> + *
> + * IOMAP_F_SHARED indicates that the blocks are shared, and will need to be
> + * unshared as part a write.
> + *
> + * IOMAP_F_MERGED indicates that the iomap contains the merge of multiple block
> + * mappings.
> + *
> + * IOMAP_F_BUFFER_HEAD indicates that the file system requires the use of
> + * buffer heads for this mapping.
>   */
> -#define IOMAP_F_NEW		0x01	/* blocks have been newly allocated */
> -#define IOMAP_F_DIRTY		0x02	/* uncommitted metadata */
> -#define IOMAP_F_BUFFER_HEAD	0x04	/* file system requires buffer heads */
> -#define IOMAP_F_SIZE_CHANGED	0x08	/* file size has changed */
> +#define IOMAP_F_NEW		0x01
> +#define IOMAP_F_DIRTY		0x02
> +#define IOMAP_F_SHARED		0x04
> +#define IOMAP_F_MERGED		0x08
> +#define IOMAP_F_BUFFER_HEAD	0x10
>  
>  /*
> - * Flags that only need to be reported for IOMAP_REPORT requests:
> + * Flags set by the core iomap code during operations:
> + *
> + * IOMAP_F_SIZE_CHANGED indicates to the iomap_end method that the file size
> + * has changed as the result of this write operation.
>   */
> -#define IOMAP_F_MERGED		0x10	/* contains multiple blocks/extents */
> -#define IOMAP_F_SHARED		0x20	/* block shared with another file */
> +#define IOMAP_F_SIZE_CHANGED	0x100
>  
>  /*
>   * Flags from 0x1000 up are for file system specific usage:
> -- 
> 2.20.1
>
diff mbox series

Patch

diff --git a/include/linux/iomap.h b/include/linux/iomap.h
index e79af6b28410..8adcc8dd4498 100644
--- a/include/linux/iomap.h
+++ b/include/linux/iomap.h
@@ -30,21 +30,36 @@  struct vm_fault;
 #define IOMAP_INLINE	0x05	/* data inline in the inode */
 
 /*
- * Flags for all iomap mappings:
+ * Flags reported by the file system from iomap_begin:
+ *
+ * IOMAP_F_NEW indicates that the blocks have been newly allocated and need
+ * zeroing for areas that no data is copied to.
  *
  * IOMAP_F_DIRTY indicates the inode has uncommitted metadata needed to access
  * written data and requires fdatasync to commit them to persistent storage.
+ *
+ * IOMAP_F_SHARED indicates that the blocks are shared, and will need to be
+ * unshared as part a write.
+ *
+ * IOMAP_F_MERGED indicates that the iomap contains the merge of multiple block
+ * mappings.
+ *
+ * IOMAP_F_BUFFER_HEAD indicates that the file system requires the use of
+ * buffer heads for this mapping.
  */
-#define IOMAP_F_NEW		0x01	/* blocks have been newly allocated */
-#define IOMAP_F_DIRTY		0x02	/* uncommitted metadata */
-#define IOMAP_F_BUFFER_HEAD	0x04	/* file system requires buffer heads */
-#define IOMAP_F_SIZE_CHANGED	0x08	/* file size has changed */
+#define IOMAP_F_NEW		0x01
+#define IOMAP_F_DIRTY		0x02
+#define IOMAP_F_SHARED		0x04
+#define IOMAP_F_MERGED		0x08
+#define IOMAP_F_BUFFER_HEAD	0x10
 
 /*
- * Flags that only need to be reported for IOMAP_REPORT requests:
+ * Flags set by the core iomap code during operations:
+ *
+ * IOMAP_F_SIZE_CHANGED indicates to the iomap_end method that the file size
+ * has changed as the result of this write operation.
  */
-#define IOMAP_F_MERGED		0x10	/* contains multiple blocks/extents */
-#define IOMAP_F_SHARED		0x20	/* block shared with another file */
+#define IOMAP_F_SIZE_CHANGED	0x100
 
 /*
  * Flags from 0x1000 up are for file system specific usage: