summaryrefslogtreecommitdiff
path: root/fs/bcachefs/migrate.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2022-11-24 06:13:19 +0300
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-23 00:09:48 +0300
commit994ba475433a9395cb71e2ffb1928ce9fdb98e80 (patch)
tree17b68d33648215991336796bedd4174d58a730c3 /fs/bcachefs/migrate.c
parenta16b19cd1d91366e38c06f1195437b200b32e980 (diff)
downloadlinux-994ba475433a9395cb71e2ffb1928ce9fdb98e80.tar.xz
bcachefs: New btree helpers
This introduces some new conveniences, to help cut down on boilerplate: - bch2_trans_kmalloc_nomemzero() - performance optimiation - bch2_bkey_make_mut() - bch2_bkey_get_mut() - bch2_bkey_get_mut_typed() - bch2_bkey_alloc() Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/migrate.c')
-rw-r--r--fs/bcachefs/migrate.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/fs/bcachefs/migrate.c b/fs/bcachefs/migrate.c
index 8b258d966d04..e3e39127b40a 100644
--- a/fs/bcachefs/migrate.c
+++ b/fs/bcachefs/migrate.c
@@ -49,13 +49,11 @@ static int bch2_dev_usrdata_drop_key(struct btree_trans *trans,
if (!bch2_bkey_has_device(k, dev_idx))
return 0;
- n = bch2_trans_kmalloc(trans, bkey_bytes(k.k));
+ n = bch2_bkey_make_mut(trans, k);
ret = PTR_ERR_OR_ZERO(n);
if (ret)
return ret;
- bkey_reassemble(n, k);
-
ret = drop_dev_ptrs(c, bkey_i_to_s(n), dev_idx, flags, false);
if (ret)
return ret;