Re: [f2fs-dev] [PATCH v4] f2fs: fix to enable compress for newly created file if extension matches

2022-11-23 Thread Sheng Yong via Linux-f2fs-devel
On 2022/11/23 22:54, Chao Yu wrote: On 2022/11/17 9:12, Jaegeuk Kim wrote: If compress_extension is set, and a newly created file matches the extension, the file could be marked as compression file. However, if inline_data is also enabled, there is no chance to check its extension since

[f2fs-dev] [PATCH v3] f2fs: fix to enable compress for newly created file if extension matches

2022-11-15 Thread Sheng Yong via Linux-f2fs-devel
If compress_extension is set, and a newly created file matches the extension, the file could be marked as compression file. However, if inline_data is also enabled, there is no chance to check its extension since f2fs_should_compress() always returns false. This patch moves set_compress_inode(),

[f2fs-dev] [PATCH] f2fs: set zstd compress level correctly

2022-11-17 Thread Sheng Yong via Linux-f2fs-devel
Fixes: cf30f6a5f0c6 ("lib: zstd: Add kernel-specific API") Signed-off-by: Sheng Yong --- fs/f2fs/compress.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/f2fs/compress.c b/fs/f2fs/compress.c index d315c2de136f2..74d3f2d2271f3 100644 --- a/fs/f2fs/compress.c +++

Re: [f2fs-dev] [PATCH v4] f2fs: fix to enable compress for newly created file if extension matches

2022-11-15 Thread Sheng Yong via Linux-f2fs-devel
On 2022/11/16 7:00, Jaegeuk Kim wrote: If compress_extension is set, and a newly created file matches the extension, the file could be marked as compression file. However, if inline_data is also enabled, there is no chance to check its extension since f2fs_should_compress() always returns

[f2fs-dev] [PATCH 4/4] fsck.f2fs: avoid uncessary recalculation

2022-11-10 Thread Sheng Yong via Linux-f2fs-devel
There is no need to recalculate ADDRS_PER_INODE and ADDRS_PER_BLOCK, especially in a for loop. Signed-off-by: Sheng Yong --- fsck/fsck.c | 19 +-- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/fsck/fsck.c b/fsck/fsck.c index ebc60ad..ec096f2 100644 ---

[f2fs-dev] [PATCH 3/4] fsck.f2fs: fix potential overflow of copying i_name

2022-11-10 Thread Sheng Yong via Linux-f2fs-devel
If i_namelen is corrupted, there may be an overflow when doing memcpy. Signed-off-by: Sheng Yong --- fsck/fsck.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fsck/fsck.c b/fsck/fsck.c index 036a834..ebc60ad 100644 --- a/fsck/fsck.c +++ b/fsck/fsck.c @@ -742,8

[f2fs-dev] [PATCH 1/4] dump.f2fs: remove unavailable optiont -g

2022-11-10 Thread Sheng Yong via Linux-f2fs-devel
Option "-g" for dump.f2fs is unavailable and not used in dump.f2fs. Signed-off-by: Sheng Yong --- fsck/main.c | 12 +++- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/fsck/main.c b/fsck/main.c index 3268664..9b50787 100644 --- a/fsck/main.c +++ b/fsck/main.c @@ -273,8

[f2fs-dev] [PATCH 2/4] fsck.f2fs: add parentheses for SB_MASK

2022-11-10 Thread Sheng Yong via Linux-f2fs-devel
Signed-off-by: Sheng Yong --- fsck/fsck.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fsck/fsck.h b/fsck/fsck.h index 939450f..dabd8b9 100644 --- a/fsck/fsck.h +++ b/fsck/fsck.h @@ -50,7 +50,7 @@ enum SB_ADDR { SB_MAX_ADDR, }; -#define SB_MASK(i) (1 << i)

[f2fs-dev] [PATCH v2 2/2] f2fs: move set_file_temperature into f2fs_new_inode

2022-11-11 Thread Sheng Yong via Linux-f2fs-devel
Since the file name has already passed to f2fs_new_inode(), let's move set_file_temperature() into f2fs_new_inode(). Signed-off-by: Sheng Yong --- fs/f2fs/namei.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/f2fs/namei.c b/fs/f2fs/namei.c index

[f2fs-dev] [PATCH v2 1/2] f2fs: fix to enable compress for newly created file if extension matches

2022-11-11 Thread Sheng Yong via Linux-f2fs-devel
If compress_extension is set, and a newly created file matches the extension, the file could be marked as compression file. However, if inline_data is also enabled, there is no chance to check its extension since f2fs_should_compress() always returns false. This patch moves set_compress_inode(),

