diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2020-02-18 17:15:32 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:08:35 -0400 |
commit | 237e80483a6466f3c1968c2a8bb115b3e24d951b (patch) | |
tree | 0c8a3b53e0a1e492ea5e64c33aff975cb8193d7f /fs/bcachefs/migrate.c | |
parent | b606c8aa568e9f4f10f1b7504f8b96628d933a0e (diff) | |
download | linux-stable-237e80483a6466f3c1968c2a8bb115b3e24d951b.tar.gz linux-stable-237e80483a6466f3c1968c2a8bb115b3e24d951b.tar.bz2 linux-stable-237e80483a6466f3c1968c2a8bb115b3e24d951b.zip |
bcachefs: introduce b->hash_val
This is partly prep work for introducing bch_btree_ptr_v2, but it'll
also be a bit of a performance boost by moving the full key out of the
hot part of struct btree.
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/migrate.c')
-rw-r--r-- | fs/bcachefs/migrate.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/fs/bcachefs/migrate.c b/fs/bcachefs/migrate.c index 1ef62a189e33..e26fa1608f39 100644 --- a/fs/bcachefs/migrate.c +++ b/fs/bcachefs/migrate.c @@ -123,23 +123,21 @@ static int bch2_dev_metadata_drop(struct bch_fs *c, unsigned dev_idx, int flags) for_each_btree_node(&trans, iter, id, POS_MIN, BTREE_ITER_PREFETCH, b) { __BKEY_PADDED(k, BKEY_BTREE_PTR_VAL_U64s_MAX) tmp; - struct bkey_i_btree_ptr *new_key; retry: if (!bch2_bkey_has_device(bkey_i_to_s_c(&b->key), dev_idx)) continue; bkey_copy(&tmp.k, &b->key); - new_key = bkey_i_to_btree_ptr(&tmp.k); - ret = drop_dev_ptrs(c, bkey_i_to_s(&new_key->k_i), + ret = drop_dev_ptrs(c, bkey_i_to_s(&tmp.k), dev_idx, flags, true); if (ret) { bch_err(c, "Cannot drop device without losing data"); goto err; } - ret = bch2_btree_node_update_key(c, iter, b, new_key); + ret = bch2_btree_node_update_key(c, iter, b, &tmp.k); if (ret == -EINTR) { b = bch2_btree_iter_peek_node(iter); goto retry; |