mirror of
https://github.com/torvalds/linux.git
synced 2024-11-11 06:31:49 +00:00
ext4: code cleanup for ext4_statfs_project()
Calling min_not_zero() to simplify complicated prjquota limit comparison in ext4_statfs_project(). Signed-off-by: Chengguang Xu <cgxu519@mykernel.net> Link: https://lore.kernel.org/r/20200210082445.2379-1-cgxu519@mykernel.net Signed-off-by: Theodore Ts'o <tytso@mit.edu>
This commit is contained in:
parent
72f9da1d5c
commit
a08fe66e4a
@ -5622,10 +5622,8 @@ static int ext4_statfs_project(struct super_block *sb,
|
|||||||
return PTR_ERR(dquot);
|
return PTR_ERR(dquot);
|
||||||
spin_lock(&dquot->dq_dqb_lock);
|
spin_lock(&dquot->dq_dqb_lock);
|
||||||
|
|
||||||
limit = dquot->dq_dqb.dqb_bsoftlimit;
|
limit = min_not_zero(dquot->dq_dqb.dqb_bsoftlimit,
|
||||||
if (dquot->dq_dqb.dqb_bhardlimit &&
|
dquot->dq_dqb.dqb_bhardlimit);
|
||||||
(!limit || dquot->dq_dqb.dqb_bhardlimit < limit))
|
|
||||||
limit = dquot->dq_dqb.dqb_bhardlimit;
|
|
||||||
limit >>= sb->s_blocksize_bits;
|
limit >>= sb->s_blocksize_bits;
|
||||||
|
|
||||||
if (limit && buf->f_blocks > limit) {
|
if (limit && buf->f_blocks > limit) {
|
||||||
@ -5637,11 +5635,8 @@ static int ext4_statfs_project(struct super_block *sb,
|
|||||||
(buf->f_blocks - curblock) : 0;
|
(buf->f_blocks - curblock) : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
limit = dquot->dq_dqb.dqb_isoftlimit;
|
limit = min_not_zero(dquot->dq_dqb.dqb_isoftlimit,
|
||||||
if (dquot->dq_dqb.dqb_ihardlimit &&
|
dquot->dq_dqb.dqb_ihardlimit);
|
||||||
(!limit || dquot->dq_dqb.dqb_ihardlimit < limit))
|
|
||||||
limit = dquot->dq_dqb.dqb_ihardlimit;
|
|
||||||
|
|
||||||
if (limit && buf->f_files > limit) {
|
if (limit && buf->f_files > limit) {
|
||||||
buf->f_files = limit;
|
buf->f_files = limit;
|
||||||
buf->f_ffree =
|
buf->f_ffree =
|
||||||
|
Loading…
Reference in New Issue
Block a user