[f2fs-dev] [PATCH] f2fs: use inode_lock_shared instead of inode_lock in f2fs_seek_block()

2023-10-21 Thread zhangxirui via Linux-f2fs-devel
inode_lock_shared() -> down_read(&inode->i_rwsem) inode_lock() -> down_write(&inode->i_rwsem) Inode is not updated in f2fs_seek_block(), so there is no need to hold write lock, use read lock for more efficiency. Signed-off-by: zhangxirui --- fs/f2fs/file.c | 6 +++--- 1 file changed, 3 i

[f2fs-dev] [PATCH] f2fs-tools: skip check device mount state in sparse mode

2024-01-25 Thread zhangxirui via Linux-f2fs-devel
In sparse mode we just read or write to a sparse file not a block device so no need to check device mount state in sparse mode. Signed-off-by: zhangxirui --- lib/libf2fs.c | 4 1 file changed, 4 insertions(+) diff --git a/lib/libf2fs.c b/lib/libf2fs.c index 2451201..5315de2 100644 --- a/li

Re: [f2fs-dev] [PATCH] f2fs-tools: skip check device mount state in sparse mode

2024-01-31 Thread zhangxirui via Linux-f2fs-devel
On 2024/1/26 14:37, zhangxirui wrote: >> In sparse mode we just read or write to a sparse file not a block device >> so no need to check device mount state in sparse mode. > >I guess it needs to check whether regular file was a backfile of mounted >loop device, so we can only skip block device rela

Re: [f2fs-dev] [PATCH] f2fs-tools: skip check device mount state in sparse mode

2024-01-31 Thread zhangxirui via Linux-f2fs-devel
>On 2024/2/1 14:40, zhangxirui wrote: >> On 2024/1/26 14:37, zhangxirui wrote: In sparse mode we just read or write to a sparse file not a block device so no need to check device mount state in sparse mode. >>> >>> I guess it needs to check whether regular file was a backfile of mounted >

[f2fs-dev] [PATCH] f2fs-tools: reduce overprov_segment_count set times

2024-08-01 Thread zhangxirui via Linux-f2fs-devel
If overprov_segment_count < rsvd_segment_count will set_cp(overprov_segment_count) twice, reduce it. Signed-off-by: zhangxirui --- mkfs/f2fs_format.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/mkfs/f2fs_format.c b/mkfs/f2fs_format.c index e26a513..794ced5 100