]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
netfs, fscache: Move fs/fscache/* into fs/netfs/
authorDavid Howells <dhowells@redhat.com>
Mon, 20 Nov 2023 15:29:09 +0000 (15:29 +0000)
committerDavid Howells <dhowells@redhat.com>
Sun, 24 Dec 2023 11:36:00 +0000 (11:36 +0000)
There's a problem with dependencies between netfslib and fscache as each
wants to access some functions of the other.  Deal with this by moving
fs/fscache/* into fs/netfs/ and renaming those files to begin with
"fscache-".

For the moment, the moved files are changed as little as possible and an
fscache module is still built.  A subsequent patch will integrate them.

Signed-off-by: David Howells <dhowells@redhat.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
cc: Christian Brauner <christian@brauner.io>
cc: linux-fsdevel@vger.kernel.org
cc: linux-cachefs@redhat.com

17 files changed:
MAINTAINERS
fs/Kconfig
fs/Makefile
fs/fscache/Kconfig [deleted file]
fs/fscache/Makefile [deleted file]
fs/netfs/Kconfig
fs/netfs/Makefile
fs/netfs/fscache_cache.c [moved from fs/fscache/cache.c with 100% similarity]
fs/netfs/fscache_cookie.c [moved from fs/fscache/cookie.c with 100% similarity]
fs/netfs/fscache_internal.h [moved from fs/fscache/internal.h with 100% similarity]
fs/netfs/fscache_io.c [moved from fs/fscache/io.c with 100% similarity]
fs/netfs/fscache_main.c [moved from fs/fscache/main.c with 100% similarity]
fs/netfs/fscache_proc.c [moved from fs/fscache/proc.c with 100% similarity]
fs/netfs/fscache_stats.c [moved from fs/fscache/stats.c with 100% similarity]
fs/netfs/fscache_volume.c [moved from fs/fscache/volume.c with 100% similarity]
fs/netfs/internal.h
fs/netfs/main.c

index 7cef2d2ef8d708bd56113360e5696e3c17535302..d836f88b0fe14778eb0f3d6d61f1e45f8ff60ada 100644 (file)
@@ -8133,6 +8133,19 @@ S:       Supported
 F:     fs/iomap/
 F:     include/linux/iomap.h
 
+FILESYSTEMS [NETFS LIBRARY]
+M:     David Howells <dhowells@redhat.com>
+L:     linux-cachefs@redhat.com (moderated for non-subscribers)
+L:     linux-fsdevel@vger.kernel.org
+S:     Supported
+F:     Documentation/filesystems/caching/
+F:     Documentation/filesystems/netfs_library.rst
+F:     fs/netfs/
+F:     include/linux/fscache*.h
+F:     include/linux/netfs.h
+F:     include/trace/events/fscache.h
+F:     include/trace/events/netfs.h
+
 FINTEK F75375S HARDWARE MONITOR AND FAN CONTROLLER DRIVER
 M:     Riku Voipio <riku.voipio@iki.fi>
 L:     linux-hwmon@vger.kernel.org
@@ -8567,14 +8580,6 @@ F:       Documentation/power/freezing-of-tasks.rst
 F:     include/linux/freezer.h
 F:     kernel/freezer.c
 
-FS-CACHE: LOCAL CACHING FOR NETWORK FILESYSTEMS
-M:     David Howells <dhowells@redhat.com>
-L:     linux-cachefs@redhat.com (moderated for non-subscribers)
-S:     Supported
-F:     Documentation/filesystems/caching/
-F:     fs/fscache/
-F:     include/linux/fscache*.h
-
 FSCRYPT: FILE SYSTEM LEVEL ENCRYPTION SUPPORT
 M:     Eric Biggers <ebiggers@kernel.org>
 M:     Theodore Y. Ts'o <tytso@mit.edu>
index 42837617a55b5464b7fe0f63b4fa1326ab3717cc..c935c341eb6ed626baad18c849a52ceb436798e2 100644 (file)
@@ -140,7 +140,6 @@ source "fs/overlayfs/Kconfig"
 menu "Caches"
 
 source "fs/netfs/Kconfig"
-source "fs/fscache/Kconfig"
 source "fs/cachefiles/Kconfig"
 
 endmenu
index 75522f88e763670ca38010401975209c114fc67e..af7632368e987b14ee62e6a08c8fe91618af4cbd 100644 (file)
@@ -60,7 +60,6 @@ obj-$(CONFIG_DLM)             += dlm/
  
 # Do not add any filesystems before this line
 obj-$(CONFIG_NETFS_SUPPORT)    += netfs/
-obj-$(CONFIG_FSCACHE)          += fscache/
 obj-$(CONFIG_REISERFS_FS)      += reiserfs/
 obj-$(CONFIG_EXT4_FS)          += ext4/
 # We place ext4 before ext2 so that clean ext3 root fs's do NOT mount using the
diff --git a/fs/fscache/Kconfig b/fs/fscache/Kconfig
deleted file mode 100644 (file)
index b313a97..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0-only
-
-config FSCACHE
-       tristate "General filesystem local caching manager"
-       select NETFS_SUPPORT
-       help
-         This option enables a generic filesystem caching manager that can be
-         used by various network and other filesystems to cache data locally.
-         Different sorts of caches can be plugged in, depending on the
-         resources available.
-
-         See Documentation/filesystems/caching/fscache.rst for more information.
-
-config FSCACHE_STATS
-       bool "Gather statistical information on local caching"
-       depends on FSCACHE && PROC_FS
-       select NETFS_STATS
-       help
-         This option causes statistical information to be gathered on local
-         caching and exported through file:
-
-               /proc/fs/fscache/stats
-
-         The gathering of statistics adds a certain amount of overhead to
-         execution as there are a quite a few stats gathered, and on a
-         multi-CPU system these may be on cachelines that keep bouncing
-         between CPUs.  On the other hand, the stats are very useful for
-         debugging purposes.  Saying 'Y' here is recommended.
-
-         See Documentation/filesystems/caching/fscache.rst for more information.
-
-config FSCACHE_DEBUG
-       bool "Debug FS-Cache"
-       depends on FSCACHE
-       help
-         This permits debugging to be dynamically enabled in the local caching
-         management module.  If this is set, the debugging output may be
-         enabled by setting bits in /sys/modules/fscache/parameter/debug.
-
-         See Documentation/filesystems/caching/fscache.rst for more information.
diff --git a/fs/fscache/Makefile b/fs/fscache/Makefile
deleted file mode 100644 (file)
index afb090e..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0
-#
-# Makefile for general filesystem caching code
-#
-
-fscache-y := \
-       cache.o \
-       cookie.o \
-       io.o \
-       main.o \
-       volume.o
-
-fscache-$(CONFIG_PROC_FS) += proc.o
-fscache-$(CONFIG_FSCACHE_STATS) += stats.o
-
-obj-$(CONFIG_FSCACHE) := fscache.o
index b4db21022cb43f3b371e31687a89ec309f5b3726..b4378688357c6a679b2a02123b4d8d8039dfbcf7 100644 (file)
@@ -21,3 +21,42 @@ config NETFS_STATS
          multi-CPU system these may be on cachelines that keep bouncing
          between CPUs.  On the other hand, the stats are very useful for
          debugging purposes.  Saying 'Y' here is recommended.
+
+config FSCACHE
+       tristate "General filesystem local caching manager"
+       select NETFS_SUPPORT
+       help
+         This option enables a generic filesystem caching manager that can be
+         used by various network and other filesystems to cache data locally.
+         Different sorts of caches can be plugged in, depending on the
+         resources available.
+
+         See Documentation/filesystems/caching/fscache.rst for more information.
+
+config FSCACHE_STATS
+       bool "Gather statistical information on local caching"
+       depends on FSCACHE && PROC_FS
+       select NETFS_STATS
+       help
+         This option causes statistical information to be gathered on local
+         caching and exported through file:
+
+               /proc/fs/fscache/stats
+
+         The gathering of statistics adds a certain amount of overhead to
+         execution as there are a quite a few stats gathered, and on a
+         multi-CPU system these may be on cachelines that keep bouncing
+         between CPUs.  On the other hand, the stats are very useful for
+         debugging purposes.  Saying 'Y' here is recommended.
+
+         See Documentation/filesystems/caching/fscache.rst for more information.
+
+config FSCACHE_DEBUG
+       bool "Debug FS-Cache"
+       depends on FSCACHE
+       help
+         This permits debugging to be dynamically enabled in the local caching
+         management module.  If this is set, the debugging output may be
+         enabled by setting bits in /sys/modules/fscache/parameter/debug.
+
+         See Documentation/filesystems/caching/fscache.rst for more information.
index 386d6fb92793a5d1f4f247e9a1440bea7a1eb59d..bbb2b824bd5e9531bd5816b8259edc4c2f33a955 100644 (file)
@@ -1,5 +1,17 @@
 # SPDX-License-Identifier: GPL-2.0
 
+fscache-y := \
+       fscache_cache.o \
+       fscache_cookie.o \
+       fscache_io.o \
+       fscache_main.o \
+       fscache_volume.o
+
+fscache-$(CONFIG_PROC_FS) += fscache_proc.o
+fscache-$(CONFIG_FSCACHE_STATS) += fscache_stats.o
+
+obj-$(CONFIG_FSCACHE) := fscache.o
+
 netfs-y := \
        buffered_read.o \
        io.o \
@@ -9,4 +21,4 @@ netfs-y := \
 
 netfs-$(CONFIG_NETFS_STATS) += stats.o
 
-obj-$(CONFIG_NETFS_SUPPORT) := netfs.o
+obj-$(CONFIG_NETFS_SUPPORT) += netfs.o
similarity index 100%
rename from fs/fscache/cache.c
rename to fs/netfs/fscache_cache.c
similarity index 100%
rename from fs/fscache/io.c
rename to fs/netfs/fscache_io.c
similarity index 100%
rename from fs/fscache/main.c
rename to fs/netfs/fscache_main.c
similarity index 100%
rename from fs/fscache/proc.c
rename to fs/netfs/fscache_proc.c
similarity index 100%
rename from fs/fscache/stats.c
rename to fs/netfs/fscache_stats.c
index 43fac1b14e40cd1351cbac875d1886b0a9256835..e96432499eb2a4b0bbfea13a9bc9938447cc5a9a 100644 (file)
@@ -5,9 +5,12 @@
  * Written by David Howells (dhowells@redhat.com)
  */
 
