Skip to contentSkip to conversation

fuse: remove unneeded atomic set in uring creation

PATCH In review Joanne Koong 2 participants 2 messages Mar 18, 2025

Subsystems (3)
lore
Share & tools
lore

Joanne Koong

author maintainer
#0 lore raw

PATCH 1/1 fuse: remove unneeded atomic set in uring creation

When the ring is allocated, it is kzalloc-ed. ring->queue_refs will already be initialized to 0 by default. It does not need to be atomically set to 0.

---
 fs/fuse/dev_uring.c | 1 -
 1 file changed, 1 deletion(-)
fs/fuse/dev_uring.c +0 -1
index ab8c26042aa8..f54d150330a9 100644
@@ -239,7 +239,6 @@ static struct fuse_ring *fuse_uring_create(struct fuse_conn *fc)
 	ring->nr_queues = nr_queues;
 	ring->fc = fc;
 	ring->max_payload_sz = max_payload_size;
-	atomic_set(&ring->queue_refs, 0);
 
 	spin_unlock(&fc->lock);
 	return ring;
Signature · 1 line
2.47.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 14 lines · Joanne Koong

When the ring is allocated, it is kzalloc-ed. ring->queue_refs will already be initialized to 0 by default. It does not need to be atomically set to 0.

---
 fs/fuse/dev_uring.c | 1 -
 1 file changed, 1 deletion(-)
fs/fuse/dev_uring.c +0 -0
index ab8c26042aa8..f54d150330a9 100644

fs/fuse/dev_uring.c static struct fuse_ring *fuse_uring_create(struct fuse_conn *fc) · line 244

Quoted 7 lines
fs/fuse/dev_uring.c +0 -1
@@ -239,7 +239,6 @@ static struct fuse_ring *fuse_uring_create(struct fuse_conn *fc)
 	ring->nr_queues = nr_queues;
 	ring->fc = fc;
 	ring->max_payload_sz = max_payload_size;
-	atomic_set(&ring->queue_refs, 0);
 
 	spin_unlock(&fc->lock);
 	return ring;

Thank you, LGTM. I don't remember why I had added that explicit initialization.