* [PATCH] fuse: use private naming for fuse hash size
@ 2026-01-15 12:25 Jens Axboe
2026-01-15 12:37 ` Miklos Szeredi
2026-01-16 9:55 ` Christian Brauner
0 siblings, 2 replies; 3+ messages in thread
From: Jens Axboe @ 2026-01-15 12:25 UTC (permalink / raw)
To: Miklos Szeredi; +Cc: linux-fsdevel@vger.kernel.org
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>
---
diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c
index 4b6b3d2758ff..05ba065e4b40 100644
--- a/fs/fuse/dir.c
+++ b/fs/fuse/dir.c
@@ -32,9 +32,9 @@ struct dentry_bucket {
spinlock_t lock;
};
-#define HASH_BITS 5
-#define HASH_SIZE (1 << HASH_BITS)
-static struct dentry_bucket dentry_hash[HASH_SIZE];
+#define FUSE_HASH_BITS 5
+#define FUSE_HASH_SIZE (1 << FUSE_HASH_BITS)
+static struct dentry_bucket dentry_hash[FUSE_HASH_SIZE];
struct delayed_work dentry_tree_work;
/* Minimum invalidation work queue frequency */
@@ -83,7 +83,7 @@ MODULE_PARM_DESC(inval_wq,
static inline struct dentry_bucket *get_dentry_bucket(struct dentry *dentry)
{
- int i = hash_ptr(dentry, HASH_BITS);
+ int i = hash_ptr(dentry, FUSE_HASH_BITS);
return &dentry_hash[i];
}
@@ -164,7 +164,7 @@ static void fuse_dentry_tree_work(struct work_struct *work)
struct rb_node *node;
int i;
- for (i = 0; i < HASH_SIZE; i++) {
+ for (i = 0; i < FUSE_HASH_SIZE; i++) {
spin_lock(&dentry_hash[i].lock);
node = rb_first(&dentry_hash[i].tree);
while (node) {
@@ -213,7 +213,7 @@ void fuse_dentry_tree_init(void)
{
int i;
- for (i = 0; i < HASH_SIZE; i++) {
+ for (i = 0; i < FUSE_HASH_SIZE; i++) {
spin_lock_init(&dentry_hash[i].lock);
dentry_hash[i].tree = RB_ROOT;
}
@@ -227,7 +227,7 @@ void fuse_dentry_tree_cleanup(void)
inval_wq = 0;
cancel_delayed_work_sync(&dentry_tree_work);
- for (i = 0; i < HASH_SIZE; i++)
+ for (i = 0; i < FUSE_HASH_SIZE; i++)
WARN_ON_ONCE(!RB_EMPTY_ROOT(&dentry_hash[i].tree));
}
--
Jens Axboe
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] fuse: use private naming for fuse hash size
2026-01-15 12:25 [PATCH] fuse: use private naming for fuse hash size Jens Axboe
@ 2026-01-15 12:37 ` Miklos Szeredi
2026-01-16 9:55 ` Christian Brauner
1 sibling, 0 replies; 3+ messages in thread
From: Miklos Szeredi @ 2026-01-15 12:37 UTC (permalink / raw)
To: Jens Axboe; +Cc: linux-fsdevel@vger.kernel.org
On Thu, 15 Jan 2026 at 13:25, Jens Axboe <axboe@kernel.dk> wrote:
>
> 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>
Thanks:
Acked-by: Miklos Szeredi <mszeredi@redhat.com>
Christian, can you please pick this into vfs.fixes?
Thanks,
Miklos
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] fuse: use private naming for fuse hash size
2026-01-15 12:25 [PATCH] fuse: use private naming for fuse hash size Jens Axboe
2026-01-15 12:37 ` Miklos Szeredi
@ 2026-01-16 9:55 ` Christian Brauner
1 sibling, 0 replies; 3+ messages in thread
From: Christian Brauner @ 2026-01-16 9:55 UTC (permalink / raw)
To: Miklos Szeredi, Jens Axboe; +Cc: Christian Brauner, linux-fsdevel
On Thu, 15 Jan 2026 05:25:28 -0700, Jens Axboe wrote:
> 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))
> | ^~~~~~~~~
>
> [...]
Applied to the vfs.fixes branch of the vfs/vfs.git tree.
Patches in the vfs.fixes branch should appear in linux-next soon.
Please report any outstanding bugs that were missed during review in a
new review to the original patch series allowing us to drop it.
It's encouraged to provide Acked-bys and Reviewed-bys even though the
patch has now been applied. If possible patch trailers will be updated.
Note that commit hashes shown below are subject to change due to rebase,
trailer updates or similar. If in doubt, please check the listed branch.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git
branch: vfs.fixes
[1/1] fuse: use private naming for fuse hash size
https://git.kernel.org/vfs/vfs/c/4973d95679fb
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-01-16 9:56 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-15 12:25 [PATCH] fuse: use private naming for fuse hash size Jens Axboe
2026-01-15 12:37 ` Miklos Szeredi
2026-01-16 9:55 ` Christian Brauner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox