[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220217074414.GA85627@rsjd01523.et2sqa>
Date: Thu, 17 Feb 2022 15:44:15 +0800
From: Liu Bo <bo.liu@...ux.alibaba.com>
To: Jeffle Xu <jefflexu@...ux.alibaba.com>
Cc: dhowells@...hat.com, linux-cachefs@...hat.com, xiang@...nel.org,
chao@...nel.org, linux-erofs@...ts.ozlabs.org,
torvalds@...ux-foundation.org, gregkh@...uxfoundation.org,
willy@...radead.org, linux-fsdevel@...r.kernel.org,
joseph.qi@...ux.alibaba.com, tao.peng@...ux.alibaba.com,
gerry@...ux.alibaba.com, eguan@...ux.alibaba.com,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 01/22] fscache: export fscache_end_operation()
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 <bo.liu@...ux.alibaba.com>
> Signed-off-by: Jeffle Xu <jefflexu@...ux.alibaba.com>
> ---
> 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
Powered by blists - more mailing lists