diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2022-02-07 06:21:44 +0300 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-23 00:09:23 +0300 |
commit | ce91abd60b0aa26e50e6b44b599a0e232b80a8b9 (patch) | |
tree | c7c57e7dc88a839b03748c00075671fd71c5bcef /fs/bcachefs/btree_iter.h | |
parent | 7c8f6f980dc85fefea69dc1aa161fd2af2d8b3d5 (diff) | |
download | linux-ce91abd60b0aa26e50e6b44b599a0e232b80a8b9.tar.xz |
bcachefs: bch2_btree_path_set_pos()
bch2_btree_path_set_pos() is now available outside of btree_iter.c
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/btree_iter.h')
-rw-r--r-- | fs/bcachefs/btree_iter.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/fs/bcachefs/btree_iter.h b/fs/bcachefs/btree_iter.h index c4fdfb382dcd..3f8aaccc5208 100644 --- a/fs/bcachefs/btree_iter.h +++ b/fs/bcachefs/btree_iter.h @@ -157,6 +157,22 @@ bch2_btree_path_make_mut(struct btree_trans *trans, return path; } +struct btree_path * __must_check +__bch2_btree_path_set_pos(struct btree_trans *, struct btree_path *, + struct bpos, bool, int); + +static inline struct btree_path * __must_check +bch2_btree_path_set_pos(struct btree_trans *trans, + struct btree_path *path, struct bpos new_pos, + bool intent) +{ + int cmp = bpos_cmp(new_pos, path->pos); + + return cmp + ? __bch2_btree_path_set_pos(trans, path, new_pos, intent, cmp) + : path; +} + int __must_check bch2_btree_path_traverse(struct btree_trans *, struct btree_path *, unsigned); struct btree_path *bch2_path_get(struct btree_trans *, enum btree_id, struct bpos, |