bcachefs: kill sysfs internal/accounting
authorKent Overstreet <kent.overstreet@linux.dev>
Mon, 9 Dec 2024 01:55:03 +0000 (20:55 -0500)
committerKent Overstreet <kent.overstreet@linux.dev>
Sat, 21 Dec 2024 06:36:23 +0000 (01:36 -0500)
Since we added per-inode counters there's now far too many counters to
show in one shot - if we want this in the future, it'll have to be in
debugfs.

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

index b18cbe80936b272999d5bf40bd51b34290023d53..22a7db63e50ce82ed2f032afb22b1f738937eb8e 100644 (file)
@@ -471,32 +471,6 @@ int bch2_fs_accounting_read(struct bch_fs *c, darray_char *out_buf, unsigned acc
        return ret;
 }
 
-void bch2_fs_accounting_to_text(struct printbuf *out, struct bch_fs *c)
-{
-       struct bch_accounting_mem *acc = &c->accounting;
-
-       percpu_down_read(&c->mark_lock);
-       out->atomic++;
-
-       eytzinger0_for_each(i, acc->k.nr) {
-               struct disk_accounting_pos acc_k;
-               bpos_to_disk_accounting_pos(&acc_k, acc->k.data[i].pos);
-
-               bch2_accounting_key_to_text(out, &acc_k);
-
-               u64 v[BCH_ACCOUNTING_MAX_COUNTERS];
-               bch2_accounting_mem_read_counters(acc, i, v, ARRAY_SIZE(v), false);
-
-               prt_str(out, ":");
-               for (unsigned j = 0; j < acc->k.data[i].nr_counters; j++)
-                       prt_printf(out, " %llu", v[j]);
-               prt_newline(out);
-       }
-
-       --out->atomic;
-       percpu_up_read(&c->mark_lock);
-}
-
 static void bch2_accounting_free_counters(struct bch_accounting_mem *acc, bool gc)
 {
        darray_for_each(acc->k, e) {
index 0eeaca12c5896698a4e7ccbbd3fc87bdcf945c9b..2560de10b09dbf813c0ae93b891a9d51903612ac 100644 (file)
@@ -251,7 +251,6 @@ static inline void bch2_accounting_trans_commit_revert(struct btree_trans *trans
 
 int bch2_fs_replicas_usage_read(struct bch_fs *, darray_char *);
 int bch2_fs_accounting_read(struct bch_fs *, darray_char *, unsigned);
-void bch2_fs_accounting_to_text(struct printbuf *, struct bch_fs *);
 
 int bch2_gc_accounting_start(struct bch_fs *);
 int bch2_gc_accounting_done(struct bch_fs *);
index 97733c766948a3ee60de446c1df1663bb9b75f76..48bc6ad03f0932f11cdf1b7c1e3c7dc8fe898699 100644 (file)
@@ -203,7 +203,6 @@ read_attribute(disk_groups);
 
 read_attribute(has_data);
 read_attribute(alloc_debug);
-read_attribute(accounting);
 read_attribute(usage_base);
 
 #define x(t, n, ...) read_attribute(t);
@@ -397,9 +396,6 @@ SHOW(bch2_fs)
        if (attr == &sysfs_alloc_debug)
                bch2_fs_alloc_debug_to_text(out, c);
 
-       if (attr == &sysfs_accounting)
-               bch2_fs_accounting_to_text(out, c);
-
        if (attr == &sysfs_usage_base)
                bch2_fs_usage_base_to_text(out, c);
 
@@ -595,7 +591,6 @@ struct attribute *bch2_fs_internal_files[] = {
 
        &sysfs_disk_groups,
        &sysfs_alloc_debug,
-       &sysfs_accounting,
        &sysfs_usage_base,
        NULL
 };