summaryrefslogtreecommitdiff
path: root/fs/bcachefs/btree_locking.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2022-08-11 02:08:30 +0300
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-23 00:09:37 +0300
commit315c9ba6da5b480618a80dcb91a74a86e49366bb (patch)
tree8a7baa5a0af60556fc4aad576956bf6400b538b5 /fs/bcachefs/btree_locking.h
parentfd211bc71c9b4093ed39d4fc93294f9ff423febc (diff)
downloadlinux-315c9ba6da5b480618a80dcb91a74a86e49366bb.tar.xz
bcachefs: BTREE_ITER_NO_NODE -> BCH_ERR codes
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Diffstat (limited to 'fs/bcachefs/btree_locking.h')
-rw-r--r--fs/bcachefs/btree_locking.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/fs/bcachefs/btree_locking.h b/fs/bcachefs/btree_locking.h
index 90bf5c02f504..7dcfe3009b84 100644
--- a/fs/bcachefs/btree_locking.h
+++ b/fs/bcachefs/btree_locking.h
@@ -291,4 +291,19 @@ static inline void btree_path_set_should_be_locked(struct btree_path *path)
path->should_be_locked = true;
}
+static inline void __btree_path_set_level_up(struct btree_trans *trans,
+ struct btree_path *path,
+ unsigned l)
+{
+ btree_node_unlock(trans, path, l);
+ path->l[l].b = ERR_PTR(-BCH_ERR_no_btree_node_up);
+}
+
+static inline void btree_path_set_level_up(struct btree_trans *trans,
+ struct btree_path *path)
+{
+ __btree_path_set_level_up(trans, path, path->level++);
+ btree_path_set_dirty(path, BTREE_ITER_NEED_TRAVERSE);
+}
+
#endif /* _BCACHEFS_BTREE_LOCKING_H */