From nobody Tue Dec 16 16:37:44 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2B0ECC46CC5 for ; Sun, 10 Dec 2023 03:15:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231402AbjLJCue (ORCPT ); Sat, 9 Dec 2023 21:50:34 -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: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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, qs= ize_t number) *inode_reserved_space(inode) -=3D number; __inode_add_bytes(inode, number); spin_unlock(&inode->i_lock); - return 0; + return; } =20 dquots =3D i_dquot(inode); @@ -1822,7 +1822,7 @@ int dquot_claim_space_nodirty(struct inode *inode, qs= ize_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); =20 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 numb= er, int flags); =20 int dquot_alloc_inode(struct inode *inode); =20 -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); =20 @@ -257,10 +257,9 @@ static inline void __dquot_free_space(struct inode *in= ode, qsize_t number, inode_sub_bytes(inode, number); } =20 -static inline int dquot_claim_space_nodirty(struct inode *inode, qsize_t n= umber) +static inline void dquot_claim_space_nodirty(struct inode *inode, qsize_t = number) { inode_add_bytes(inode, number); - return 0; } =20 static inline int dquot_reclaim_space_nodirty(struct inode *inode, @@ -358,14 +357,10 @@ static inline int dquot_reserve_block(struct inode *i= node, qsize_t nr) DQUOT_SPACE_WARN|DQUOT_SPACE_RESERVE); } =20 -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 =3D 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); } =20 static inline void dquot_reclaim_block(struct inode *inode, qsize_t nr) --=20 2.40.1