Skip to content

Commit 4973d95

Browse files
axboebrauner
authored andcommitted
fuse: use private naming for fuse hash size
With a mix of include dependencies, the compiler warns that: fs/fuse/dir.c:35:9: warning: ?HASH_BITS? redefined 35 | #define HASH_BITS 5 | ^~~~~~~~~ In file included from ./include/linux/io_uring_types.h:5, from ./include/linux/bpf.h:34, from ./include/linux/security.h:35, from ./include/linux/fs_context.h:14, from fs/fuse/dir.c:13: ./include/linux/hashtable.h:28:9: note: this is the location of the previous definition 28 | #define HASH_BITS(name) ilog2(HASH_SIZE(name)) | ^~~~~~~~~ fs/fuse/dir.c:36:9: warning: ?HASH_SIZE? redefined 36 | #define HASH_SIZE (1 << HASH_BITS) | ^~~~~~~~~ ./include/linux/hashtable.h:27:9: note: this is the location of the previous definition 27 | #define HASH_SIZE(name) (ARRAY_SIZE(name)) | ^~~~~~~~~ Hence rename the HASH_SIZE/HASH_BITS in fuse, by prefixing them with FUSE_ instead. Signed-off-by: Jens Axboe <axboe@kernel.dk> Link: https://patch.msgid.link/195c9525-281c-4302-9549-f3d9259416c6@kernel.dk Acked-by: Miklos Szeredi <mszeredi@redhat.com> Signed-off-by: Christian Brauner <brauner@kernel.org>
1 parent e93b31d commit 4973d95

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

fs/fuse/dir.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ struct dentry_bucket {
3232
spinlock_t lock;
3333
};
3434

35-
#define HASH_BITS 5
36-
#define HASH_SIZE (1 << HASH_BITS)
37-
static struct dentry_bucket dentry_hash[HASH_SIZE];
35+
#define FUSE_HASH_BITS 5
36+
#define FUSE_HASH_SIZE (1 << FUSE_HASH_BITS)
37+
static struct dentry_bucket dentry_hash[FUSE_HASH_SIZE];
3838
struct delayed_work dentry_tree_work;
3939

4040
/* Minimum invalidation work queue frequency */
@@ -83,7 +83,7 @@ MODULE_PARM_DESC(inval_wq,
8383

8484
static inline struct dentry_bucket *get_dentry_bucket(struct dentry *dentry)
8585
{
86-
int i = hash_ptr(dentry, HASH_BITS);
86+
int i = hash_ptr(dentry, FUSE_HASH_BITS);
8787

8888
return &dentry_hash[i];
8989
}
@@ -164,7 +164,7 @@ static void fuse_dentry_tree_work(struct work_struct *work)
164164
struct rb_node *node;
165165
int i;
166166

167-
for (i = 0; i < HASH_SIZE; i++) {
167+
for (i = 0; i < FUSE_HASH_SIZE; i++) {
168168
spin_lock(&dentry_hash[i].lock);
169169
node = rb_first(&dentry_hash[i].tree);
170170
while (node) {
@@ -213,7 +213,7 @@ void fuse_dentry_tree_init(void)
213213
{
214214
int i;
215215

216-
for (i = 0; i < HASH_SIZE; i++) {
216+
for (i = 0; i < FUSE_HASH_SIZE; i++) {
217217
spin_lock_init(&dentry_hash[i].lock);
218218
dentry_hash[i].tree = RB_ROOT;
219219
}
@@ -227,7 +227,7 @@ void fuse_dentry_tree_cleanup(void)
227227
inval_wq = 0;
228228
cancel_delayed_work_sync(&dentry_tree_work);
229229

230-
for (i = 0; i < HASH_SIZE; i++)
230+
for (i = 0; i < FUSE_HASH_SIZE; i++)
231231
WARN_ON_ONCE(!RB_EMPTY_ROOT(&dentry_hash[i].tree));
232232
}
233233

0 commit comments

Comments
 (0)