From 315c9ba6da5b480618a80dcb91a74a86e49366bb Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Wed, 10 Aug 2022 19:08:30 -0400 Subject: bcachefs: BTREE_ITER_NO_NODE -> BCH_ERR codes Signed-off-by: Kent Overstreet --- fs/bcachefs/btree_locking.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'fs/bcachefs/btree_locking.h') 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 */ -- cgit v1.2.3