Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp4233556ybb; Tue, 7 Apr 2020 03:30:43 -0700 (PDT) X-Google-Smtp-Source: APiQypJ+chEdNaqmncY+/86UCG2Dkx2Z592MmVwOHLo+RlxCDL0PW28zFkLn7f/6rT1KwR6nvcvB X-Received: by 2002:aca:4c57:: with SMTP id z84mr1078505oia.53.1586255443062; Tue, 07 Apr 2020 03:30:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586255443; cv=none; d=google.com; s=arc-20160816; b=Nl3cuXgUQzt8OA3yffmy2DiSINnFXh+ktFdc6n/znGNtUSDKhOHuJ3vlR5Zznht5n5 7rcfIO+vGy8maX4yafWdnSekRzk9mLC/j4qR0WyjLOiG07n7iLLd4e3oakXtppYwVnpY WskObwZWOKEjSDioCCpHiihOJ19xadcokFpgP4CSxB15wncgV3wDoxjxLJTuIzQrfZqb lXpor4MZSstBrc66aZ2y7YKV7Zr8pd1sEIJFDifYM4eDXo6/er5w8/ew+cS/dSEb4I0Y bBtK5c3bYIExnLHKnpxA4Ewu+ifZznPyhoi60heybU/kmUp1jIj+ikTpUDt/rRo7mJwo wMaQ== 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=V8EZhevILCPEADp7G3L5vKoVLthrlkFdfT2v09ece3n2qJukkXSCZxGsvUeb8FgP0s IUFJklnkkNVWt5hEbRM/Krsy+xPFOQPOPUo2uMuCH7IiwQ1v6n0OHVi6cV8CmAZ5QWsN Y83N2QiJgpE//UZgnd/+Xvxt6mpAhMComNltIBC3D3tu4H+HjqTMpOcsFvX8rBRD/Lh4 Mk1ptBWWUJqrUFe4C3NnGKZRqkgdnovcSiyg9X/BZLMKKIgDOA+QkAFdEBc3v1PAkjmu CuhI6h7LCxAve4ItAksmgTq8CE1tMmcRTVBaTi+kVSuqbwEOZnm2O3aN7SK5DOOzdfEc 9Nyg== 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 c133si517634oif.272.2020.04.07.03.30.31; Tue, 07 Apr 2020 03:30:43 -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 S1728707AbgDGKaF (ORCPT + 99 others); Tue, 7 Apr 2020 06:30:05 -0400 Received: from mx2.suse.de ([195.135.220.15]:48736 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728507AbgDGKaD (ORCPT ); Tue, 7 Apr 2020 06:30:03 -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 B84E9AF22; Tue, 7 Apr 2020 10:30:00 +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 v2 1/2] ceph: normalize 'delta' parameter usage in check_quota_exceeded Date: Tue, 7 Apr 2020 11:30:19 +0100 Message-Id: <20200407103020.22588-2-lhenriques@suse.com> In-Reply-To: <20200407103020.22588-1-lhenriques@suse.com> References: <20200407103020.22588-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); } /*