public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] btrfs-progs: subvolume-list: add qgroup sizes output
@ 2023-11-28  8:44 Qu Wenruo
  2023-11-28  8:44 ` [PATCH 1/3] btrfs-progs: separate root attributes into a dedicated structure from root_info Qu Wenruo
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Qu Wenruo @ 2023-11-28  8:44 UTC (permalink / raw)
  To: linux-btrfs; +Cc: william.brown

ZFS' management tool is way better received than btrfs-progs, one of the
user-friendly point is the default `zpool list`, which includes the size
of each subvolume.

I'm not sure how ZFS handles it, but for btrfs we need qgroups (or the
faster but slightly less accurate squota) to get the accurate numbers.

But considering a lot of distro is enabling qgroup by default for
exactly the same reason, and during the years qgroup itself is also
under a lot of optimization, I believe adding sizes output for `btrfs
subvolume list` is an overall benefit for end uesrs.

This patch would do exactly so, the output example is:

 # ./btrfs subv list -t /mnt/btrfs/
 ID	gen	top level	rfer	excl	path
 --	---	---------	----	----	----
 256	11	5		1064960	1064960	subvol1
 257	11	5		4210688	4210688	subvol2

The extra columns are added depending on if qgroup is enabled, and we
allow users to force such output, but if qgroup is not enabled and we're
forced to output such sizes, a warning would be outputted and fill all
the sizes value as 0.

Thanks William Brown for the UI suggestion.

Although there are still some pitfalls, mentioned in the last patch.

Qu Wenruo (3):
  btrfs-progs: separate root attributes into a dedicated structure from
    root_info
  btrfs-progs: use root_attr structure to pass various attributes
  btrfs-progs: subvolume-list: output qgroup sizes for subvolumes

 Documentation/btrfs-subvolume.rst |  12 +-
 cmds/subvolume-list.c             | 572 ++++++++++++++++++------------
 2 files changed, 349 insertions(+), 235 deletions(-)

--
2.42.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-03-25 22:51 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-28  8:44 [PATCH 0/3] btrfs-progs: subvolume-list: add qgroup sizes output Qu Wenruo
2023-11-28  8:44 ` [PATCH 1/3] btrfs-progs: separate root attributes into a dedicated structure from root_info Qu Wenruo
2023-11-28  8:44 ` [PATCH 2/3] btrfs-progs: use root_attr structure to pass various attributes Qu Wenruo
2023-11-28  8:44 ` [PATCH 3/3] btrfs-progs: subvolume-list: output qgroup sizes for subvolumes Qu Wenruo
2023-12-06 21:30 ` [PATCH 0/3] btrfs-progs: subvolume-list: add qgroup sizes output David Sterba
2024-03-21  3:21 ` Qu Wenruo
2024-03-25 22:44   ` David Sterba

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox