Commit 9b34f02c authored by Kent Overstreet's avatar Kent Overstreet

bcachefs: Kill dev_usage->buckets_ec

This counter is redundant; it's simply the sum of BCH_DATA_stripe and
BCH_DATA_parity buckets.
Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent ed0cd515
...@@ -2231,8 +2231,8 @@ struct jset_entry_dev_usage { ...@@ -2231,8 +2231,8 @@ struct jset_entry_dev_usage {
__le32 dev; __le32 dev;
__u32 pad; __u32 pad;
__le64 buckets_ec; __le64 _buckets_ec; /* No longer used */
__le64 _buckets_unavailable; /* No longer used */ __le64 _buckets_unavailable; /* No longer used */
struct jset_entry_dev_usage_type d[]; struct jset_entry_dev_usage_type d[];
}; };
......
...@@ -1251,9 +1251,6 @@ static int bch2_gc_done(struct bch_fs *c, ...@@ -1251,9 +1251,6 @@ static int bch2_gc_done(struct bch_fs *c,
copy_dev_field(dev_usage_fragmented_wrong, copy_dev_field(dev_usage_fragmented_wrong,
d[i].fragmented, "%s fragmented", bch2_data_types[i]); d[i].fragmented, "%s fragmented", bch2_data_types[i]);
} }
copy_dev_field(dev_usage_buckets_ec_wrong,
buckets_ec, "buckets_ec");
} }
{ {
......
...@@ -299,12 +299,6 @@ void bch2_dev_usage_to_text(struct printbuf *out, struct bch_dev_usage *usage) ...@@ -299,12 +299,6 @@ void bch2_dev_usage_to_text(struct printbuf *out, struct bch_dev_usage *usage)
prt_tab_rjust(out); prt_tab_rjust(out);
prt_newline(out); prt_newline(out);
} }
prt_str(out, "ec");
prt_tab(out);
prt_u64(out, usage->buckets_ec);
prt_tab_rjust(out);
prt_newline(out);
} }
static void bch2_dev_usage_update(struct bch_fs *c, struct bch_dev *ca, static void bch2_dev_usage_update(struct bch_fs *c, struct bch_dev *ca,
...@@ -328,9 +322,6 @@ static void bch2_dev_usage_update(struct bch_fs *c, struct bch_dev *ca, ...@@ -328,9 +322,6 @@ static void bch2_dev_usage_update(struct bch_fs *c, struct bch_dev *ca,
u->d[old.data_type].buckets--; u->d[old.data_type].buckets--;
u->d[new.data_type].buckets++; u->d[new.data_type].buckets++;
u->buckets_ec -= !!old.stripe;
u->buckets_ec += !!new.stripe;
u->d[old.data_type].sectors -= bch2_bucket_sectors_dirty(old); u->d[old.data_type].sectors -= bch2_bucket_sectors_dirty(old);
u->d[new.data_type].sectors += bch2_bucket_sectors_dirty(new); u->d[new.data_type].sectors += bch2_bucket_sectors_dirty(new);
......
...@@ -33,8 +33,6 @@ struct bucket_gens { ...@@ -33,8 +33,6 @@ struct bucket_gens {
}; };
struct bch_dev_usage { struct bch_dev_usage {
u64 buckets_ec;
struct { struct {
u64 buckets; u64 buckets;
u64 sectors; /* _compressed_ sectors: */ u64 sectors; /* _compressed_ sectors: */
......
...@@ -687,8 +687,6 @@ static void journal_entry_dev_usage_to_text(struct printbuf *out, struct bch_fs ...@@ -687,8 +687,6 @@ static void journal_entry_dev_usage_to_text(struct printbuf *out, struct bch_fs
le64_to_cpu(u->d[i].sectors), le64_to_cpu(u->d[i].sectors),
le64_to_cpu(u->d[i].fragmented)); le64_to_cpu(u->d[i].fragmented));
} }
prt_printf(out, " buckets_ec: %llu", le64_to_cpu(u->buckets_ec));
} }
static int journal_entry_log_validate(struct bch_fs *c, static int journal_entry_log_validate(struct bch_fs *c,
......
...@@ -305,8 +305,6 @@ static int journal_replay_entry_early(struct bch_fs *c, ...@@ -305,8 +305,6 @@ static int journal_replay_entry_early(struct bch_fs *c,
struct bch_dev *ca = bch_dev_bkey_exists(c, le32_to_cpu(u->dev)); struct bch_dev *ca = bch_dev_bkey_exists(c, le32_to_cpu(u->dev));
unsigned i, nr_types = jset_entry_dev_usage_nr_types(u); unsigned i, nr_types = jset_entry_dev_usage_nr_types(u);
ca->usage_base->buckets_ec = le64_to_cpu(u->buckets_ec);
for (i = 0; i < min_t(unsigned, nr_types, BCH_DATA_NR); i++) { for (i = 0; i < min_t(unsigned, nr_types, BCH_DATA_NR); i++) {
ca->usage_base->d[i].buckets = le64_to_cpu(u->d[i].buckets); ca->usage_base->d[i].buckets = le64_to_cpu(u->d[i].buckets);
ca->usage_base->d[i].sectors = le64_to_cpu(u->d[i].sectors); ca->usage_base->d[i].sectors = le64_to_cpu(u->d[i].sectors);
......
...@@ -256,7 +256,6 @@ void bch2_journal_super_entries_add_common(struct bch_fs *c, ...@@ -256,7 +256,6 @@ void bch2_journal_super_entries_add_common(struct bch_fs *c,
u->entry.type = BCH_JSET_ENTRY_dev_usage; u->entry.type = BCH_JSET_ENTRY_dev_usage;
u->dev = cpu_to_le32(dev); u->dev = cpu_to_le32(dev);
u->buckets_ec = cpu_to_le64(ca->usage_base->buckets_ec);
for (i = 0; i < BCH_DATA_NR; i++) { for (i = 0; i < BCH_DATA_NR; i++) {
u->d[i].buckets = cpu_to_le64(ca->usage_base->d[i].buckets); u->d[i].buckets = cpu_to_le64(ca->usage_base->d[i].buckets);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment