summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2025-07-12 12:14:26 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2025-07-25 12:02:57 -0400
commit2aa7dae954fb7457a6c807df145f7a9a2851851a (patch)
treeb1229c7eb705910da92410b7584616f66fbfa05a
parent6cdf70dc209edf758aecd76980b212721eb95578 (diff)
bcachefs: Zero list_idx when deleting from async obj lists
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
-rw-r--r--fs/bcachefs/async_objs.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/bcachefs/async_objs.h b/fs/bcachefs/async_objs.h
index cd6489b8cf76..451db4c51fb2 100644
--- a/fs/bcachefs/async_objs.h
+++ b/fs/bcachefs/async_objs.h
@@ -3,9 +3,10 @@
#define _BCACHEFS_ASYNC_OBJS_H
#ifdef CONFIG_BCACHEFS_ASYNC_OBJECT_LISTS
-static inline void __async_object_list_del(struct fast_list *head, unsigned idx)
+static inline void __async_object_list_del(struct fast_list *head, unsigned *idx)
{
- fast_list_remove(head, idx);
+ fast_list_remove(head, *idx);
+ *idx = 0;
}
static inline int __async_object_list_add(struct fast_list *head, void *obj, unsigned *idx)
@@ -16,7 +17,7 @@ static inline int __async_object_list_add(struct fast_list *head, void *obj, uns
}
#define async_object_list_del(_c, _list, idx) \
- __async_object_list_del(&(_c)->async_objs[BCH_ASYNC_OBJ_LIST_##_list].list, idx)
+ __async_object_list_del(&(_c)->async_objs[BCH_ASYNC_OBJ_LIST_##_list].list, &idx)
#define async_object_list_add(_c, _list, obj, idx) \
__async_object_list_add(&(_c)->async_objs[BCH_ASYNC_OBJ_LIST_##_list].list, obj, idx)