fscache: export fscache_end_operation()

Bugzilla: http://bugzilla.redhat.com/1229736

commit e9b57aaae605eb869a628fdc21fe7d2c77a2205d
Author: Jeffle Xu <jefflexu@linux.alibaba.com>
Date:   Wed Feb 9 14:00:47 2022 +0800

    fscache: export fscache_end_operation()

    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().

    Signed-off-by: Jeffle Xu <jefflexu@linux.alibaba.com>
    Signed-off-by: David Howells <dhowells@redhat.com>
    Reviewed-by: Jeff Layton <jlayton@kernel.org>
    cc: linux-cachefs@redhat.com

    Link: https://lore.kernel.org/r/20220302125134.131039-2-jefflexu@linux.alibaba.com/ # Jeffle's v4
    Link: https://lore.kernel.org/r/164622971432.3564931.12184135678781328146.stgit@warthog.procyon.org.uk/ # v1
    Link: https://lore.kernel.org/r/164678190346.1200972.7453733431978569479.stgit@warthog.procyon.org.uk/ # v2
    Link: https://lore.kernel.org/r/164692888334.2099075.5166283293894267365.stgit@warthog.procyon.org.uk/ # v3
    Link: https://lore.kernel.org/r/20220316131723.111553-2-jefflexu@linux.alibaba.com/ # v5

Signed-off-by: Jeffrey Layton <jlayton@redhat.com>
This commit is contained in:
Jeffrey Layton 2022-05-26 09:40:31 -04:00
parent 001d84b2dd
commit 6ddfb06158
4 changed files with 14 additions and 27 deletions

View File

@ -134,14 +134,6 @@ void cifs_fscache_release_inode_cookie(struct inode *inode)
}
}
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.
*/

View File

@ -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
*/

View File

@ -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.
*/

View File

@ -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