aboutsummaryrefslogtreecommitdiff
path: root/fs/bcachefs/io.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2021-08-29 19:34:37 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 17:09:11 -0400
commit5f8077cca89bdcc3d7660567462b17831356826d (patch)
tree20291e4a1674b0a38be2ff525bc66f16f4389597 /fs/bcachefs/io.c
parent638c6ff951bfebbecde5b6912ce22a02a77fafc1 (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.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/bcachefs/io.c b/fs/bcachefs/io.c
index 27f6b3245741..34295419190d 100644
--- a/fs/bcachefs/io.c
+++ b/fs/bcachefs/io.c
@@ -276,6 +276,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;
@@ -354,6 +355,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|
@@ -362,6 +365,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;