All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/5] xfsprogs: optimize -L/-U range calls for xfs_quota's dump/report
@ 2022-04-20 14:45 Andrey Albershteyn
  2022-04-20 14:45 ` [PATCH v2 1/5] xfs_quota: separate quota info acquisition into get_dquot() Andrey Albershteyn
                   ` (4 more replies)
  0 siblings, 5 replies; 16+ messages in thread
From: Andrey Albershteyn @ 2022-04-20 14:45 UTC (permalink / raw)
  To: linux-xfs; +Cc: Andrey Albershteyn

The xfs_quota's 'report' and 'dump' commands have -L and -U
arguments for restricting quota querying to the range of
UIDs/GIDs/PIDs. The current implementation is using XFS_GETQUOTA to
get every ID in specified range. It doesn't perform well on wider
ranges. Also, the fallback case (UIDs from /etc/passwd) doesn't take
into account range restriction and outputs all users with quota.

First 3 patches do minor refactoring to split acquisition and
outputting of the quota information. This is not that necessary, but
makes it easier to manipulate with acquired data.

The 4th one replaces XFS_GETQUOTA based loop with XFS_GETNEXTQUOTA
one. The latter returns ID of the next user/group/project with
non-empty quota. The ID is then used for further call.

The last patch adds range checks for fallback case when
XFS_GETNEXTQUOTA is not available.

The fallback case will be also executed in case that empty range is
specified (e.g. -L <too high>), but will print nothing.

Changes from v1:
Darrick J. Wong:
- Renamed get_quota() -> get_dquot()
Christoph Hellwig:
- Formatting: if() with tab, operators without spaces, long lines
- Replace 'fs_disk_quota_t' with 'struct fs_disk_quota'
- Merge and then split patch 2 & 3, so dump_file() and
  report_mount() are in separate patches

Andrey Albershteyn (5):
  xfs_quota: separate quota info acquisition into get_dquot()
  xfs_quota: separate get_dquot() and dump_file()
  xfs_quota: separate get_dquot() and report_mount()
  xfs_quota: utilize XFS_GETNEXTQUOTA for ranged calls in report/dump
  xfs_quota: apply -L/-U range limits in uid/gid/pid loops

 quota/report.c | 323 ++++++++++++++++++++++++-------------------------
 1 file changed, 160 insertions(+), 163 deletions(-)

-- 
2.27.0


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

end of thread, other threads:[~2022-04-28 12:43 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-20 14:45 [PATCH v2 0/5] xfsprogs: optimize -L/-U range calls for xfs_quota's dump/report Andrey Albershteyn
2022-04-20 14:45 ` [PATCH v2 1/5] xfs_quota: separate quota info acquisition into get_dquot() Andrey Albershteyn
2022-04-25 16:22   ` Darrick J. Wong
2022-04-20 14:45 ` [PATCH v2 2/5] xfs_quota: separate get_dquot() and dump_file() Andrey Albershteyn
2022-04-24  5:29   ` Christoph Hellwig
2022-04-25 16:28   ` Darrick J. Wong
2022-04-28 12:43     ` Andrey Albershteyn
2022-04-20 14:45 ` [PATCH v2 3/5] xfs_quota: separate get_dquot() and report_mount() Andrey Albershteyn
2022-04-24  5:29   ` Christoph Hellwig
2022-04-25 16:29   ` Darrick J. Wong
2022-04-20 14:45 ` [PATCH v2 4/5] xfs_quota: utilize XFS_GETNEXTQUOTA for ranged calls in report/dump Andrey Albershteyn
2022-04-25 16:33   ` Darrick J. Wong
2022-04-28  8:39     ` Andrey Albershteyn
2022-04-20 14:45 ` [PATCH v2 5/5] xfs_quota: apply -L/-U range limits in uid/gid/pid loops Andrey Albershteyn
2022-04-24  5:29   ` Christoph Hellwig
2022-04-25 16:33   ` Darrick J. Wong

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.