diff options
author | Brian Foster <bfoster@redhat.com> | 2023-07-19 08:53:02 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:10:08 -0400 |
commit | 2110f21ec0a294360f2a510ff33d38605af45d88 (patch) | |
tree | 595e557351d229e4fdfd09d83405fb0eba93776b /fs/bcachefs/backpointers.c | |
parent | f7b3e651de8e269887ac25f1a26a96396c8fb91d (diff) | |
download | linux-stable-2110f21ec0a294360f2a510ff33d38605af45d88.tar.gz linux-stable-2110f21ec0a294360f2a510ff33d38605af45d88.tar.bz2 linux-stable-2110f21ec0a294360f2a510ff33d38605af45d88.zip |
bcachefs: remove duplicate code between backpointer update paths
Signed-off-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/backpointers.c')
-rw-r--r-- | fs/bcachefs/backpointers.c | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/fs/bcachefs/backpointers.c b/fs/bcachefs/backpointers.c index 7c1e6546d054..8747c5e19f99 100644 --- a/fs/bcachefs/backpointers.c +++ b/fs/bcachefs/backpointers.c @@ -134,31 +134,15 @@ static noinline int backpointer_mod_err(struct btree_trans *trans, } int bch2_bucket_backpointer_mod_nowritebuffer(struct btree_trans *trans, - struct bpos bucket, + struct bkey_i_backpointer *bp_k, struct bch_backpointer bp, struct bkey_s_c orig_k, bool insert) { - struct bch_fs *c = trans->c; - struct bkey_i_backpointer *bp_k; struct btree_iter bp_iter; struct bkey_s_c k; int ret; - bp_k = bch2_trans_kmalloc_nomemzero(trans, sizeof(struct bkey_i_backpointer)); - ret = PTR_ERR_OR_ZERO(bp_k); - if (ret) - return ret; - - bkey_backpointer_init(&bp_k->k_i); - bp_k->k.p = bucket_pos_to_bp(c, bucket, bp.bucket_offset); - bp_k->v = bp; - - if (!insert) { - bp_k->k.type = KEY_TYPE_deleted; - set_bkey_val_u64s(&bp_k->k, 0); - } - k = bch2_bkey_get_iter(trans, &bp_iter, BTREE_ID_backpointers, bp_k->k.p, BTREE_ITER_INTENT| |