Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp3241057rdb; Sat, 9 Dec 2023 19:05:26 -0800 (PST) X-Google-Smtp-Source: AGHT+IGDYIThvjulv43+RSkMpjweo8RkpZewoDxGzZqHv0v8IBI3hX4zuhoKMT5IgMDf4CTdYd63 X-Received: by 2002:a05:6a00:178e:b0:6cb:4361:773c with SMTP id s14-20020a056a00178e00b006cb4361773cmr2827390pfg.5.1702177525626; Sat, 09 Dec 2023 19:05:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702177525; cv=none; d=google.com; s=arc-20160816; b=vasjKMs//dyFiNW9C7YbO9YLFHjvVAKbnBLIWbDU9AUGRPD3W6Vas4ymm92oOhsIWC +yf5YTQkytpBx/0xtdIJQAB93vKbLRRkdN8TfKWRIS9YrJODLvT6MYBzZr070i5Aa3qt eyKZHa6UcV+Sv3Lgk0uLt7RPJFf7oDiA08U5Bm6QG0QJglq0RzJ5jVmpdGbplWEXaNTG t/lnzyJEqHsSK93zdIpMzbC1blWyuK89JLbRyyqvyfUVMax1s52TX+bOmsab2gBrI3ci yqVNdFCK7c9U+mmNeE7YIqRJOzmBco/PIINqjKBcKZ+hZrVY3xTZd8xm4Zk9z4d7ufVy K3/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=hG0kqq92zIXi0MBxRd6CIuJJsvrQ+mQMf8SE/OxDU+Q=; fh=U/2TN44sUOGrnVqwzkduEfLuoE2WE3W8MDIVfCQUKMA=; b=Sps8ofiXMTk17geTlADVV9n0IZG3V06XV389+9OAKbEzMT0SwHN56Lo43mc5KTCDwI NhTrSrb2X1IqTFShvWsMYi/qqTQWCeP0b3CgpBcUIlC5eeGBYagxEtrBMUyRZ0pbcz+f YSuFMeqCpFc1WT3MC9FOHfghnKkeMRI75RCjmysmQtKlHqvM50x6ZIFmdik3ZGTMx80i pSvmqHXf7QKFHepPeT8JOFPYTIX1BufloZa7t0mdKJqlDDks+wu8ajwBR/mKx8E60oxH kK2mHYhQi30dlY9AWcKqIROouwFCmuYYm4ptglS60O3fYjbULdVuqK7NaxMgqlTgh9mH Upsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="pvK/Nj6p"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id h2-20020a056a00170200b006c33a1bdf92si3996735pfc.307.2023.12.09.19.05.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 Dec 2023 19:05:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="pvK/Nj6p"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 1CC858087FD9; Sat, 9 Dec 2023 19:05:23 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229556AbjLJCud (ORCPT + 99 others); Sat, 9 Dec 2023 21:50:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53112 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229488AbjLJCuc (ORCPT ); Sat, 9 Dec 2023 21:50:32 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 57AAA11C for ; Sat, 9 Dec 2023 18:50:39 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7CAA6C433C7; Sun, 10 Dec 2023 02:50:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1702176638; bh=Fy8/AA1OD+Qy+g3LE8R4kVkWVk6a6OxVXAjg9c/oDIY=; h=From:To:Cc:Subject:Date:From; b=pvK/Nj6puZuR4qQ1zHHitiOZsigt1+4HGBsGrDBtfYr7I50hE0hsH4ukQRJkB5KXR KrKWRD85V7B6RFQ/Cwrenir26zuliG7KuCZQ7iZ4lI7fSlfVnGU+4ukwXHwIU8jQCN oAUX9lcCad82VeK3SOWuSjiUK2CSMnP/8uyHSkEJRSm4NlC3hFBp3ouBPAbw/M9NSF dB7TcGXF6SWOwINTJN5vCkWmuYyT40AlXoIfIMZI2hASjWU5ujvOmfYYlvNZ0vNqV1 PtEquO9imX3chXv/W+8R34SmTbR/jvME5P6+ORCJQzNqk/6vFBDcUV8R2eDUKeo+C6 mygp0yaGKV5aQ== From: Chao Yu To: jack@suse.com Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, chao@kernel.org Subject: [PATCH] quota: convert dquot_claim_space_nodirty() to return void Date: Sun, 10 Dec 2023 10:50:28 +0800 Message-Id: <20231210025028.3262900-1-chao@kernel.org> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Sat, 09 Dec 2023 19:05:23 -0800 (PST) dquot_claim_space_nodirty() always return zero, let's convert it to return void, then, its caller can get rid of handling failure case. Signed-off-by: Chao Yu --- fs/quota/dquot.c | 6 +++--- include/linux/quotaops.h | 15 +++++---------- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c index 58b5de081b57..44ff2813ae51 100644 --- a/fs/quota/dquot.c +++ b/fs/quota/dquot.c @@ -1787,7 +1787,7 @@ EXPORT_SYMBOL(dquot_alloc_inode); /* * Convert in-memory reserved quotas to real consumed quotas */ -int dquot_claim_space_nodirty(struct inode *inode, qsize_t number) +void dquot_claim_space_nodirty(struct inode *inode, qsize_t number) { struct dquot **dquots; int cnt, index; @@ -1797,7 +1797,7 @@ int dquot_claim_space_nodirty(struct inode *inode, qsize_t number) *inode_reserved_space(inode) -= number; __inode_add_bytes(inode, number); spin_unlock(&inode->i_lock); - return 0; + return; } dquots = i_dquot(inode); @@ -1822,7 +1822,7 @@ int dquot_claim_space_nodirty(struct inode *inode, qsize_t number) spin_unlock(&inode->i_lock); mark_all_dquot_dirty(dquots); srcu_read_unlock(&dquot_srcu, index); - return 0; + return; } EXPORT_SYMBOL(dquot_claim_space_nodirty); diff --git a/include/linux/quotaops.h b/include/linux/quotaops.h index 4fa4ef0a173a..06cc8888199e 100644 --- a/include/linux/quotaops.h +++ b/include/linux/quotaops.h @@ -74,7 +74,7 @@ void __dquot_free_space(struct inode *inode, qsize_t number, int flags); int dquot_alloc_inode(struct inode *inode); -int dquot_claim_space_nodirty(struct inode *inode, qsize_t number); +void dquot_claim_space_nodirty(struct inode *inode, qsize_t number); void dquot_free_inode(struct inode *inode); void dquot_reclaim_space_nodirty(struct inode *inode, qsize_t number); @@ -257,10 +257,9 @@ static inline void __dquot_free_space(struct inode *inode, qsize_t number, inode_sub_bytes(inode, number); } -static inline int dquot_claim_space_nodirty(struct inode *inode, qsize_t number) +static inline void dquot_claim_space_nodirty(struct inode *inode, qsize_t number) { inode_add_bytes(inode, number); - return 0; } static inline int dquot_reclaim_space_nodirty(struct inode *inode, @@ -358,14 +357,10 @@ static inline int dquot_reserve_block(struct inode *inode, qsize_t nr) DQUOT_SPACE_WARN|DQUOT_SPACE_RESERVE); } -static inline int dquot_claim_block(struct inode *inode, qsize_t nr) +static inline void dquot_claim_block(struct inode *inode, qsize_t nr) { - int ret; - - ret = dquot_claim_space_nodirty(inode, nr << inode->i_blkbits); - if (!ret) - mark_inode_dirty_sync(inode); - return ret; + dquot_claim_space_nodirty(inode, nr << inode->i_blkbits); + mark_inode_dirty_sync(inode); } static inline void dquot_reclaim_block(struct inode *inode, qsize_t nr) -- 2.40.1