aboutsummaryrefslogtreecommitdiff
path: root/fs/bcachefs/btree_types.h
diff options
context:
space:
mode:
authorGravatar Kent Overstreet <kent.overstreet@gmail.com> 2022-07-17 00:31:40 -0400
committerGravatar Kent Overstreet <kent.overstreet@linux.dev> 2023-10-22 17:09:36 -0400
commit8933315689bcb57a3b282bad262ac584e095a2f5 (patch)
tree78528b9532074b5ef4001643c694ce7d13a25709 /fs/bcachefs/btree_types.h
parentbcachefs: Convert bch2_do_invalidates_work() to for_each_btree_key2() (diff)
downloadlinux-8933315689bcb57a3b282bad262ac584e095a2f5.tar.gz
linux-8933315689bcb57a3b282bad262ac584e095a2f5.tar.bz2
linux-8933315689bcb57a3b282bad262ac584e095a2f5.zip
bcachefs: Convert bch2_dev_usrdata_drop() to for_each_btree_key2()
The new for_each_btree_key2() macro handles transaction retries, allowing us to avoid nested transactions - which we want to avoid since they're tricky to do completely correctly and upcoming assertions are going to be checking for that. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/btree_types.h')
-rw-r--r--fs/bcachefs/btree_types.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/bcachefs/btree_types.h b/fs/bcachefs/btree_types.h
index 8cf3ef749020..64f4bc8913e8 100644
--- a/fs/bcachefs/btree_types.h
+++ b/fs/bcachefs/btree_types.h
@@ -650,6 +650,11 @@ static inline bool btree_type_has_snapshots(enum btree_id id)
return (1 << id) & BTREE_ID_HAS_SNAPSHOTS;
}
+static inline bool btree_type_has_ptrs(enum btree_id id)
+{
+ return (1 << id) & BTREE_ID_HAS_PTRS;
+}
+
static inline bool btree_node_type_needs_gc(enum btree_node_type type)
{
return BTREE_NODE_TYPE_HAS_TRIGGERS & (1U << type);