All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] btrfs: add sysfs interface for qgroup
@ 2020-06-28  5:07 Qu Wenruo
  2020-06-28  5:07 ` [PATCH v2 1/2] btrfs: use __u16 for the return value of btrfs_qgroup_level() Qu Wenruo
  2020-06-28  5:07 ` [PATCH v2 2/2] btrfs: qgroup: add sysfs interface for debug Qu Wenruo
  0 siblings, 2 replies; 16+ messages in thread
From: Qu Wenruo @ 2020-06-28  5:07 UTC (permalink / raw)
  To: linux-btrfs

This patchset will add the following sysfs interfaces for qgroup:

  /sys/fs/btrfs/<UUID>/qgroups/<qgroup_id>/reference
  /sys/fs/btrfs/<UUID>/qgroups/<qgroup_id>/exclusive
  /sys/fs/btrfs/<UUID>/qgroups/<qgroup_id>/max_reference
  /sys/fs/btrfs/<UUID>/qgroups/<qgroup_id>/max_exclusive
  /sys/fs/btrfs/<UUID>/qgroups/<qgroup_id>/limit_flags
   ^^^ Above are already in "btrfs qgroup show" command output ^^^
  
  /sys/fs/btrfs/<UUID>/qgroups/<qgroup_id>/rsv_data
  /sys/fs/btrfs/<UUID>/qgroups/<qgroup_id>/rsv_meta_pertrans
  /sys/fs/btrfs/<UUID>/qgroups/<qgroup_id>/rsv_meta_prealloc

These interfaces are mostly for debug purpose, to give us a clear view
of which part is leaking.

Changelog:
v2:
- Add a new patch to change the return value type of
  btrfs_qgroup_level()

- Fix the wrong btrfs_sysfs_add_one_qgroup() call timming
  That function needs to allocate memory, thus can't be called in
  add_qgroup_rb() where some call sites are holding a spin lock.
  Delay btrfs_sysfs_add_one_qgroup() after add_qgroup_rb() until the
  spin lock is released.

- Skip qgroup sysfs interface for qgroup selftest
  This makes no sense for selftest to initialize the sysfs interface
  and since we don't initialize fs_devices->kobj either, it's not
  possible to utilize the sysfs interface in selftest.

- Use proper helpers for qgroup BTRFS_ATTRs

- Use more human-readable names in qgroup sysfs entries

- Remove the unneeded completion for qgroup


Qu Wenruo (2):
  btrfs: use __u16 for the return value of btrfs_qgroup_level()
  btrfs: qgroup: add sysfs interface for debug

 fs/btrfs/ctree.h                |   1 +
 fs/btrfs/qgroup.c               |  46 +++++++---
 fs/btrfs/qgroup.h               |  11 +++
 fs/btrfs/sysfs.c                | 151 ++++++++++++++++++++++++++++++++
 fs/btrfs/sysfs.h                |   6 ++
 include/uapi/linux/btrfs_tree.h |   4 +-
 6 files changed, 207 insertions(+), 12 deletions(-)

-- 
2.27.0


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

end of thread, other threads:[~2020-07-16  8:41 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-28  5:07 [PATCH v2 0/2] btrfs: add sysfs interface for qgroup Qu Wenruo
2020-06-28  5:07 ` [PATCH v2 1/2] btrfs: use __u16 for the return value of btrfs_qgroup_level() Qu Wenruo
2020-06-28  5:07 ` [PATCH v2 2/2] btrfs: qgroup: add sysfs interface for debug Qu Wenruo
2020-06-29 21:30   ` David Sterba
2020-06-29 23:17     ` Qu Wenruo
2020-06-30  8:07       ` David Sterba
2020-06-30 14:27         ` David Sterba
2020-06-30 16:57   ` David Sterba
2020-07-01  0:06     ` Qu Wenruo
2020-07-15 13:49   ` Chris Down
2020-07-16  0:15     ` Qu Wenruo
2020-07-16  0:25       ` Chris Down
2020-07-16  0:27       ` Qu Wenruo
     [not found]         ` <20200716004031.GC2140@chrisdown.name>
2020-07-16  1:51           ` Qu Wenruo
2020-07-16  6:21           ` Qu Wenruo
2020-07-16  8:41             ` Chris Down

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.