Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3546785ybb; Mon, 6 Apr 2020 10:47:28 -0700 (PDT) X-Google-Smtp-Source: APiQypK5r5mQFpw8nimFdQxf7CZD6AmeqfhVNiWh8EcCfy7AvddVildjJCCFjpa8AOjzxDCR+POI X-Received: by 2002:a4a:3bd7:: with SMTP id s206mr241817oos.89.1586195248390; Mon, 06 Apr 2020 10:47:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586195248; cv=none; d=google.com; s=arc-20160816; b=C4g0idsu1iPWGOgrNQZK8sV1wmKZHFiFdwj3pH561OY9dK1OT6dRGUCZkbhEEBe8fj vwC+2iGv0wNx9BGtz4fXqhwXRqGJDsD4dBKINMNj1tGrDnoZZUGNDv5qDbFvjHAezuxv GYl0YwE5L8BU2CfgzWPvb2uzVWiFjCTE3L5t8F5hfGHF8KSB0tDsiP+iuZ1pBiJqTBpE g8JVglplJkTVGFsteGPzExr31FZteTnAwQ+59QuCsZT5h8eSTBBjw6Dl6nTYMYIfRq7z WGjAd3zxcab5eJfJWjBwrXIwgKtjiV/Djy0EVg7JACV5Za0ixhsyDLjlqgsLhtN3O7IP tXWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=KN0JMxkC8RaGig3SkSi5siMg9WJaPahXlOK11HFulak=; b=gKFkFkk0V5MLnipfnRMVPReCy0gpEQ79JvVF4C+uId0p+ieuAG4NxeBdBNcm8tjcSm GurZQpsVXQKr/1fugjH2fIa6nzSpY4ACFyYjx9VwBSXzmGComCygLKd0vhAkYg807ApK ie7VzQIjh1fdVhzZvUK4DS9rtsBGKiWEzWzVF+R0vHMhTb3zERRvJJjr8QWuDGkKC4lN V6sWJm4zQmOgKAbWCtxzXlwaqKTsEUSV4sDyBHEEFhKo0QnZ+VSfvPicSbcXMvEFPl8K EGPnER2x1Ltb1WTBjpfLVXMDsOXxgLAShQLXMDFyCcYJrjRViTQMOVLD7pjKac3XwbcU /yRw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 91si107909ots.139.2020.04.06.10.47.15; Mon, 06 Apr 2020 10:47:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729828AbgDFRe7 (ORCPT + 99 others); Mon, 6 Apr 2020 13:34:59 -0400 Received: from mx2.suse.de ([195.135.220.15]:41654 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726510AbgDFRe7 (ORCPT ); Mon, 6 Apr 2020 13:34:59 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 50375C086; Mon, 6 Apr 2020 17:34:56 +0000 (UTC) From: Luis Henriques To: Jeff Layton , Sage Weil , Ilya Dryomov , Gregory Farnum , Zheng Yan Cc: Frank Schilder , ceph-devel@vger.kernel.org, linux-kernel@vger.kernel.org, Luis Henriques Subject: [PATCH 1/2] ceph: normalize 'delta' parameter usage in check_quota_exceeded Date: Mon, 6 Apr 2020 16:12:00 +0100 Message-Id: <20200406151201.32432-2-lhenriques@suse.com> In-Reply-To: <20200406151201.32432-1-lhenriques@suse.com> References: <20200406151201.32432-1-lhenriques@suse.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- fs/ceph/quota.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/fs/ceph/quota.c b/fs/ceph/quota.c index de56dee60540..c5c8050f0f99 100644 --- a/fs/ceph/quota.c +++ b/fs/ceph/quota.c @@ -361,8 +361,6 @@ static bool check_quota_exceeded(struct inode *inode, enum quota_check_op op, spin_unlock(&ci->i_ceph_lock); switch (op) { case QUOTA_CHECK_MAX_FILES_OP: - exceeded = (max && (rvalue >= max)); - break; case QUOTA_CHECK_MAX_BYTES_OP: exceeded = (max && (rvalue + delta > max)); break; @@ -417,7 +415,7 @@ bool ceph_quota_is_max_files_exceeded(struct inode *inode) 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); } /*