btrfs: sysfs: expose quota mode via sysfs
authorBoris Burkov <boris@bur.io>
Thu, 27 Apr 2023 17:58:20 +0000 (10:58 -0700)
committerDavid Sterba <dsterba@suse.com>
Thu, 12 Oct 2023 14:44:10 +0000 (16:44 +0200)
commit0182764a21b2923d4c238fed9a54db82b65d33b6
tree19abc2752a985dbe005b7a650cc493b52a87eb2a
parent182940f4f4dbd932776414744c8de64333957725
btrfs: sysfs: expose quota mode via sysfs

Add a new sysfs file /sys/fs/btrfs/<uuid>/qgroups/mode
which prints out the mode qgroups is running in. The possible modes are
qgroup, and squota.

If quotas are not enabled, then the qgroups directory will not exist,
so don't handle that mode.

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