Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp3931278rdb; Mon, 11 Dec 2023 04:28:12 -0800 (PST) X-Google-Smtp-Source: AGHT+IG2s8kOh2p78yi4DvsNKCDxga7fNHCuRVioij9N79sGlTsqvueqBzi6a+RNTXPZCM5sly3e X-Received: by 2002:a05:6a00:1406:b0:6ce:2731:d5c1 with SMTP id l6-20020a056a00140600b006ce2731d5c1mr2264436pfu.50.1702297691818; Mon, 11 Dec 2023 04:28:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702297691; cv=none; d=google.com; s=arc-20160816; b=jJRpJLqXQEWH8Hh6+RANsQZQ9JVHTXpsF+QToNMbnhIJ15zysace4mypGZMz6Yu81Z SrKXEqlvLBw7COB5FwOh7bMZEcsezASfT3eBBnzvVHklB3jymZrzIhxoi7vyhPsHV1qL uZoe6PqUbQz/sDupaiJxn5kj7tk2N/GozY209poRO/VI3vQLfHQC8K5HEPFxRa72OEPr ZAWaf2a2qyeqv+IqCXPFREeqmrx4VOcnWSObRYcX2kRbncN7RtN1z3kBT+8jyPa1oG2b qJ1tRYe9bX/E1EzYT3RtEvma7jrs5L0dujaTryR7QTc6FMH/7LpVNPzfj2f9dtzptrqv GjqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :dkim-signature:dkim-signature:dkim-signature; bh=IRp5JZOLaDGIt1euLIzxVzZlF40hG272GOIIjwjFT+w=; fh=jtUOzve+trjLdqFcJeH2VA9sV8Ww5Cjbkq3GJJO96h0=; b=kHGEPGMwaQEkOV79RddFzq7pqanV5DUSevN1R38KA6h9nmCG+KQeKzZ2tMVqZCPB2Z 0vtz+/Sou3AhTGWyWTSSS8DkxceGH0knzvuXrPMlU5inV9ugVE9u7jq7mf/ofQs1bOp3 MM/0LKrga+FJaxrVJyXkKT6TSHfhakAJCKkte7EcDqg9GI6T+fcTNt+iWUnhk5L8flid jjobAPCGHfMIt3bNTQ8YpsP19ICFjBxSLY1Mcdoyw7+EyVI0yPlCTkuZCF0l+IZ++gth 94xDRaPzSuL5/jBFeeuQbXVt87knLGTFKmxnRBklHqaA43U30QQGbhkgCUZATyllrvR8 bfUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b="GC+Uu/e/"; dkim=neutral (no key) header.i=@suse.cz; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b="GC+Uu/e/"; dkim=neutral (no key) header.i=@suse.cz header.b="Xb1u/opL"; 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 Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id l1-20020a632501000000b005a1d88169casi5877263pgl.189.2023.12.11.04.28.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Dec 2023 04:28:11 -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=@suse.cz header.s=susede2_rsa header.b="GC+Uu/e/"; dkim=neutral (no key) header.i=@suse.cz; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b="GC+Uu/e/"; dkim=neutral (no key) header.i=@suse.cz header.b="Xb1u/opL"; 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 Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 660598065ECB; Mon, 11 Dec 2023 04:28:08 -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 S234627AbjLKM1k (ORCPT + 99 others); Mon, 11 Dec 2023 07:27:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35372 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229512AbjLKM1j (ORCPT ); Mon, 11 Dec 2023 07:27:39 -0500 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3F2B1FD; Mon, 11 Dec 2023 04:27:45 -0800 (PST) Received: from imap2.dmz-prg2.suse.org (imap2.dmz-prg2.suse.org [10.150.64.98]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 981E01FB89; Mon, 11 Dec 2023 12:27:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1702297663; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=IRp5JZOLaDGIt1euLIzxVzZlF40hG272GOIIjwjFT+w=; b=GC+Uu/e/ocPNXrJ5Y2r2iM32Qj731uQfxibv5fq4OCZTA5j1SBMbbPYCH4LSHrZp+aJYEm URMznUUTapY+IqmN2me8hJjcXfb2NR/kWVsMeeEJVlMHNnnc2LaAnl8zhtuEs0E0qRt7b2 UfMQpwORK3uvSn6hv/9Togbiphh7ALo= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1702297663; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=IRp5JZOLaDGIt1euLIzxVzZlF40hG272GOIIjwjFT+w=; b=Xb1u/opLXlXIvKx3qOo/Zc0tuR3IDvCm9PUSMa1Bkg3ULtpm8xgT4I0m7+gVM8yxBuEhKe 3neZWdlpXvEUhtAg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1702297663; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=IRp5JZOLaDGIt1euLIzxVzZlF40hG272GOIIjwjFT+w=; b=GC+Uu/e/ocPNXrJ5Y2r2iM32Qj731uQfxibv5fq4OCZTA5j1SBMbbPYCH4LSHrZp+aJYEm URMznUUTapY+IqmN2me8hJjcXfb2NR/kWVsMeeEJVlMHNnnc2LaAnl8zhtuEs0E0qRt7b2 UfMQpwORK3uvSn6hv/9Togbiphh7ALo= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1702297663; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=IRp5JZOLaDGIt1euLIzxVzZlF40hG272GOIIjwjFT+w=; b=Xb1u/opLXlXIvKx3qOo/Zc0tuR3IDvCm9PUSMa1Bkg3ULtpm8xgT4I0m7+gVM8yxBuEhKe 3neZWdlpXvEUhtAg== Received: from imap2.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap2.dmz-prg2.suse.org (Postfix) with ESMTPS id 886E9138FF; Mon, 11 Dec 2023 12:27:43 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap2.dmz-prg2.suse.org with ESMTPSA id DRtNIT8Ad2UbRQAAn2gu4w (envelope-from ); Mon, 11 Dec 2023 12:27:43 +0000 Received: by quack3.suse.cz (Postfix, from userid 1000) id 06FB7A07E3; Mon, 11 Dec 2023 13:27:43 +0100 (CET) Date: Mon, 11 Dec 2023 13:27:42 +0100 From: Jan Kara To: Chao Yu Cc: jack@suse.com, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: Re: [PATCH] quota: convert dquot_claim_space_nodirty() to return void Message-ID: <20231211122742.xnubwtret5za2mc2@quack3> References: <20231210025028.3262900-1-chao@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231210025028.3262900-1-chao@kernel.org> X-Spam-Level: X-Spam-Score: -3.80 Authentication-Results: smtp-out2.suse.de; none X-Spam-Level: X-Spam-Score: -3.80 X-Spamd-Result: default: False [-3.80 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; NEURAL_HAM_LONG(-1.00)[-1.000]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.cz:s=susede2_rsa,suse.cz:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.com:email]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; MID_RHS_NOT_FQDN(0.50)[]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-3.00)[100.00%] X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,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]); Mon, 11 Dec 2023 04:28:08 -0800 (PST) On Sun 10-12-23 10:50:28, Chao Yu wrote: > 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 Nice. I've added the patch to my tree. Thanks! Honza > --- > 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 > -- Jan Kara SUSE Labs, CR