From mboxrd@z Thu Jan 1 00:00:00 1970 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 B3DE8C433F5 for ; Thu, 17 Feb 2022 07:44:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236503AbiBQHok (ORCPT ); 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) 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