[PATCH] docs: filesystems: f2fs: fix description about compress ioctl

Chao Liu posted 1 patch 3 years, 11 months ago
There is a newer version of this series
Documentation/filesystems/f2fs.rst | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
[PATCH] docs: filesystems: f2fs: fix description about compress ioctl
Posted by Chao Liu 3 years, 11 months ago
From: Chao Liu <liuchao@coolpad.com>

Since commit c61404153eb6 ("f2fs: introduce FI_COMPRESS_RELEASED
instead of using IMMUTABLE bit"), we no longer use the IMMUTABLE
bit to prevent writing data for compression. Let's correct the
corresponding documentation.

BTW, this patch fixes some alignment issues in the compress
metadata layout.

Signed-off-by: Chao Liu <liuchao@coolpad.com>
---
 Documentation/filesystems/f2fs.rst | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/Documentation/filesystems/f2fs.rst b/Documentation/filesystems/f2fs.rst
index ad8dc8c040a2..98dc24f5c6f0 100644
--- a/Documentation/filesystems/f2fs.rst
+++ b/Documentation/filesystems/f2fs.rst
@@ -818,10 +818,11 @@ Compression implementation
   Instead, the main goal is to reduce data writes to flash disk as much as
   possible, resulting in extending disk life time as well as relaxing IO
   congestion. Alternatively, we've added ioctl(F2FS_IOC_RELEASE_COMPRESS_BLOCKS)
-  interface to reclaim compressed space and show it to user after putting the
-  immutable bit. Immutable bit, after release, it doesn't allow writing/mmaping
-  on the file, until reserving compressed space via
-  ioctl(F2FS_IOC_RESERVE_COMPRESS_BLOCKS) or truncating filesize to zero.
+  interface to reclaim compressed space and show it to user after setting a
+  special flag to the inode. Once the compressed space is released, the flag
+  will block writing data to the file until either the compressed space is
+  reserved via ioctl(F2FS_IOC_RESERVE_COMPRESS_BLOCKS) or the file size is
+  truncated to zero.
 
 Compress metadata layout::
 
@@ -830,12 +831,12 @@ Compress metadata layout::
 		| cluster 1 | cluster 2 | ......... | cluster N |
 		+-----------------------------------------------+
 		.           .                       .           .
-	.                       .                .                      .
+	  .                      .                .                      .
     .         Compressed Cluster       .        .        Normal Cluster            .
     +----------+---------+---------+---------+  +---------+---------+---------+---------+
     |compr flag| block 1 | block 2 | block 3 |  | block 1 | block 2 | block 3 | block 4 |
     +----------+---------+---------+---------+  +---------+---------+---------+---------+
-	    .                             .
+	       .                             .
 	    .                                           .
 	.                                                           .
 	+-------------+-------------+----------+----------------------------+
-- 
2.36.1
Re: [PATCH] docs: filesystems: f2fs: fix description about compress ioctl
Posted by Chao Yu 3 years, 10 months ago
On 2022/6/2 15:25, Chao Liu wrote:
> From: Chao Liu <liuchao@coolpad.com>
> 
> Since commit c61404153eb6 ("f2fs: introduce FI_COMPRESS_RELEASED
> instead of using IMMUTABLE bit"), we no longer use the IMMUTABLE
> bit to prevent writing data for compression. Let's correct the
> corresponding documentation.
> 
> BTW, this patch fixes some alignment issues in the compress
> metadata layout.
> 
> Signed-off-by: Chao Liu <liuchao@coolpad.com>
> ---
>   Documentation/filesystems/f2fs.rst | 13 +++++++------
>   1 file changed, 7 insertions(+), 6 deletions(-)
> 
> diff --git a/Documentation/filesystems/f2fs.rst b/Documentation/filesystems/f2fs.rst
> index ad8dc8c040a2..98dc24f5c6f0 100644
> --- a/Documentation/filesystems/f2fs.rst
> +++ b/Documentation/filesystems/f2fs.rst
> @@ -818,10 +818,11 @@ Compression implementation
>     Instead, the main goal is to reduce data writes to flash disk as much as
>     possible, resulting in extending disk life time as well as relaxing IO
>     congestion. Alternatively, we've added ioctl(F2FS_IOC_RELEASE_COMPRESS_BLOCKS)
> -  interface to reclaim compressed space and show it to user after putting the
> -  immutable bit. Immutable bit, after release, it doesn't allow writing/mmaping
> -  on the file, until reserving compressed space via
> -  ioctl(F2FS_IOC_RESERVE_COMPRESS_BLOCKS) or truncating filesize to zero.
> +  interface to reclaim compressed space and show it to user after setting a
> +  special flag to the inode. Once the compressed space is released, the flag
> +  will block writing data to the file until either the compressed space is
> +  reserved via ioctl(F2FS_IOC_RESERVE_COMPRESS_BLOCKS) or the file size is

s/file size/filesize/

Reviewed-by: Chao Yu <chao@kernel.org>

Thanks,

> +  truncated to zero.
>   
>   Compress metadata layout::
>   
> @@ -830,12 +831,12 @@ Compress metadata layout::
>   		| cluster 1 | cluster 2 | ......... | cluster N |
>   		+-----------------------------------------------+
>   		.           .                       .           .
> -	.                       .                .                      .
> +	  .                      .                .                      .
>       .         Compressed Cluster       .        .        Normal Cluster            .
>       +----------+---------+---------+---------+  +---------+---------+---------+---------+
>       |compr flag| block 1 | block 2 | block 3 |  | block 1 | block 2 | block 3 | block 4 |
>       +----------+---------+---------+---------+  +---------+---------+---------+---------+
> -	    .                             .
> +	       .                             .
>   	    .                                           .
>   	.                                                           .
>   	+-------------+-------------+----------+----------------------------+