mirror of https://gitee.com/openkylin/linux.git
ceph: normalize 'delta' parameter usage in check_quota_exceeded
Function check_quota_exceeded() uses delta parameter only for the QUOTA_CHECK_MAX_BYTES_OP operation. Using this parameter also for MAX_FILES will makes the code cleaner and will be required to support cross-quota-tree renames. Signed-off-by: Luis Henriques <lhenriques@suse.com> Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
This commit is contained in:
parent
829ad4db95
commit
daa668fbac
|
@ -361,8 +361,6 @@ static bool check_quota_exceeded(struct inode *inode, enum quota_check_op op,
|
||||||
spin_unlock(&ci->i_ceph_lock);
|
spin_unlock(&ci->i_ceph_lock);
|
||||||
switch (op) {
|
switch (op) {
|
||||||
case QUOTA_CHECK_MAX_FILES_OP:
|
case QUOTA_CHECK_MAX_FILES_OP:
|
||||||
exceeded = (max && (rvalue >= max));
|
|
||||||
break;
|
|
||||||
case QUOTA_CHECK_MAX_BYTES_OP:
|
case QUOTA_CHECK_MAX_BYTES_OP:
|
||||||
exceeded = (max && (rvalue + delta > max));
|
exceeded = (max && (rvalue + delta > max));
|
||||||
break;
|
break;
|
||||||
|
@ -417,7 +415,7 @@ bool ceph_quota_is_max_files_exceeded(struct inode *inode)
|
||||||
|
|
||||||
WARN_ON(!S_ISDIR(inode->i_mode));
|
WARN_ON(!S_ISDIR(inode->i_mode));
|
||||||
|
|
||||||
return check_quota_exceeded(inode, QUOTA_CHECK_MAX_FILES_OP, 0);
|
return check_quota_exceeded(inode, QUOTA_CHECK_MAX_FILES_OP, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in New Issue