Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Luis Henriques and committed by
Ilya Dryomov
daa668fb 829ad4db

+1 -3
+1 -3
fs/ceph/quota.c
··· 361 361 spin_unlock(&ci->i_ceph_lock); 362 362 switch (op) { 363 363 case QUOTA_CHECK_MAX_FILES_OP: 364 - exceeded = (max && (rvalue >= max)); 365 - break; 366 364 case QUOTA_CHECK_MAX_BYTES_OP: 367 365 exceeded = (max && (rvalue + delta > max)); 368 366 break; ··· 415 417 416 418 WARN_ON(!S_ISDIR(inode->i_mode)); 417 419 418 - return check_quota_exceeded(inode, QUOTA_CHECK_MAX_FILES_OP, 0); 420 + return check_quota_exceeded(inode, QUOTA_CHECK_MAX_FILES_OP, 1); 419 421 } 420 422 421 423 /*