diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2025-05-25 01:01:19 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2025-06-30 17:43:55 -0400 |
commit | dd1e1de88de9c6d14a03df9bc0095fc21fe8f878 (patch) | |
tree | 83420db2bf0736e62596f848894bbc9d8f3e7352 | |
parent | 29362082ffff50f37e643086ab7ef718f595bc1f (diff) |
bcachefs: use scoped_guard() in fast_list.c
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
-rw-r--r-- | fs/bcachefs/fast_list.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/fs/bcachefs/fast_list.c b/fs/bcachefs/fast_list.c index 2faec143eb31..b52f264318d8 100644 --- a/fs/bcachefs/fast_list.c +++ b/fs/bcachefs/fast_list.c @@ -115,22 +115,21 @@ int fast_list_add(struct fast_list *l, void *item) void fast_list_remove(struct fast_list *l, unsigned idx) { u32 entries[16], nr = 0; - unsigned long flags; if (!idx) return; *genradix_ptr_inlined(&l->items, idx) = NULL; - local_irq_save(flags); - struct fast_list_pcpu *lp = this_cpu_ptr(l->buffer); + scoped_guard(irqsave) { + struct fast_list_pcpu *lp = this_cpu_ptr(l->buffer); - if (unlikely(lp->nr == ARRAY_SIZE(lp->entries))) - while (nr < ARRAY_SIZE(entries)) - entries[nr++] = lp->entries[--lp->nr]; + if (unlikely(lp->nr == ARRAY_SIZE(lp->entries))) + while (nr < ARRAY_SIZE(entries)) + entries[nr++] = lp->entries[--lp->nr]; - lp->entries[lp->nr++] = idx; - local_irq_restore(flags); + lp->entries[lp->nr++] = idx; + } if (unlikely(nr)) while (nr) |