summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2023-05-08 14:23:08 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2023-05-13 00:22:29 -0400
commite5f3228e4ced0a4037c65d52f740dbb87db7aa8a (patch)
tree4cc2b7d5344527f8d0033bc4fa54dfecbccbf9d8
parent809d1855ec71f681fd3aee01f19ffb28c7d7a842 (diff)
bcachefs: Delete some dead code in bch2_replicas_gc_end()
bch2_replicas_gc_(start|end) is now only used for journal replicas entries, which don't have bucket sector counts - so this code is entirely dead and can be deleted. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
-rw-r--r--fs/bcachefs/replicas.c25
1 files changed, 0 insertions, 25 deletions
diff --git a/fs/bcachefs/replicas.c b/fs/bcachefs/replicas.c
index 8ae50dfd8c8c..76efbfce7683 100644
--- a/fs/bcachefs/replicas.c
+++ b/fs/bcachefs/replicas.c
@@ -460,36 +460,11 @@ int bch2_replicas_delta_list_mark(struct bch_fs *c,
int bch2_replicas_gc_end(struct bch_fs *c, int ret)
{
- unsigned i;
-
lockdep_assert_held(&c->replicas_gc_lock);
mutex_lock(&c->sb_lock);
percpu_down_write(&c->mark_lock);
- /*
- * 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);
- }
- }
-
ret = bch2_cpu_replicas_to_sb_replicas(c, &c->replicas_gc);
if (ret)
goto err;