From 68937e14509c8f69a0664dfa5c6970a15a2e63f7 Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Sun, 30 Apr 2023 19:21:06 -0400 Subject: bcachefs: bch2_bkey_make_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_make_mut(), eliminating a bit of boilerplate. Signed-off-by: Kent Overstreet --- fs/bcachefs/btree_update_leaf.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'fs/bcachefs/btree_update_leaf.c') diff --git a/fs/bcachefs/btree_update_leaf.c b/fs/bcachefs/btree_update_leaf.c index c511541bb5f4..0952885f3caa 100644 --- a/fs/bcachefs/btree_update_leaf.c +++ b/fs/bcachefs/btree_update_leaf.c @@ -1268,7 +1268,7 @@ static noinline int extent_front_merge(struct btree_trans *trans, struct bkey_i *update; int ret; - update = bch2_bkey_make_mut(trans, k); + update = bch2_bkey_make_mut_noupdate(trans, k); ret = PTR_ERR_OR_ZERO(update); if (ret) return ret; @@ -1390,7 +1390,7 @@ int bch2_trans_update_extent(struct btree_trans *trans, trans->extra_journal_res += compressed_sectors; if (front_split) { - update = bch2_bkey_make_mut(trans, k); + update = bch2_bkey_make_mut_noupdate(trans, k); if ((ret = PTR_ERR_OR_ZERO(update))) goto err; @@ -1404,7 +1404,7 @@ int bch2_trans_update_extent(struct btree_trans *trans, if (k.k->p.snapshot != insert->k.p.snapshot && (front_split || back_split)) { - update = bch2_bkey_make_mut(trans, k); + update = bch2_bkey_make_mut_noupdate(trans, k); if ((ret = PTR_ERR_OR_ZERO(update))) goto err; @@ -1443,7 +1443,7 @@ int bch2_trans_update_extent(struct btree_trans *trans, } if (back_split) { - update = bch2_bkey_make_mut(trans, k); + update = bch2_bkey_make_mut_noupdate(trans, k); if ((ret = PTR_ERR_OR_ZERO(update))) goto err; -- cgit v1.2.3