]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
orangefs: Move s_kmod_keyword_mask_map to orangefs-debugfs.c
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Wed, 5 Mar 2025 20:47:26 +0000 (20:47 +0000)
committerChristian Brauner <brauner@kernel.org>
Thu, 6 Mar 2025 08:26:06 +0000 (09:26 +0100)
Attempting to build orangefs with W=1 currently reports errors like:

In file included from ../fs/orangefs/protocol.h:287,
                 from ../fs/orangefs/waitqueue.c:16:
../fs/orangefs/orangefs-debug.h:86:18: error: ‘num_kmod_keyword_mask_map’ defined but not used [-Werror=unused-const-variable=]

Move num_kmod_keyword_mask_map, s_kmod_keyword_mask_map and
struct __keyword_mask_s to orangefs-debugfs.c which is the only file
they're used in.

Signed-off-by: "Matthew Wilcox (Oracle)" <willy@infradead.org>
Link: https://lore.kernel.org/r/20250305204734.1475264-3-willy@infradead.org
Tested-by: Mike Marshall <hubcap@omnibond.com>
Signed-off-by: Christian Brauner <brauner@kernel.org>
fs/orangefs/orangefs-debug.h
fs/orangefs/orangefs-debugfs.c

index 6e079d4230d09b499188884db391316b7a38844d..d4463534cec6e7d5acc79ee608f7bd0e2cf058c3 100644 (file)
 #define GOSSIP_MAX_NR                 16
 #define GOSSIP_MAX_DEBUG              (((__u64)1 << GOSSIP_MAX_NR) - 1)
 
-/* a private internal type */
-struct __keyword_mask_s {
-       const char *keyword;
-       __u64 mask_val;
-};
-
-/*
- * Map all kmod keywords to kmod debug masks here. Keep this
- * structure "packed":
- *
- *   "all" is always last...
- *
- *   keyword     mask_val     index
- *     foo          1           0
- *     bar          2           1
- *     baz          4           2
- *     qux          8           3
- *      .           .           .
- */
-static struct __keyword_mask_s s_kmod_keyword_mask_map[] = {
-       {"super", GOSSIP_SUPER_DEBUG},
-       {"inode", GOSSIP_INODE_DEBUG},
-       {"file", GOSSIP_FILE_DEBUG},
-       {"dir", GOSSIP_DIR_DEBUG},
-       {"utils", GOSSIP_UTILS_DEBUG},
-       {"wait", GOSSIP_WAIT_DEBUG},
-       {"acl", GOSSIP_ACL_DEBUG},
-       {"dcache", GOSSIP_DCACHE_DEBUG},
-       {"dev", GOSSIP_DEV_DEBUG},
-       {"name", GOSSIP_NAME_DEBUG},
-       {"bufmap", GOSSIP_BUFMAP_DEBUG},
-       {"cache", GOSSIP_CACHE_DEBUG},
-       {"debugfs", GOSSIP_DEBUGFS_DEBUG},
-       {"xattr", GOSSIP_XATTR_DEBUG},
-       {"init", GOSSIP_INIT_DEBUG},
-       {"sysfs", GOSSIP_SYSFS_DEBUG},
-       {"none", GOSSIP_NO_DEBUG},
-       {"all", GOSSIP_MAX_DEBUG}
-};
-
-static const int num_kmod_keyword_mask_map = (int)
-       (ARRAY_SIZE(s_kmod_keyword_mask_map));
-
 #endif /* __ORANGEFS_DEBUG_H */
index f52073022fae8d009f7fbf11354690fffb980804..f7095c91660c34fc13b5bab7510fb25e4e5726e7 100644 (file)
 #include "protocol.h"
 #include "orangefs-kernel.h"
 
+/* a private internal type */
+struct __keyword_mask_s {
+       const char *keyword;
+       __u64 mask_val;
+};
+
+/*
+ * Map all kmod keywords to kmod debug masks here. Keep this
+ * structure "packed":
+ *
+ *   "all" is always last...
+ *
+ *   keyword     mask_val     index
+ *     foo          1           0
+ *     bar          2           1
+ *     baz          4           2
+ *     qux          8           3
+ *      .           .           .
+ */
+static struct __keyword_mask_s s_kmod_keyword_mask_map[] = {
+       {"super", GOSSIP_SUPER_DEBUG},
+       {"inode", GOSSIP_INODE_DEBUG},
+       {"file", GOSSIP_FILE_DEBUG},
+       {"dir", GOSSIP_DIR_DEBUG},
+       {"utils", GOSSIP_UTILS_DEBUG},
+       {"wait", GOSSIP_WAIT_DEBUG},
+       {"acl", GOSSIP_ACL_DEBUG},
+       {"dcache", GOSSIP_DCACHE_DEBUG},
+       {"dev", GOSSIP_DEV_DEBUG},
+       {"name", GOSSIP_NAME_DEBUG},
+       {"bufmap", GOSSIP_BUFMAP_DEBUG},
+       {"cache", GOSSIP_CACHE_DEBUG},
+       {"debugfs", GOSSIP_DEBUGFS_DEBUG},
+       {"xattr", GOSSIP_XATTR_DEBUG},
+       {"init", GOSSIP_INIT_DEBUG},
+       {"sysfs", GOSSIP_SYSFS_DEBUG},
+       {"none", GOSSIP_NO_DEBUG},
+       {"all", GOSSIP_MAX_DEBUG}
+};
+
+static const int num_kmod_keyword_mask_map = (int)
+       (ARRAY_SIZE(s_kmod_keyword_mask_map));
+
 #define DEBUG_HELP_STRING_SIZE 4096
 #define HELP_STRING_UNINITIALIZED \
        "Client Debug Keywords are unknown until the first time\n" \