summaryrefslogtreecommitdiff
path: root/fs/bcachefs/buckets.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2023-05-01 01:46:24 +0300
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-23 00:10:01 +0300
commitf12a798a898dec36de9705d40a1b03e2418aabe0 (patch)
tree3b2a09b833e6034f34e2d9aefd8794fb67080c5d /fs/bcachefs/buckets.c
parentf8cb35fda161715e384df340f0bae4de37c5576f (diff)
downloadlinux-f12a798a898dec36de9705d40a1b03e2418aabe0.tar.xz
bcachefs: bch2_bkey_get_mut() now calls bch2_trans_update()
It's safe to call bch2_trans_update with a k/v pair where the value hasn't been filled out, as long as the key part has been and the value is filled out by transaction commit time. This patch folds the bch2_trans_update() call into bch2_bkey_get_mut(), eliminating a bit of boilerplate. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/buckets.c')
-rw-r--r--fs/bcachefs/buckets.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/fs/bcachefs/buckets.c b/fs/bcachefs/buckets.c
index 00b60749daf8..bce42eef6f57 100644
--- a/fs/bcachefs/buckets.c
+++ b/fs/bcachefs/buckets.c
@@ -1471,10 +1471,6 @@ static int bch2_trans_mark_stripe_ptr(struct btree_trans *trans,
stripe_blockcount_get(&s->v, p.ec.block) +
sectors);
- ret = bch2_trans_update(trans, &iter, &s->k_i, 0);
- if (ret)
- goto err;
-
bch2_bkey_to_replicas(&r.e, bkey_i_to_s_c(&s->k_i));
r.e.data_type = data_type;
update_replicas_list(trans, &r.e, sectors);
@@ -1749,7 +1745,7 @@ static int __bch2_trans_mark_reflink_p(struct btree_trans *trans,
struct printbuf buf = PRINTBUF;
int ret;
- k = bch2_bkey_get_mut(trans, &iter,
+ k = bch2_bkey_get_mut_noupdate(trans, &iter,
BTREE_ID_reflink, POS(0, *idx),
BTREE_ITER_WITH_UPDATES);
ret = PTR_ERR_OR_ZERO(k);