summaryrefslogtreecommitdiffstats
path: root/fs/bcachefs/btree_locking.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2023-05-20 20:57:55 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 17:10:01 -0400
commit0d2234a79e877b1bfa71b2c8c712a155be419827 (patch)
tree3ddf278178dc2b05ce81e20b0ed79dde52b8890d /fs/bcachefs/btree_locking.h
parent01bf56a9771466147d94a013bc5678d0ed1b1382 (diff)
downloadlinux-0d2234a79e877b1bfa71b2c8c712a155be419827.tar.gz
linux-0d2234a79e877b1bfa71b2c8c712a155be419827.tar.bz2
linux-0d2234a79e877b1bfa71b2c8c712a155be419827.zip
six locks: Kill six_lock_pcpu_(alloc|free)
six_lock_pcpu_alloc() is an unsafe interface: it's not safe to allocate or free the percpu reader count on an existing lock that's in use, the only safe time to allocate percpu readers is when the lock is first being initialized. This patch adds a flags parameter to six_lock_init(), and instead of six_lock_pcpu_free() we now expose six_lock_exit(), which does the same thing but is less likely to be misused. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/btree_locking.h')
-rw-r--r--fs/bcachefs/btree_locking.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/bcachefs/btree_locking.h b/fs/bcachefs/btree_locking.h
index 76aac49966fe..660975839c89 100644
--- a/fs/bcachefs/btree_locking.h
+++ b/fs/bcachefs/btree_locking.h
@@ -13,7 +13,7 @@
#include "btree_iter.h"
#include "six.h"
-void bch2_btree_lock_init(struct btree_bkey_cached_common *);
+void bch2_btree_lock_init(struct btree_bkey_cached_common *, enum six_lock_init_flags);
#ifdef CONFIG_LOCKDEP
void bch2_assert_btree_nodes_not_locked(void);