]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
fscache: export fscache_end_operation()
authorJeffle Xu <jefflexu@linux.alibaba.com>
Wed, 9 Feb 2022 06:00:47 +0000 (14:00 +0800)
committerDavid Howells <dhowells@redhat.com>
Fri, 18 Mar 2022 09:23:34 +0000 (09:23 +0000)
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/
Link: https://lore.kernel.org/r/164622971432.3564931.12184135678781328146.stgit@warthog.procyon.org.uk/
Link: https://lore.kernel.org/r/164678190346.1200972.7453733431978569479.stgit@warthog.procyon.org.uk/
Link: https://lore.kernel.org/r/164692888334.2099075.5166283293894267365.stgit@warthog.procyon.org.uk/
Link: https://lore.kernel.org/r/20220316131723.111553-2-jefflexu@linux.alibaba.com/
fs/cifs/fscache.c
fs/fscache/internal.h
fs/nfs/fscache.c
include/linux/fscache.h

index 33af72e0ac0c52d7d3f9f8d23275f9bba2574078..b47c2011ce5b0a48d331bb5445edfc1883ef1547 100644 (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.
  */
index f121c21590dcf2950f404d2d76ef32f998fa0425..ed1c9ed737f24ffa53dd456a078a050951cffc67 100644 (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
  */
index cfe901650ab00a84517c50ee01610a1d53c88fe6..39654ca72d3ddb1e43b1fdad826420ad7dd76548 100644 (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.
  */
index 296c5f1d9f35df98a922ed673380cd9a85153069..d2430da8aa6733f2aae34efe67b26f4ec8ae04b2 100644 (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