summaryrefslogtreecommitdiff
path: root/fs/bcachefs/ec.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2024-04-30 03:27:30 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2024-05-08 17:29:22 -0400
commitabe2f470bc18a8ba50ca0a4c73327d993f6678c5 (patch)
treec5754c99a34d1c32c770a2c97ff093fa3f0cf508 /fs/bcachefs/ec.c
parent0acf2169a5e9b1ce286c44a740536e1cccb18db7 (diff)
bcachefs: simplify bch2_trans_start_alloc_update()
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/ec.c')
-rw-r--r--fs/bcachefs/ec.c16
1 files changed, 3 insertions, 13 deletions
diff --git a/fs/bcachefs/ec.c b/fs/bcachefs/ec.c
index 1a5608488441..64dcf852daed 100644
--- a/fs/bcachefs/ec.c
+++ b/fs/bcachefs/ec.c
@@ -269,20 +269,10 @@ static int mark_stripe_bucket(struct btree_trans *trans,
struct bpos bucket = PTR_BUCKET_POS(c, ptr);
if (flags & BTREE_TRIGGER_transactional) {
- struct btree_iter iter;
struct bkey_i_alloc_v4 *a =
- bch2_trans_start_alloc_update(trans, &iter, bucket);
- int ret = PTR_ERR_OR_ZERO(a) ?:
- __mark_stripe_bucket(trans, s, ptr_idx, deleting, iter.pos, &a->v);
- if (ret)
- goto err;
-
- ret = bch2_trans_update(trans, &iter, &a->k_i, 0);
- if (ret)
- goto err;
-err:
- bch2_trans_iter_exit(trans, &iter);
- return ret;
+ bch2_trans_start_alloc_update(trans, bucket);
+ return PTR_ERR_OR_ZERO(a) ?:
+ __mark_stripe_bucket(trans, s, ptr_idx, deleting, bucket, &a->v);
}
if (flags & BTREE_TRIGGER_gc) {