fscache: Expose fscache_end_operation() helper
Subsystems (4)
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 3 lines · On Sat, 02 Apr 2022 10:18:55 +0800 "Yue Hu" <[email protected]> wrote:
Currently, nfs and cifs have same
fscache_end_operaion()as fscache. We may put the helper inlinux/fscache.hso that fscache internal and client filesystem can all use it.
Sorry, please ignore the patch due to my earlier code base.
Thanks.
Quoted 92 lines
Signed-off-by Yue Hu <[email protected]>--- fs/cifs/fscache.c | 8 -------- fs/fscache/internal.h | 11 ----------- fs/nfs/fscache.c | 8 -------- include/linux/fscache.h | 12 ++++++++++++ 4 files changed, 12 insertions(+), 27 deletions(-)fs/cifs/fscache.c +0
-8@@ -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. */ fs/fscache/internal.h +0
-11@@ -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 */ fs/nfs/fscache.c +0
-8@@ -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. */ include/linux/fscache.h +12
-0@@ -557,6 +557,18 @@ int fscache_write(struct netfs_cache_resources *cres,return ops->write (cres, start_pos, iter, term_func, term_func_priv); } +/* +* Clean up at the end of an operation +*/ +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_clear_page_bits - Clear the PG_fscache bits from a set of pages * @cookie: The cookie representing the cache object