- /*
- * this is kind of crappy; the replicas gc mechanism needs to be ripped
- * out
- */
-
- for (i = 0; i < c->replicas.nr; i++) {
- struct bch_replicas_entry *e =
- cpu_replicas_entry(&c->replicas, i);
- struct bch_replicas_cpu n;
-
- if (!__replicas_has_entry(&c->replicas_gc, e) &&
- bch2_fs_usage_read_one(c, &c->usage_base->replicas[i])) {
- n = cpu_replicas_add_entry(&c->replicas_gc, e);
- if (!n.entries) {
- ret = -BCH_ERR_ENOMEM_cpu_replicas;
- goto err;
- }
-
- swap(n, c->replicas_gc);
- kfree(n.entries);
- }
- }
-