diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2023-06-24 12:17:57 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:10:04 -0400 |
commit | 3a63b32f121262f0566f8b89e98dd0c10f610325 (patch) | |
tree | be7162f63b5648769b39d8b7a9ee7468c04b55b2 /fs/bcachefs/buckets.c | |
parent | 9473cff989c8519d01c6a285bd94d2ed35d30251 (diff) | |
download | lwn-3a63b32f121262f0566f8b89e98dd0c10f610325.tar.gz lwn-3a63b32f121262f0566f8b89e98dd0c10f610325.zip |
bcachefs: bch2_trans_mark_pointer() refactoring
bch2_bucket_backpointer_mod() doesn't need to update the alloc key, we
can exit the alloc iter earlier.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/buckets.c')
-rw-r--r-- | fs/bcachefs/buckets.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/fs/bcachefs/buckets.c b/fs/bcachefs/buckets.c index d770dc949661..48fdd5f96a3b 100644 --- a/fs/bcachefs/buckets.c +++ b/fs/bcachefs/buckets.c @@ -1441,20 +1441,20 @@ static inline int bch2_trans_mark_pointer(struct btree_trans *trans, ret = __mark_pointer(trans, k, &p.ptr, sectors, bp.data_type, a->v.gen, &a->v.data_type, - &a->v.dirty_sectors, &a->v.cached_sectors); + &a->v.dirty_sectors, &a->v.cached_sectors) ?: + bch2_trans_update(trans, &iter, &a->k_i, 0); + bch2_trans_iter_exit(trans, &iter); + if (ret) - goto err; + return ret; if (!p.ptr.cached) { ret = bch2_bucket_backpointer_mod(trans, bucket, bp, k, insert); if (ret) - goto err; + return ret; } - ret = bch2_trans_update(trans, &iter, &a->k_i, 0); -err: - bch2_trans_iter_exit(trans, &iter); - return ret; + return 0; } static int bch2_trans_mark_stripe_ptr(struct btree_trans *trans, |