+#include <linux/slab.h>
+#include <linux/seq_file.h>
 #include <linux/netfs.h>
 #include <linux/fscache.h>
 #include <trace/events/netfs.h>
+#include "fscache_internal.h"
 
 #ifdef pr_fmt
 #undef pr_fmt
@@ -107,6 +110,7 @@ static inline bool netfs_is_cache_enabled(struct netfs_inode *ctx)
 /*
  * debug tracing
  */
+#if 0
 #define dbgprintk(FMT, ...) \
        printk("[%-6.6s] "FMT"\n", current->comm, ##__VA_ARGS__)
 
@@ -143,3 +147,4 @@ do {                                                \
 #define _leave(FMT, ...) no_printk("<== %s()"FMT"", __func__, ##__VA_ARGS__)
 #define _debug(FMT, ...) no_printk(FMT, ##__VA_ARGS__)
 #endif
+#endif
index 068568702957e867d539b210e136aa2e66ad3746..237c54a01d97127ed3e5086e14114093268d9da0 100644 (file)
@@ -8,8 +8,8 @@
 #include <linux/module.h>
 #include <linux/export.h>
 #include "internal.h"
-#define CREATE_TRACE_POINTS
-#include <trace/events/netfs.h>
+//#define CREATE_TRACE_POINTS
+//#include <trace/events/netfs.h>
 
 MODULE_DESCRIPTION("Network fs support");
 MODULE_AUTHOR("Red Hat, Inc.");
@@ -18,3 +18,4 @@ MODULE_LICENSE("GPL");
 unsigned netfs_debug;
 module_param_named(debug, netfs_debug, uint, S_IWUSR | S_IRUGO);
 MODULE_PARM_DESC(netfs_debug, "Netfs support debugging mask");
+