Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp197246pxb; Thu, 17 Feb 2022 01:53:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJx5G7SJCBwW51ONME7dSpP/Gi8QGbSwOx5xA7fT++OwSuQJm53cx6lnNMlHrRAktM57tvnR X-Received: by 2002:a17:902:f24a:b0:14d:b2cf:20cc with SMTP id j10-20020a170902f24a00b0014db2cf20ccmr2001316plc.118.1645091630332; Thu, 17 Feb 2022 01:53:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645091630; cv=none; d=google.com; s=arc-20160816; b=aTRZvKt6xf0PVbRylbmhtfx8jcFjIYvV6zMwbg2NwopZ4ec1VmamOjkCvRgLcTsDL4 6C9wc2IIv5HfomDEzP/Yb3H6PyFQassxHKJf96plZGz7XfN2i0Tx1MBJfMs1BfXbw3CW zUkuNWRZTlLbfrtWrU2W6G/f647+MIDsC5BhNT90kqFJ7Ap4cqMdwOGYueqs6Ek2Ai53 cVwQdV10mIQozKzx1vanTA43ONkPsJ+Ba+vxDQDNaB6plIi00+fT9YGBrtdFQBKxMMyq NjS1T9UsaSZ+sfvdi4oNyVawnyGvV34n3mGYwbyx00HvKekIGWisryOafgY8e6TFEjjT +rvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:reply-to:message-id:subject:cc:to:from:date; bh=WoM+A5xnMeVyVSY1LVp04JQmrucq3ZbD2r2LHa4HhCg=; b=NwIu8Pbe+9k2csuHE2LfLuQDrxsKszqTlg/6JtBeGPBLa3hx+fxmDm8+Q08sOmK+E4 kyahuTkaAxi5oC4npmd1bf9qHlhmh7fzdnw59latehiV6Y91m7ExxBg1wPaEPumPQy34 l+Fid2Gxs/H/wCgicoH287MDyyk7RqqDOMD5xsfE5doe0+W+hI1k8jdT4cqsFw1yWk1n E4YP2LvqINesGehYKQZdqSrqaD1MQBOvM9+Al1Yjz6txSrAOnDZjG8x8DUHQ5pwTK74g Yp6Q3oJQWnlMymVujtn3cHJ8NFk00eeMO3ccH+wL6TDOJ7iqPtWud1XwNMnB/1HbjHal l5/A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bh9si8514502pgb.80.2022.02.17.01.53.36; Thu, 17 Feb 2022 01:53:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236484AbiBQHok (ORCPT + 99 others); Thu, 17 Feb 2022 02:44:40 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:35322 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230237AbiBQHoj (ORCPT ); Thu, 17 Feb 2022 02:44:39 -0500 Received: from out30-44.freemail.mail.aliyun.com (out30-44.freemail.mail.aliyun.com [115.124.30.44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E63423A1A7; Wed, 16 Feb 2022 23:44:24 -0800 (PST) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R191e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04426;MF=bo.liu@linux.alibaba.com;NM=1;PH=DS;RN=15;SR=0;TI=SMTPD_---0V4gpSp6_1645083855; Received: from rsjd01523.et2sqa(mailfrom:bo.liu@linux.alibaba.com fp:SMTPD_---0V4gpSp6_1645083855) by smtp.aliyun-inc.com(127.0.0.1); Thu, 17 Feb 2022 15:44:20 +0800 Date: Thu, 17 Feb 2022 15:44:15 +0800 From: Liu Bo To: Jeffle Xu Cc: dhowells@redhat.com, linux-cachefs@redhat.com, xiang@kernel.org, chao@kernel.org, linux-erofs@lists.ozlabs.org, torvalds@linux-foundation.org, gregkh@linuxfoundation.org, willy@infradead.org, linux-fsdevel@vger.kernel.org, joseph.qi@linux.alibaba.com, tao.peng@linux.alibaba.com, gerry@linux.alibaba.com, eguan@linux.alibaba.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 01/22] fscache: export fscache_end_operation() Message-ID: <20220217074414.GA85627@rsjd01523.et2sqa> Reply-To: bo.liu@linux.alibaba.com References: <20220209060108.43051-1-jefflexu@linux.alibaba.com> <20220209060108.43051-2-jefflexu@linux.alibaba.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220209060108.43051-2-jefflexu@linux.alibaba.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY,USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 09, 2022 at 02:00:47PM +0800, Jeffle Xu wrote: > Export fscache_end_operation() to avoid code duplication. > > Besides, considering the paired fscache_begin_read_operation() is > already exported, it shall make sense to also export > fscache_end_operation(). > Looks reasonable to me. Reviewed-by: Liu Bo > Signed-off-by: Jeffle Xu > --- > fs/fscache/internal.h | 11 ----------- > fs/nfs/fscache.c | 8 -------- > include/linux/fscache.h | 14 ++++++++++++++ > 3 files changed, 14 insertions(+), 19 deletions(-) > > diff --git a/fs/fscache/internal.h b/fs/fscache/internal.h > index f121c21590dc..ed1c9ed737f2 100644 > --- a/fs/fscache/internal.h > +++ b/fs/fscache/internal.h > @@ -70,17 +70,6 @@ static inline void fscache_see_cookie(struct fscache_cookie *cookie, > where); > } > > -/* > - * io.c > - */ > -static inline void fscache_end_operation(struct netfs_cache_resources *cres) > -{ > - const struct netfs_cache_ops *ops = fscache_operation_valid(cres); > - > - if (ops) > - ops->end_operation(cres); > -} > - > /* > * main.c > */ > diff --git a/fs/nfs/fscache.c b/fs/nfs/fscache.c > index cfe901650ab0..39654ca72d3d 100644 > --- a/fs/nfs/fscache.c > +++ b/fs/nfs/fscache.c > @@ -249,14 +249,6 @@ void nfs_fscache_release_file(struct inode *inode, struct file *filp) > } > } > > -static inline void fscache_end_operation(struct netfs_cache_resources *cres) > -{ > - const struct netfs_cache_ops *ops = fscache_operation_valid(cres); > - > - if (ops) > - ops->end_operation(cres); > -} > - > /* > * Fallback page reading interface. > */ > diff --git a/include/linux/fscache.h b/include/linux/fscache.h > index 296c5f1d9f35..d2430da8aa67 100644 > --- a/include/linux/fscache.h > +++ b/include/linux/fscache.h > @@ -456,6 +456,20 @@ int fscache_begin_read_operation(struct netfs_cache_resources *cres, > return -ENOBUFS; > } > > +/** > + * fscache_end_operation - End the read operation for the netfs lib > + * @cres: The cache resources for the read operation > + * > + * Clean up the resources at the end of the read request. > + */ > +static inline void fscache_end_operation(struct netfs_cache_resources *cres) > +{ > + const struct netfs_cache_ops *ops = fscache_operation_valid(cres); > + > + if (ops) > + ops->end_operation(cres); > +} > + > /** > * fscache_read - Start a read from the cache. > * @cres: The cache resources to use > -- > 2.27.0