diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2023-08-05 12:55:08 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:10:10 -0400 |
commit | 8079aab085f2203960b352a153f07245d0507bf8 (patch) | |
tree | 49d50b2ae359e8a0be43db8e993d53db5df46a4e /fs/bcachefs/btree_iter.h | |
parent | dbbfca9f41e86903501dded3fd494e1a56f3c310 (diff) | |
download | linux-8079aab085f2203960b352a153f07245d0507bf8.tar.gz linux-8079aab085f2203960b352a153f07245d0507bf8.tar.bz2 linux-8079aab085f2203960b352a153f07245d0507bf8.zip |
bcachefs: Split up btree_update_leaf.c
We now have
btree_trans_commit.c
btree_update.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 13e92452270e..4469b2e166eb 100644 --- a/fs/bcachefs/btree_iter.h +++ b/fs/bcachefs/btree_iter.h @@ -221,6 +221,22 @@ struct btree_path *bch2_path_get(struct btree_trans *, enum btree_id, struct bpo unsigned, unsigned, unsigned, unsigned long); struct bkey_s_c bch2_btree_path_peek_slot(struct btree_path *, struct bkey *); +/* + * bch2_btree_path_peek_slot() for a cached iterator might return a key in a + * different snapshot: + */ +static inline struct bkey_s_c bch2_btree_path_peek_slot_exact(struct btree_path *path, struct bkey *u) +{ + struct bkey_s_c k = bch2_btree_path_peek_slot(path, u); + + if (k.k && bpos_eq(path->pos, k.k->p)) + return k; + + bkey_init(u); + u->p = path->pos; + return (struct bkey_s_c) { u, NULL }; +} + struct bkey_i *bch2_btree_journal_peek_slot(struct btree_trans *, struct btree_iter *, struct bpos); |