diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2021-08-29 19:34:37 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@gmail.com> | 2022-05-30 18:16:41 -0400 |
commit | e1cb9425d2f77cbd547cbc0acac26e2bc3a8091d (patch) | |
tree | cac1dbaf143ccc277c8209ded293e69fab215ef0 /fs/bcachefs/io.c | |
parent | 0081ec30cdcc92fa6816bb68e5a0ecb0a031cc84 (diff) |
bcachefs: Kill BTREE_ITER_SET_POS_AFTER_COMMIT
BTREE_ITER_SET_POS_AFTER_COMMIT is used internally to automagically
advance extent btree iterators on sucessful commit.
But with the upcomnig btree_path patch it's getting more awkward to
support, and it adds overhead to core data structures that's only used
in a few places, and can be easily done by the caller instead.
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Diffstat (limited to 'fs/bcachefs/io.c')
-rw-r--r-- | fs/bcachefs/io.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/bcachefs/io.c b/fs/bcachefs/io.c index 1c6dcb705009..84f04e1bdfeb 100644 --- a/fs/bcachefs/io.c +++ b/fs/bcachefs/io.c @@ -266,6 +266,7 @@ int bch2_extent_update(struct btree_trans *trans, { /* this must live until after bch2_trans_commit(): */ struct bkey_inode_buf inode_p; + struct bpos next_pos; bool extending = false, usage_increasing; s64 i_sectors_delta = 0, disk_sectors_delta = 0; int ret; @@ -344,6 +345,8 @@ int bch2_extent_update(struct btree_trans *trans, return ret; } + next_pos = k->k.p; + ret = bch2_trans_update(trans, iter, k, 0) ?: bch2_trans_commit(trans, disk_res, journal_seq, BTREE_INSERT_NOCHECK_RW| @@ -352,6 +355,8 @@ int bch2_extent_update(struct btree_trans *trans, if (ret) return ret; + bch2_btree_iter_set_pos(iter, next_pos); + if (i_sectors_delta_total) *i_sectors_delta_total += i_sectors_delta; return 0; |