Skip to content

Commit 50fb0a7

Browse files
Matthew Wilcox (Oracle)brauner
authored andcommitted
orangefs: Move s_kmod_keyword_mask_map to orangefs-debugfs.c
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)" <[email protected]> Link: https://lore.kernel.org/r/[email protected] Tested-by: Mike Marshall <[email protected]> Signed-off-by: Christian Brauner <[email protected]>
1 parent 062e809 commit 50fb0a7

File tree

2 files changed

+43
-43
lines changed

2 files changed

+43
-43
lines changed

fs/orangefs/orangefs-debug.h

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -43,47 +43,4 @@
4343
#define GOSSIP_MAX_NR 16
4444
#define GOSSIP_MAX_DEBUG (((__u64)1 << GOSSIP_MAX_NR) - 1)
4545

46-
/* a private internal type */
47-
struct __keyword_mask_s {
48-
const char *keyword;
49-
__u64 mask_val;
50-
};
51-
52-
/*
53-
* Map all kmod keywords to kmod debug masks here. Keep this
54-
* structure "packed":
55-
*
56-
* "all" is always last...
57-
*
58-
* keyword mask_val index
59-
* foo 1 0
60-
* bar 2 1
61-
* baz 4 2
62-
* qux 8 3
63-
* . . .
64-
*/
65-
static struct __keyword_mask_s s_kmod_keyword_mask_map[] = {
66-
{"super", GOSSIP_SUPER_DEBUG},
67-
{"inode", GOSSIP_INODE_DEBUG},
68-
{"file", GOSSIP_FILE_DEBUG},
69-
{"dir", GOSSIP_DIR_DEBUG},
70-
{"utils", GOSSIP_UTILS_DEBUG},
71-
{"wait", GOSSIP_WAIT_DEBUG},
72-
{"acl", GOSSIP_ACL_DEBUG},
73-
{"dcache", GOSSIP_DCACHE_DEBUG},
74-
{"dev", GOSSIP_DEV_DEBUG},
75-
{"name", GOSSIP_NAME_DEBUG},
76-
{"bufmap", GOSSIP_BUFMAP_DEBUG},
77-
{"cache", GOSSIP_CACHE_DEBUG},
78-
{"debugfs", GOSSIP_DEBUGFS_DEBUG},
79-
{"xattr", GOSSIP_XATTR_DEBUG},
80-
{"init", GOSSIP_INIT_DEBUG},
81-
{"sysfs", GOSSIP_SYSFS_DEBUG},
82-
{"none", GOSSIP_NO_DEBUG},
83-
{"all", GOSSIP_MAX_DEBUG}
84-
};
85-
86-
static const int num_kmod_keyword_mask_map = (int)
87-
(ARRAY_SIZE(s_kmod_keyword_mask_map));
88-
8946
#endif /* __ORANGEFS_DEBUG_H */

fs/orangefs/orangefs-debugfs.c

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,49 @@
4444
#include "protocol.h"
4545
#include "orangefs-kernel.h"
4646

47+
/* a private internal type */
48+
struct __keyword_mask_s {
49+
const char *keyword;
50+
__u64 mask_val;
51+
};
52+
53+
/*
54+
* Map all kmod keywords to kmod debug masks here. Keep this
55+
* structure "packed":
56+
*
57+
* "all" is always last...
58+
*
59+
* keyword mask_val index
60+
* foo 1 0
61+
* bar 2 1
62+
* baz 4 2
63+
* qux 8 3
64+
* . . .
65+
*/
66+
static struct __keyword_mask_s s_kmod_keyword_mask_map[] = {
67+
{"super", GOSSIP_SUPER_DEBUG},
68+
{"inode", GOSSIP_INODE_DEBUG},
69+
{"file", GOSSIP_FILE_DEBUG},
70+
{"dir", GOSSIP_DIR_DEBUG},
71+
{"utils", GOSSIP_UTILS_DEBUG},
72+
{"wait", GOSSIP_WAIT_DEBUG},
73+
{"acl", GOSSIP_ACL_DEBUG},
74+
{"dcache", GOSSIP_DCACHE_DEBUG},
75+
{"dev", GOSSIP_DEV_DEBUG},
76+
{"name", GOSSIP_NAME_DEBUG},
77+
{"bufmap", GOSSIP_BUFMAP_DEBUG},
78+
{"cache", GOSSIP_CACHE_DEBUG},
79+
{"debugfs", GOSSIP_DEBUGFS_DEBUG},
80+
{"xattr", GOSSIP_XATTR_DEBUG},
81+
{"init", GOSSIP_INIT_DEBUG},
82+
{"sysfs", GOSSIP_SYSFS_DEBUG},
83+
{"none", GOSSIP_NO_DEBUG},
84+
{"all", GOSSIP_MAX_DEBUG}
85+
};
86+
87+
static const int num_kmod_keyword_mask_map = (int)
88+
(ARRAY_SIZE(s_kmod_keyword_mask_map));
89+
4790
#define DEBUG_HELP_STRING_SIZE 4096
4891
#define HELP_STRING_UNINITIALIZED \
4992
"Client Debug Keywords are unknown until the first time\n" \

0 commit comments

Comments
 (0)