]> www.infradead.org Git - nvme.git/commitdiff
bcachefs: Kill replicas_journal_res
authorKent Overstreet <kent.overstreet@linux.dev>
Tue, 2 Jan 2024 05:22:57 +0000 (00:22 -0500)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 14 Jul 2024 23:00:13 +0000 (19:00 -0400)
More dead code deletion

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/bcachefs.h
fs/bcachefs/replicas.c
fs/bcachefs/super.c

index 50937f6aec0ac5d87029679e6eeb0fdd350f8e48..b9f5327ab0338d74ddc662d112c07a37a44ba2da 100644 (file)
@@ -748,9 +748,7 @@ struct bch_fs {
        struct mutex            replicas_gc_lock;
 
        struct journal_entry_res btree_root_journal_res;
-       struct journal_entry_res replicas_journal_res;
        struct journal_entry_res clock_journal_res;
-       struct journal_entry_res dev_usage_journal_res;
 
        struct bch_disk_groups_cpu __rcu *disk_groups;
 
index 05214ad2ad358b52569fb6d9dae28144971e8bda..5252d3ee8a2a729fe5a233f95fb5cd18f7ecdbc5 100644 (file)
@@ -331,32 +331,6 @@ err:
        goto out;
 }
 
-static unsigned reserve_journal_replicas(struct bch_fs *c,
-                                    struct bch_replicas_cpu *r)
-{
-       struct bch_replicas_entry_v1 *e;
-       unsigned journal_res_u64s = 0;
-
-       /* nr_inodes: */
-       journal_res_u64s +=
-               DIV_ROUND_UP(sizeof(struct jset_entry_usage), sizeof(u64));
-
-       /* key_version: */
-       journal_res_u64s +=
-               DIV_ROUND_UP(sizeof(struct jset_entry_usage), sizeof(u64));
-
-       /* persistent_reserved: */
-       journal_res_u64s +=
-               DIV_ROUND_UP(sizeof(struct jset_entry_usage), sizeof(u64)) *
-               BCH_REPLICAS_MAX;
-
-       for_each_cpu_replicas_entry(r, e)
-               journal_res_u64s +=
-                       DIV_ROUND_UP(sizeof(struct jset_entry_data_usage) +
-                                    e->nr_devs, sizeof(u64));
-       return journal_res_u64s;
-}
-
 noinline
 static int bch2_mark_replicas_slowpath(struct bch_fs *c,
                                struct bch_replicas_entry_v1 *new_entry)
@@ -390,10 +364,6 @@ static int bch2_mark_replicas_slowpath(struct bch_fs *c,
                ret = bch2_cpu_replicas_to_sb_replicas(c, &new_r);
                if (ret)
                        goto err;
-
-               bch2_journal_entry_res_resize(&c->journal,
-                               &c->replicas_journal_res,
-                               reserve_journal_replicas(c, &new_r));
        }
 
        if (!new_r.entries &&
@@ -978,9 +948,5 @@ void bch2_fs_replicas_exit(struct bch_fs *c)
 
 int bch2_fs_replicas_init(struct bch_fs *c)
 {
-       bch2_journal_entry_res_resize(&c->journal,
-                       &c->replicas_journal_res,
-                       reserve_journal_replicas(c, &c->replicas));
-
        return replicas_table_update(c, &c->replicas);
 }
index 01f8c7dd45a5ff775f09e8f09fbd4a27952f9eb1..baee01d7856f30cc9b43489531b47c5f7aacf5e7 100644 (file)
@@ -223,22 +223,6 @@ struct bch_fs *bch2_uuid_to_fs(__uuid_t uuid)
        return c;
 }
 
-static void bch2_dev_usage_journal_reserve(struct bch_fs *c)
-{
-       unsigned nr = 0, u64s =
-               ((sizeof(struct jset_entry_dev_usage) +
-                 sizeof(struct jset_entry_dev_usage_type) * BCH_DATA_NR)) /
-               sizeof(u64);
-
-       rcu_read_lock();
-       for_each_member_device_rcu(c, ca, NULL)
-               nr++;
-       rcu_read_unlock();
-
-       bch2_journal_entry_res_resize(&c->journal,
-                       &c->dev_usage_journal_res, u64s * nr);
-}
-
 /* Filesystem RO/RW: */
 
 /*
@@ -946,7 +930,6 @@ static struct bch_fs *bch2_fs_alloc(struct bch_sb *sb, struct bch_opts opts)
        bch2_journal_entry_res_resize(&c->journal,
                        &c->btree_root_journal_res,
                        BTREE_ID_NR * (JSET_KEYS_U64s + BKEY_BTREE_PTR_U64s_MAX));
-       bch2_dev_usage_journal_reserve(c);
        bch2_journal_entry_res_resize(&c->journal,
                        &c->clock_journal_res,
                        (sizeof(struct jset_entry_clock) / sizeof(u64)) * 2);
@@ -1719,8 +1702,6 @@ int bch2_dev_remove(struct bch_fs *c, struct bch_dev *ca, int flags)
 
        mutex_unlock(&c->sb_lock);
        up_write(&c->state_lock);
-
-       bch2_dev_usage_journal_reserve(c);
        return 0;
 err:
        if (ca->mi.state == BCH_MEMBER_STATE_rw &&
@@ -1849,8 +1830,6 @@ have_slot:
        bch2_write_super(c);
        mutex_unlock(&c->sb_lock);
 
-       bch2_dev_usage_journal_reserve(c);
-
        ret = bch2_dev_usage_init(ca);
        if (ret)
                goto err_late;