summaryrefslogtreecommitdiffstats
path: root/fs/bcachefs/move.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2021-08-30 01:34:37 +0200
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 23:09:11 +0200
commit5f8077cca89bdcc3d7660567462b17831356826d (patch)
tree20291e4a1674b0a38be2ff525bc66f16f4389597 /fs/bcachefs/move.c
parentbcachefs: Refactor bch2_trans_update_extent() (diff)
downloadlinux-5f8077cca89bdcc3d7660567462b17831356826d.tar.xz
linux-5f8077cca89bdcc3d7660567462b17831356826d.zip
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 '')
-rw-r--r--fs/bcachefs/move.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/fs/bcachefs/move.c b/fs/bcachefs/move.c
index 8d28d8fc5395..c804af8b81de 100644
--- a/fs/bcachefs/move.c
+++ b/fs/bcachefs/move.c
@@ -79,6 +79,7 @@ int bch2_migrate_index_update(struct bch_write_op *op)
struct bkey_i_extent *new;
const union bch_extent_entry *entry;
struct extent_ptr_decoded p;
+ struct bpos next_pos;
bool did_work = false;
bool extending = false, should_check_enospc;
s64 i_sectors_delta = 0, disk_sectors_delta = 0;
@@ -162,14 +163,18 @@ int bch2_migrate_index_update(struct bch_write_op *op)
goto out;
}
+ next_pos = insert->k.p;
+
ret = bch2_trans_update(&trans, iter, insert, 0) ?:
bch2_trans_commit(&trans, &op->res,
op_journal_seq(op),
BTREE_INSERT_NOFAIL|
m->data_opts.btree_insert_flags);
-err:
- if (!ret)
+ if (!ret) {
+ bch2_btree_iter_set_pos(iter, next_pos);
atomic_long_inc(&c->extent_migrate_done);
+ }
+err:
if (ret == -EINTR)
ret = 0;
if (ret)