diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2023-02-17 05:09:27 +0100 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 23:09:53 +0200 |
commit | 2798143aa8eb796be19775dcb5ae3927bf983730 (patch) | |
tree | 9eab33da25a9ddc03df8f844118127f394a92c72 /fs/bcachefs/data_update.c | |
parent | bcachefs: Fix a 64 bit divide (diff) | |
download | linux-2798143aa8eb796be19775dcb5ae3927bf983730.tar.xz linux-2798143aa8eb796be19775dcb5ae3927bf983730.zip |
bcachefs: bch2_btree_insert_nonextent()
This adds a new helper to delete some redundant code in
bch2_trans_update_extent().
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/data_update.c')
-rw-r--r-- | fs/bcachefs/data_update.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/fs/bcachefs/data_update.c b/fs/bcachefs/data_update.c index 04d56e960872..09a5fff339fe 100644 --- a/fs/bcachefs/data_update.c +++ b/fs/bcachefs/data_update.c @@ -21,7 +21,7 @@ static int insert_snapshot_whiteouts(struct btree_trans *trans, struct bpos new_pos) { struct bch_fs *c = trans->c; - struct btree_iter iter, update_iter; + struct btree_iter iter; struct bkey_s_c k; snapshot_id_list s; int ret; @@ -65,14 +65,8 @@ static int insert_snapshot_whiteouts(struct btree_trans *trans, update->k.p = new_pos; update->k.p.snapshot = k.k->p.snapshot; - bch2_trans_iter_init(trans, &update_iter, id, update->k.p, - BTREE_ITER_NOT_EXTENTS| - BTREE_ITER_ALL_SNAPSHOTS| - BTREE_ITER_INTENT); - ret = bch2_btree_iter_traverse(&update_iter) ?: - bch2_trans_update(trans, &update_iter, update, + ret = bch2_btree_insert_nonextent(trans, id, update, BTREE_UPDATE_INTERNAL_SNAPSHOT_NODE); - bch2_trans_iter_exit(trans, &update_iter); if (ret) break; |