[f2fs-dev] [PATCH] f2fs: fix to enable compress for newly created file if extension matches

2022-11-09 Thread Sheng Yong via Linux-f2fs-devel
If compress_extension is set, and a newly created file matches the extension, the file could be marked as compression file. However, if inline_data is also enabled, there is no chance to check its extension since f2fs_should_compress() always returns false. So if a new file is created (its inode

Re: [f2fs-dev] [PATCH] f2fs: fix to enable compress for newly created file if extension matches

2022-11-09 Thread Sheng Yong via Linux-f2fs-devel
在 2022/11/9 21:57, Chao Yu 写道: On 2022/11/9 19:01, Sheng Yong wrote: If compress_extension is set, and a newly created file matches the extension, the file could be marked as compression file. However, if inline_data is also enabled, there is no chance to check its extension since

[f2fs-dev] [PATCH v2] fsck.f2fs: avoid uncessary recalculation

2022-11-14 Thread Sheng Yong via Linux-f2fs-devel
There is no need to recalculate ADDRS_PER_INODE and ADDRS_PER_BLOCK, especially in a for loop. Signed-off-by: Sheng Yong --- fsck/fsck.c | 19 +-- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/fsck/fsck.c b/fsck/fsck.c index ebc60ad..df91c82 100644 ---

Re: [f2fs-dev] [PATCH v2 1/2] f2fs: fix to enable compress for newly created file if extension matches

2022-11-13 Thread Sheng Yong via Linux-f2fs-devel
On 2022/11/12 9:27, Jaegeuk Kim wrote: Does thes make sense? https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs.git/commit/?h=dev-test=608460dfae20b9d23aa222f7448710a086778222

[f2fs-dev] [RFC PATCH] f2fs: expand f2fs_compr_option to allow ioctl setting compression level

2023-03-30 Thread Sheng Yong via Linux-f2fs-devel
This patch adds `level` in `struct f2fs_compr_option` to allow ioctl setting compression level. The first byte of original f2fs_compr_option indicates which algorithm is used. While the new f2fs_compr_option splits the first byte into two parts: * the MBS 4 bits indicate the version * the LBS

Re: [f2fs-dev] [RFC PATCH] f2fs: expand f2fs_compr_option to allow ioctl setting compression level

2023-03-30 Thread Sheng Yong via Linux-f2fs-devel
On 2023/3/31 0:15, Yangtao Li wrote: Hi Sheng Yong, Your idea, I also put forward before. And has been sent to version 2, but Chao and Jaegeuk have no comments yet. Time to talk about the series? https://lore.kernel.org/linux-f2fs-devel/20230112133503.16802-1-frank...@vivo.com/ Hi,

Re: [f2fs-dev] [PATCH v4 1/6] f2fs: add helper to check compression level

2023-06-12 Thread Sheng Yong via Linux-f2fs-devel
On 2023/6/13 6:14, Jaegeuk Kim wrote: Could you please check this version? https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs.git/commit/?h=dev-test=9c84aad379019a0d86655bb50bd7b4bc92683c4b Hi, Jaegeuk, Thanks for cleaning it up. This version looks good to me. I tested it with my

Re: [f2fs-dev] [PATCH v4 5/6] f2fs: add f2fs_ioc_[get|set]_extra_attr

2023-06-12 Thread Sheng Yong via Linux-f2fs-devel
On 2023/6/12 23:47, Jaegeuk Kim wrote: On 06/12, Sheng Yong wrote: This patch introduces two ioctls: * f2fs_ioc_get_extra_attr * f2fs_ioc_set_extra_attr to get or modify values in f2fs_inode's extra attribute area. What'd be the main purpose of this new ioctl? Use-cases or examples?

[f2fs-dev] [PATCH] f2fs: add f2fs_ioc_[get|set]_extra_attr

2023-05-28 Thread Sheng Yong via Linux-f2fs-devel
This patch introduces two ioctls: * f2fs_ioc_get_extra_attr * f2fs_ioc_set_extra_attr to get or modify values in extra attribute area. The argument of these two ioctls is `struct f2fs_extra_attr', which has three members: * field: indicates which field in extra attribute area is handled *

[f2fs-dev] [PATCH 1/2] f2fs_io: add [get|set_attr] to access inode extra attributes

2023-05-28 Thread Sheng Yong via Linux-f2fs-devel
This patch adds get_attr and set_attr to access inode's extra attributes. Signed-off-by: Sheng Yong --- tools/f2fs_io/f2fs_io.c | 165 tools/f2fs_io/f2fs_io.h | 34 + 2 files changed, 199 insertions(+) diff --git a/tools/f2fs_io/f2fs_io.c

[f2fs-dev] [PATCH 2/2] f2fs_io: convert compression ioctls to [get|set]_attr

2023-05-28 Thread Sheng Yong via Linux-f2fs-devel
Convert compression related ioctls to get extra attr ioctls. Signed-off-by: Sheng Yong --- tools/f2fs_io/f2fs_io.c | 25 ++--- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/tools/f2fs_io/f2fs_io.c b/tools/f2fs_io/f2fs_io.c index 70e0347..f6e6057 100644 ---

[f2fs-dev] [PATCH v2] f2fs: add f2fs_ioc_[get|set]_extra_attr

2023-05-30 Thread Sheng Yong via Linux-f2fs-devel
This patch introduces two ioctls: * f2fs_ioc_get_extra_attr * f2fs_ioc_set_extra_attr to get or modify values in extra attribute area. The argument of these two ioctls is `struct f2fs_extra_attr', which has three members: * field: indicates which field in extra attribute area is handled *

Re: [f2fs-dev] [PATCH] f2fs: add f2fs_ioc_[get|set]_extra_attr

2023-06-01 Thread Sheng Yong via Linux-f2fs-devel
On 2023/6/1 11:16, Eric Biggers wrote: On Mon, May 29, 2023 at 09:35:00AM +0800, Sheng Yong via Linux-f2fs-devel wrote: This patch introduces two ioctls: * f2fs_ioc_get_extra_attr * f2fs_ioc_set_extra_attr to get or modify values in extra attribute area. The argument of these two

[f2fs-dev] [PATCH v4 2/6] f2fs: cleanup MIN_INLINE_XATTR_SIZE

2023-06-11 Thread Sheng Yong via Linux-f2fs-devel
Signed-off-by: Sheng Yong --- fs/f2fs/super.c | 2 +- fs/f2fs/xattr.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index 023981824d240..d7630f6dcbd62 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -1361,7 +1361,7 @@ static int

[f2fs-dev] [PATCH v4 3/6] f2fs: add helper to get inode chksum from inode page

2023-06-11 Thread Sheng Yong via Linux-f2fs-devel
Signed-off-by: Sheng Yong --- fs/f2fs/f2fs.h | 2 ++ fs/f2fs/inode.c | 21 + 2 files changed, 23 insertions(+) diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index 1b17bbe7e8656..a30c81ac7299d 100644 --- a/fs/f2fs/f2fs.h +++ b/fs/f2fs/f2fs.h @@ -3478,6 +3478,8 @@ int

[f2fs-dev] [PATCH v4 5/6] f2fs: add f2fs_ioc_[get|set]_extra_attr

2023-06-11 Thread Sheng Yong via Linux-f2fs-devel
This patch introduces two ioctls: * f2fs_ioc_get_extra_attr * f2fs_ioc_set_extra_attr to get or modify values in f2fs_inode's extra attribute area. The argument of these two ioctls is `struct f2fs_extra_attr', which has three members: * field: indicates which field in extra attribute area

[f2fs-dev] [PATCH v4 4/6] f2fs: add f2fs_ioc_get_compress_blocks

2023-06-11 Thread Sheng Yong via Linux-f2fs-devel
This patch adds f2fs_ioc_get_compress_blocks() to provide a common f2fs_get_compress_blocks(). Signed-off-by: Sheng Yong --- fs/f2fs/file.c | 23 +-- 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index

[f2fs-dev] [PATCH v4 0/6] f2fs: add f2fs_ioc_[get|set]_extra_attr

2023-06-11 Thread Sheng Yong via Linux-f2fs-devel
This patchset introduces two ioctls to get or modify values in f2fs_inode's extra attribute area: * f2fs_ioc_get_extra_attr * f2fs_ioc_set_extra_attr The argument of these two ioctls is `struct f2fs_extra_attr', which has three members: * field: indicates which field in extra attribute area

[f2fs-dev] [PATCH v4 1/6] f2fs: add helper to check compression level

2023-06-11 Thread Sheng Yong via Linux-f2fs-devel
This patch adds a helper function to check if compression level is valid. Signed-off-by: Sheng Yong --- fs/f2fs/compress.c | 31 +++ fs/f2fs/f2fs.h | 2 ++ fs/f2fs/super.c| 4 ++-- 3 files changed, 35 insertions(+), 2 deletions(-) diff --git

[f2fs-dev] [PATCH v4 6/6] f2fs: access compression level and flags by extra attr ioctls

2023-06-11 Thread Sheng Yong via Linux-f2fs-devel
Allow getting or setting compression level and flags through F2FS_IOC_GET_EXTRA_ATTR and F2FS_IOC_SET_EXTRA_ATTR. Signed-off-by: Sheng Yong --- fs/f2fs/file.c| 56 --- include/uapi/linux/f2fs.h | 10 ++- 2 files changed, 55 insertions(+), 11

[f2fs-dev] [PATCH v3] f2fs: add f2fs_ioc_[get|set]_extra_attr

2023-06-03 Thread Sheng Yong via Linux-f2fs-devel
This patch introduces two ioctls: * f2fs_ioc_get_extra_attr * f2fs_ioc_set_extra_attr to get or modify values in extra attribute area. The argument of these two ioctls is `struct f2fs_extra_attr', which has three members: * field: indicates which field in extra attribute area is handled *

[f2fs-dev] [PATCH v2 2/2] f2fs_io: convert compression ioctls to [get|set]_attr

2023-06-03 Thread Sheng Yong via Linux-f2fs-devel
Convert old compression ioctls to get extra attr ioctls. Signed-off-by: Sheng Yong --- tools/f2fs_io/f2fs_io.c | 25 ++--- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/tools/f2fs_io/f2fs_io.c b/tools/f2fs_io/f2fs_io.c index 70e0347..f6e6057 100644 ---

[f2fs-dev] [PATCH v2 1/2] f2fs_io: add [get|set_attr] to access inode extra attributes

2023-06-03 Thread Sheng Yong via Linux-f2fs-devel
This patch adds get_attr and set_attr to access inode's extra attributes. Signed-off-by: Sheng Yong --- v2: update manpage of f2fs_io --- man/f2fs_io.8 | 65 tools/f2fs_io/f2fs_io.c | 165 tools/f2fs_io/f2fs_io.h | 34

[f2fs-dev] [PATCH RFC] f2fs: only set release for file that has compressed data

2023-06-27 Thread Sheng Yong via Linux-f2fs-devel
If a file is not comprssed yet or does not have compressed data, for example, its data has a very low compression ratio, do not set FI_COMPRESS_RELEASED flag. Signed-off-by: Sheng Yong --- fs/f2fs/file.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/fs/f2fs/file.c

Re: [f2fs-dev] [PATCH] resize.f2fs: get value from new sb during rebuilding cp

2024-04-08 Thread Sheng Yong via Linux-f2fs-devel
On 2024/4/9 2:34, Jaegeuk Kim wrote: On 04/08, Sheng Yong wrote: Althrough old and new sb have the same value for now, it would be better to build new checkpoint according to new sb. May need to add assert, if they're different? We could add assert here, but I think it's not that

[f2fs-dev] [PATCH] f2fs-tools: print extension list properly

2024-04-08 Thread Sheng Yong via Linux-f2fs-devel
The "hot file extensions" list does not print properly. **Before** extension_count [0x 23 : 35] cold file extentsions [mp wm og jp ] [avi m4v m4p mkv ]

[f2fs-dev] [PATCH] resize.f2fs: get value from new sb during rebuilding cp

2024-04-08 Thread Sheng Yong via Linux-f2fs-devel
Althrough old and new sb have the same value for now, it would be better to build new checkpoint according to new sb. Signed-off-by: Sheng Yong --- fsck/resize.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/fsck/resize.c b/fsck/resize.c index 049ddd3..1b4ae85

Re: [f2fs-dev] [PATCH] resize.f2fs: get value from new sb during rebuilding cp

2024-04-09 Thread Sheng Yong via Linux-f2fs-devel
On 2024/4/10 8:38, Jaegeuk Kim wrote: On 04/09, Sheng Yong wrote: On 2024/4/9 2:34, Jaegeuk Kim wrote: On 04/08, Sheng Yong wrote: Althrough old and new sb have the same value for now, it would be better to build new checkpoint according to new sb. May need to add assert, if they're

[f2fs-dev] [PATCH] mkfs.f2fs: align each device to zone size

2024-04-10 Thread Sheng Yong via Linux-f2fs-devel
For multiple device, each device should be aligned to zone size, instead of aligning the total size. Signed-off-by: Sheng Yong --- mkfs/f2fs_format.c | 13 +++-- 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/mkfs/f2fs_format.c b/mkfs/f2fs_format.c index 8f632f8..9e1b0d6