Message ID | 1730354393-19672-1-git-send-email-zhiguo.niu@unisoc.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | [f2fs-dev,1/2] f2fs: remove redundant atomic file check in defragment | expand |
On 2024/10/31 13:59, Zhiguo Niu wrote: > f2fs_is_atomic_file(inode) is checked in f2fs_defragment_range, > so remove the redundant checking in f2fs_ioc_defragment. > > Signed-off-by: Zhiguo Niu <zhiguo.niu@unisoc.com> Reviewed-by: Chao Yu <chao@kernel.org> Thanks,
diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index 75a8b22..3e22f6e 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -2883,7 +2883,7 @@ static int f2fs_ioc_defragment(struct file *filp, unsigned long arg) if (!capable(CAP_SYS_ADMIN)) return -EPERM; - if (!S_ISREG(inode->i_mode) || f2fs_is_atomic_file(inode)) + if (!S_ISREG(inode->i_mode)) return -EINVAL; if (f2fs_readonly(sbi->sb))
f2fs_is_atomic_file(inode) is checked in f2fs_defragment_range, so remove the redundant checking in f2fs_ioc_defragment. Signed-off-by: Zhiguo Niu <zhiguo.niu@unisoc.com> --- fs/f2fs/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)