summaryrefslogtreecommitdiff
path: root/fs/bcachefs/sysfs.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2018-07-24 14:54:39 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 17:08:08 -0400
commit5b650fd11a00271b9d4c033d1d0780826e050137 (patch)
tree4494f3164166d229041626880f99e6057836381b /fs/bcachefs/sysfs.c
parent09f3297ac90aae99d8f7e776c8df5dd0d32c1ba9 (diff)
bcachefs: Account for internal fragmentation better
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/sysfs.c')
-rw-r--r--fs/bcachefs/sysfs.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/fs/bcachefs/sysfs.c b/fs/bcachefs/sysfs.c
index db8af44c7921..4ce7168e930b 100644
--- a/fs/bcachefs/sysfs.c
+++ b/fs/bcachefs/sysfs.c
@@ -238,7 +238,7 @@ static ssize_t show_fs_alloc_debug(struct bch_fs *c, char *buf)
"capacity:\t\t%llu\n",
c->capacity);
- for (replicas = 0; replicas < ARRAY_SIZE(stats.s); replicas++) {
+ for (replicas = 0; replicas < ARRAY_SIZE(stats.replicas); replicas++) {
out += scnprintf(out, end - out,
"%u replicas:\n",
replicas + 1);
@@ -247,12 +247,20 @@ static ssize_t show_fs_alloc_debug(struct bch_fs *c, char *buf)
out += scnprintf(out, end - out,
"\t%s:\t\t%llu\n",
bch2_data_types[type],
- stats.s[replicas].data[type]);
+ stats.replicas[replicas].data[type]);
out += scnprintf(out, end - out,
"\treserved:\t%llu\n",
- stats.s[replicas].persistent_reserved);
+ stats.replicas[replicas].persistent_reserved);
}
+ out += scnprintf(out, end - out, "bucket usage\n");
+
+ for (type = BCH_DATA_SB; type < BCH_DATA_NR; type++)
+ out += scnprintf(out, end - out,
+ "\t%s:\t\t%llu\n",
+ bch2_data_types[type],
+ stats.buckets[type]);
+
out += scnprintf(out, end - out,
"online reserved:\t%llu\n",
stats.online_reserved);