f2fs: move mnt_want_write_file after range check
This patch move mnt_want_write_file after range check, it's needless to check arguments with it. Signed-off-by: Yunlei He <heyunlei@huawei.com> Reviewed-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
This commit is contained in:
parent
8bb9a8da75
commit
bb01582453
1 changed files with 5 additions and 5 deletions
|
@ -2060,15 +2060,15 @@ static int f2fs_ioc_gc_range(struct file *filp, unsigned long arg)
|
||||||
if (f2fs_readonly(sbi->sb))
|
if (f2fs_readonly(sbi->sb))
|
||||||
return -EROFS;
|
return -EROFS;
|
||||||
|
|
||||||
|
end = range.start + range.len;
|
||||||
|
if (range.start < MAIN_BLKADDR(sbi) || end >= MAX_BLKADDR(sbi)) {
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
ret = mnt_want_write_file(filp);
|
ret = mnt_want_write_file(filp);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
end = range.start + range.len;
|
|
||||||
if (range.start < MAIN_BLKADDR(sbi) || end >= MAX_BLKADDR(sbi)) {
|
|
||||||
ret = -EINVAL;
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
do_more:
|
do_more:
|
||||||
if (!range.sync) {
|
if (!range.sync) {
|
||||||
if (!mutex_trylock(&sbi->gc_mutex)) {
|
if (!mutex_trylock(&sbi->gc_mutex)) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue