btrfs: sysfs: add size class stats
authorBoris Burkov <boris@bur.io>
Wed, 15 Feb 2023 20:59:49 +0000 (12:59 -0800)
committerDavid Sterba <dsterba@suse.com>
Wed, 1 Mar 2023 18:27:20 +0000 (19:27 +0100)
commitfcd9531b305288dc2848d38567d466af4ee147b2
tree7c4a644d6994df5e44d000f5c53eb03f30bd567d
parent964a54e5e1a0d70cd80bd5a0885a1938463625b1
btrfs: sysfs: add size class stats

Make it possible to see the distribution of size classes for block
groups. Helpful for testing and debugging the allocator w.r.t. to size
classes.

The new stats can be found at the path:

  /sys/fs/btrfs/<FSID>/allocation/<bg-type>/size_class

but they will only be non-zero for bg-type = data.

Signed-off-by: Boris Burkov <boris@bur.io>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/sysfs.c