aboutsummaryrefslogtreecommitdiff
path: root/fs/f2fs
diff options
context:
space:
mode:
authorChengguang Xu2020-01-04 22:20:04 +0800
committerJaegeuk Kim2020-01-17 16:48:43 -0800
commitbf2cbd3c57159c2b639ee8797b52ab5af180bf83 (patch)
tree5eae11c1f2ad6dd11036eb45c310cf7aeaef8f91 /fs/f2fs
parentacdf2172172a511f97fa21ed0ee7609a6d3b3a07 (diff)
f2fs: code cleanup for f2fs_statfs_project()
Calling min_not_zero() to simplify complicated prjquota limit comparison in f2fs_statfs_project(). Signed-off-by: Chengguang Xu <cgxu519@mykernel.net> Reviewed-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs')
-rw-r--r--fs/f2fs/super.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index 904b5fbd5662..593dc3d2b80b 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -1282,12 +1282,8 @@ static int f2fs_statfs_project(struct super_block *sb,
return PTR_ERR(dquot);
spin_lock(&dquot->dq_dqb_lock);
- limit = 0;
- if (dquot->dq_dqb.dqb_bsoftlimit)
- limit = dquot->dq_dqb.dqb_bsoftlimit;
- if (dquot->dq_dqb.dqb_bhardlimit &&
- (!limit || dquot->dq_dqb.dqb_bhardlimit < limit))
- limit = dquot->dq_dqb.dqb_bhardlimit;
+ limit = min_not_zero(dquot->dq_dqb.dqb_bsoftlimit,
+ dquot->dq_dqb.dqb_bhardlimit);
if (limit)
limit >>= sb->s_blocksize_bits;
@@ -1299,12 +1295,8 @@ static int f2fs_statfs_project(struct super_block *sb,
(buf->f_blocks - curblock) : 0;
}
- limit = 0;
- if (dquot->dq_dqb.dqb_isoftlimit)
- limit = dquot->dq_dqb.dqb_isoftlimit;
- if (dquot->dq_dqb.dqb_ihardlimit &&
- (!limit || dquot->dq_dqb.dqb_ihardlimit < limit))
- limit = dquot->dq_dqb.dqb_ihardlimit;
+ limit = min_not_zero(dquot->dq_dqb.dqb_isoftlimit,
+ dquot->dq_dqb.dqb_ihardlimit);
if (limit && buf->f_files > limit) {
buf->f_files = limit;