f2fs: allow compression of files without blocks
PATCH 1/1 f2fs: allow compression of files without blocks
From: Chao Liu <[email protected]>
Files created by truncate have a size but no blocks, so they can be allowed to enable compression.
--- fs/f2fs/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/f2fs/file.c +1 -1
@@ -1879,7 +1879,7 @@ static int f2fs_setflags_common(struct inode *inode, u32 iflags, u32 mask)if (iflags &F2FS_COMPR_FL ) {if (!f2fs_may_compress (inode))return -EINVAL ; -if (S_ISREG (inode->i_mode) && inode->i_size) +if (S_ISREG (inode->i_mode) &&F2FS_HAS_BLOCKS (inode))return -EINVAL ;set_compress_context (inode);
Signature · 1 line
2.36.1
Chao Yu
maintainerQuoted 3 lines · Chao Liu
From: Chao Liu <[email protected]>
Files created by truncate have a size but no blocks, so
I didn't get it, how can we create file by truncation...
Thanks,
Quoted 20 lines
they can be allowed to enable compression.
Signed-off-by Chao Liu <[email protected]>--- fs/f2fs/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)fs/f2fs/file.c +1
-1@@ -1879,7 +1879,7 @@ static int f2fs_setflags_common(struct inode *inode, u32 iflags, u32 mask)if (iflags &F2FS_COMPR_FL ) {if (!f2fs_may_compress (inode))return -EINVAL ; -if (S_ISREG (inode->i_mode) && inode->i_size) +if (S_ISREG (inode->i_mode) &&F2FS_HAS_BLOCKS (inode))return -EINVAL ;set_compress_context (inode);
Quoted 6 lines · Chao Yu
Quoted 3 lines · Chao Liu
From: Chao Liu <[email protected]>
Files created by truncate have a size but no blocks, so
I didn't get it, how can we create file by truncation...
I'm sorry I didn't make it clear. We can create a file by passing a FILE parameter that does not exist to the user command truncate(1) [1].
How about using truncate(1) instead of truncate in the description of the change?
Thanks,
[1] truncate(1): https://man7.org/linux/man-pages/man1/truncate.1.html
_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
Ping.
Quoted 18 lines · Chao Liu
Quoted 6 lines · Chao Yu
Quoted 3 lines · Chao Liu
From: Chao Liu <[email protected]>
Files created by truncate have a size but no blocks, so
I didn't get it, how can we create file by truncation...
I'm sorry I didn't make it clear. We can create a file by passing a FILE parameter that does not exist to the user command truncate(1) [1].
How about using truncate(1) instead of truncate in the description of the change?
Thanks,
[1] truncate(1): https://man7.org/linux/man-pages/man1/truncate.1.html
Chao Yu
maintainerQuoted 6 lines · Chao Liu
Quoted 5 lines · Chao Yu
Quoted 3 lines · Chao Liu
From: Chao Liu <[email protected]>
Files created by truncate have a size but no blocks, so
Quoted 8 lines
Quoted 1 line
I didn't get it, how can we create file by truncation...
I'm sorry I didn't make it clear. We can create a file by passing a FILE parameter that does not exist to the user command truncate(1) [1].
How about using truncate(1) instead of truncate in the description of the change?
Fine to me, as f2fs_disable_compressed_file() uses the same check condition. ;)
Thanks,
Quoted 4 lines
Thanks,
[1] truncate(1): https://man7.org/linux/man-pages/man1/truncate.1.html
Quoted 13 lines · Chao Yu
Quoted 12 lines · Chao Liu
Quoted 6 lines · Chao Yu
Quoted 3 lines · Chao Liu
From: Chao Liu <[email protected]>
Files created by truncate have a size but no blocks, so
I didn't get it, how can we create file by truncation...
I'm sorry I didn't make it clear. We can create a file by passing a FILE parameter that does not exist to the user command truncate(1) [1].
Quoted 5 lines
Quoted 2 lines
How about using truncate(1) instead of truncate in the description of the change?
Fine to me, as
f2fs_disable_compressed_file()uses the same check condition. ;)
Thank you, let me send a v2 patch later. :-D
_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel