netfs: Split some core bits out into their own file
authorDavid Howells <dhowells@redhat.com>
Tue, 1 Mar 2022 15:25:00 +0000 (15:25 +0000)
committerDavid Howells <dhowells@redhat.com>
Fri, 18 Mar 2022 09:29:05 +0000 (09:29 +0000)
Split some core bits out into their own file.  More bits will be added to
this file later.

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/164623006934.3564931.17932680017894039748.stgit@warthog.procyon.org.uk/
Link: https://lore.kernel.org/r/164678218407.1200972.1731208226140990280.stgit@warthog.procyon.org.uk/
Link: https://lore.kernel.org/r/164692920944.2099075.11990502173226013856.stgit@warthog.procyon.org.uk/
fs/netfs/Makefile
fs/netfs/internal.h
fs/netfs/io.c
fs/netfs/main.c [new file with mode: 0644]

index 88b9045..f684c0c 100644 (file)
@@ -3,6 +3,7 @@
 netfs-y := \
        buffered_read.o \
        io.o \
+       main.o \
        objects.o
 
 netfs-$(CONFIG_NETFS_STATS) += stats.o
index 05c4b2f..b7b0e3d 100644 (file)
@@ -23,11 +23,14 @@ void netfs_rreq_unlock_folios(struct netfs_io_request *rreq);
 /*
  * io.c
  */
-extern unsigned int netfs_debug;
-
 int netfs_begin_read(struct netfs_io_request *rreq, bool sync);
 
 /*
+ * main.c
+ */
+extern unsigned int netfs_debug;
+
+/*
  * objects.c
  */
 struct netfs_io_request *netfs_alloc_request(struct address_space *mapping,
index 6d43f9e..4289258 100644 (file)
 #include <linux/sched/mm.h>
 #include <linux/task_io_accounting_ops.h>
 #include "internal.h"
-#define CREATE_TRACE_POINTS
-#include <trace/events/netfs.h>
-
-MODULE_DESCRIPTION("Network fs support");
-MODULE_AUTHOR("Red Hat, Inc.");
-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");
 
 /*
  * Clear the unread part of an I/O request.
diff --git a/fs/netfs/main.c b/fs/netfs/main.c
new file mode 100644 (file)
index 0000000..0685687
--- /dev/null
@@ -0,0 +1,20 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/* Miscellaneous bits for the netfs support library.
+ *
+ * Copyright (C) 2022 Red Hat, Inc. All Rights Reserved.
+ * Written by David Howells (dhowells@redhat.com)
+ */
+
+#include <linux/module.h>
+#include <linux/export.h>
+#include "internal.h"
+#define CREATE_TRACE_POINTS
+#include <trace/events/netfs.h>
+
+MODULE_DESCRIPTION("Network fs support");
+MODULE_AUTHOR("Red Hat, Inc.");
+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");