diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2019-09-27 05:21:39 +0300 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-23 00:08:28 +0300 |
commit | 64bc00115335450c4178fea04c5b664cf73a9729 (patch) | |
tree | 3e491d56806bfa5037273a1dd4fb631a2c8177c7 /fs/bcachefs/reflink.c | |
parent | a7199432c3cbcd42141cfd5c047bf8828c2390d8 (diff) | |
download | linux-64bc00115335450c4178fea04c5b664cf73a9729.tar.xz |
bcachefs: Rework btree iterator lifetimes
The btree_trans struct needs to memoize/cache btree iterators, so that
on transaction restart we don't have to completely redo btree lookups,
and so that we can do them all at once in the correct order when the
transaction had to restart to avoid a deadlock.
This switches the btree iterator lookups to work based on iterator
position, instead of trying to match them up based on the stack trace.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/reflink.c')
-rw-r--r-- | fs/bcachefs/reflink.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/bcachefs/reflink.c b/fs/bcachefs/reflink.c index c08b57634abd..ad526d280a14 100644 --- a/fs/bcachefs/reflink.c +++ b/fs/bcachefs/reflink.c @@ -190,10 +190,10 @@ s64 bch2_remap_range(struct bch_fs *c, bch2_trans_init(&trans, c, BTREE_ITER_MAX, 4096); - src_iter = __bch2_trans_get_iter(&trans, BTREE_ID_EXTENTS, src_start, - BTREE_ITER_INTENT, 1); - dst_iter = __bch2_trans_get_iter(&trans, BTREE_ID_EXTENTS, dst_start, - BTREE_ITER_INTENT, 2); + src_iter = bch2_trans_get_iter(&trans, BTREE_ID_EXTENTS, src_start, + BTREE_ITER_INTENT); + dst_iter = bch2_trans_get_iter(&trans, BTREE_ID_EXTENTS, dst_start, + BTREE_ITER_INTENT); while (1) { bch2_trans_begin_updates(&trans); |