Skip to content

Commit daa668f

Browse files
Luis Henriquesidryomov
authored andcommitted
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>
1 parent 829ad4d commit daa668f

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

‎fs/ceph/quota.c‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -361,8 +361,6 @@ static bool check_quota_exceeded(struct inode *inode, enum quota_check_op op,
361361
spin_unlock(&ci->i_ceph_lock);
362362
switch (op) {
363363
case QUOTA_CHECK_MAX_FILES_OP:
364-
exceeded = (max && (rvalue >= max));
365-
break;
366364
case QUOTA_CHECK_MAX_BYTES_OP:
367365
exceeded = (max && (rvalue + delta > max));
368366
break;
@@ -417,7 +415,7 @@ bool ceph_quota_is_max_files_exceeded(struct inode *inode)
417415

418416
WARN_ON(!S_ISDIR(inode->i_mode));
419417

420-
return check_quota_exceeded(inode, QUOTA_CHECK_MAX_FILES_OP, 0);
418+
return check_quota_exceeded(inode, QUOTA_CHECK_MAX_FILES_OP, 1);
421419
}
422420

423421
/*

0 commit comments

Comments
 (0)