Skip to contentSkip to conversation

docs: filesystems: f2fs: fix description about compress ioctl

PATCH In review Chao Liu 4 participants 6 messages Jun 13, 2022 – Jun 14, 2022

Subsystems (2)
lore
Share & tools
lore

Chao Liu

author
#0 lore raw

PATCH v2 1/1 docs: filesystems: f2fs: fix description about compress ioctl

From: Chao Liu <[email protected]>

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.

---
v2:
- s/file size/filesize/

 Documentation/filesystems/f2fs.rst | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)
Documentation/filesystems/f2fs.rst +7 -6
index ad8dc8c040a2..531b0f8a3946 100644
@@ -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 filesize 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 |
     +----------+---------+---------+---------+  +---------+---------+---------+---------+
-	    .                             .
+	       .                             .
 	    .                                           .
 	.                                                           .
 	+-------------+-------------+----------+----------------------------+
Signature · 1 line
2.36.1
#1 lore raw
Quoted 2 lines · Chao Liu

v2:
- s/file size/filesize/

Why would you change it to be wrong?

Quoted 41 lines
 Documentation/filesystems/f2fs.rst | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)
Documentation/filesystems/f2fs.rst +7 -6
index ad8dc8c040a2..531b0f8a3946 100644
@@ -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 filesize 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 |
     +----------+---------+---------+---------+  +---------+---------+---------+---------+
-	    .                             .
+	       .                             .
 	    .                                           .
 	.                                                           .
 	+-------------+-------------+----------+----------------------------+
Signature · 1 line
2.36.1
author
#2 lore raw
Quoted 6 lines · Matthew Wilcox
Quoted 2 lines · Chao Liu

v2:
- s/file size/filesize/

Why would you change it to be wrong?

This is a suggestion from Chao Yu. Maybe he has some other considerations.

Hi Chao,

Can you help with this question?

Thanks.

Quoted 41 lines
Quoted 41 lines
 Documentation/filesystems/f2fs.rst | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)
Documentation/filesystems/f2fs.rst +7 -7
index ad8dc8c040a2..531b0f8a3946 100644
@@ -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 filesize 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

maintainer
#3 lore raw
Quoted 9 lines · Chao Liu
Quoted 6 lines · Matthew Wilcox
Quoted 2 lines · Chao Liu

v2:
- s/file size/filesize/

Why would you change it to be wrong?

This is a suggestion from Chao Yu. Maybe he has some other considerations.

Sorry, I should have replied to that. I disagree with that suggestion. "Filesize" is not an English word, and there doesn't seem to be any reason to use it in our docs.

<checks>

We have to occurrences now - one already in the f2fs docs. I think we shouldn't add more. So my plan is to apply the first version of this patch. Chao Liu: is there a reason why you didn't add the Reviewed-by from Chao Yu in the second version? Chao Yu: is that tag still applicable even without the "filesize" change?

Thanks,

jon

_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

maintainer
#4 lore raw
Quoted 7 lines · Jonathan Corbet
Quoted 5 lines · Chao Liu
Quoted 4 lines · Matthew Wilcox
Quoted 2 lines · Chao Liu

v2:
- s/file size/filesize/

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

Why would you change it to be wrong?

This is a suggestion from Chao Yu. Maybe he has some other considerations.

Sorry, I should have replied to that. I disagree with that suggestion. "Filesize" is not an English word, and there doesn't seem to be any reason to use it in our docs.

My bad, out of mind at that time, sorry for my wrong suggestion...

Quoted 8 lines

<checks>

We have to occurrences now - one already in the f2fs docs. I think we shouldn't add more. So my plan is to apply the first version of this patch. Chao Liu: is there a reason why you didn't add the Reviewed-by from Chao Yu in the second version? Chao Yu: is that tag still applicable even without the "filesize" change?

Yes.

Thanks,

Quoted 4 lines

Thanks,

jon

author
#5 lore raw
In reply to Jonathan Corbet
Quoted 16 lines · Jonathan Corbet
Quoted 9 lines · Chao Liu
Quoted 6 lines · Matthew Wilcox
Quoted 2 lines · Chao Liu

v2:
- s/file size/filesize/

Why would you change it to be wrong?

This is a suggestion from Chao Yu. Maybe he has some other considerations.

Sorry, I should have replied to that. I disagree with that suggestion. "Filesize" is not an English word, and there doesn't seem to be any reason to use it in our docs.

Quoted 6 lines

<checks>

We have to occurrences now - one already in the f2fs docs. I think we shouldn't add more. So my plan is to apply the first version of this patch. Chao Liu: is there a reason why you didn't add the Reviewed-by from Chao Yu in the second version?

Sorry for my carelessness. I should have added it.

Thanks,

_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel