diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2023-06-27 01:36:24 +0300 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-23 00:10:05 +0300 |
commit | 0fb3355d0a3b055af8735fa25b5af63f4dd9a034 (patch) | |
tree | c898735d5014da4ba15d2711ad5bf500f6cd25f7 /fs/bcachefs/subvolume.c | |
parent | 298ac24e6346b517148a6645c7c5686565868753 (diff) | |
download | linux-0fb3355d0a3b055af8735fa25b5af63f4dd9a034.tar.xz |
bcachefs: Improve bch2_bkey_make_mut()
bch2_bkey_make_mut() now takes the bkey_s_c by reference and points it
at the new, mutable key.
This helps in some fsck paths that may have multiple repair operations
on the same key.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/subvolume.c')
-rw-r--r-- | fs/bcachefs/subvolume.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/bcachefs/subvolume.c b/fs/bcachefs/subvolume.c index 828644e6c714..89c7c83c50e8 100644 --- a/fs/bcachefs/subvolume.c +++ b/fs/bcachefs/subvolume.c @@ -385,7 +385,7 @@ static int check_snapshot_tree(struct btree_trans *trans, if (ret) goto err; - u = bch2_bkey_make_mut_typed(trans, iter, k, 0, snapshot_tree); + u = bch2_bkey_make_mut_typed(trans, iter, &k, 0, snapshot_tree); ret = PTR_ERR_OR_ZERO(u); if (ret) goto err; @@ -473,7 +473,7 @@ static int snapshot_tree_ptr_repair(struct btree_trans *trans, return ret; if (ret || le32_to_cpu(s_t.root_snapshot) != root_id) { - u = bch2_bkey_make_mut_typed(trans, &root_iter, root.s_c, 0, snapshot); + u = bch2_bkey_make_mut_typed(trans, &root_iter, &root.s_c, 0, snapshot); ret = PTR_ERR_OR_ZERO(u) ?: snapshot_tree_create(trans, root_id, bch2_snapshot_tree_oldest_subvol(c, root_id), @@ -487,7 +487,7 @@ static int snapshot_tree_ptr_repair(struct btree_trans *trans, } if (s->k->p.snapshot != root_id) { - u = bch2_bkey_make_mut_typed(trans, iter, s->s_c, 0, snapshot); + u = bch2_bkey_make_mut_typed(trans, iter, &s->s_c, 0, snapshot); ret = PTR_ERR_OR_ZERO(u); if (ret) goto err; @@ -677,7 +677,7 @@ static int check_subvol(struct btree_trans *trans, "subvolume %llu is not set as snapshot but is not master subvolume", k.k->p.offset)) { struct bkey_i_subvolume *s = - bch2_bkey_make_mut_typed(trans, iter, subvol.s_c, 0, subvolume); + bch2_bkey_make_mut_typed(trans, iter, &subvol.s_c, 0, subvolume); ret = PTR_ERR_OR_ZERO(s); if (ret) return ret; @@ -1249,7 +1249,7 @@ static int bch2_subvolume_reparent(struct btree_trans *trans, le32_to_cpu(bkey_s_c_to_subvolume(k).v->parent) != old_parent) return 0; - s = bch2_bkey_make_mut_typed(trans, iter, k, 0, subvolume); + s = bch2_bkey_make_mut_typed(trans, iter, &k, 0, subvolume); ret = PTR_ERR_OR_ZERO(s); if (ret) return ret; |