It was switching off of the key type incorrectly - this code must've
been quite old, and not rereplicating anything that wasn't a
btree_ptr_v1 or a plain old extent.
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
struct data_opts *data_opts)
{
unsigned nr_good = bch2_bkey_durability(c, k);
- unsigned replicas = 0;
-
- switch (k.k->type) {
- case KEY_TYPE_btree_ptr:
- replicas = c->opts.metadata_replicas;
- break;
- case KEY_TYPE_extent:
- replicas = io_opts->data_replicas;
- break;
- }
+ unsigned replicas = bkey_is_btree_ptr(k.k)
+ ? c->opts.metadata_replicas
+ : io_opts->data_replicas;
if (!nr_good || nr_good >= replicas)
return DATA_SKIP;