public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] xfsprogs: optimize -L/-U range calls for xfs_quota's dump/report
@ 2022-03-28 22:24 Andrey Albershteyn
  2022-03-28 22:24 ` [PATCH 1/5] xfs_quota: separate quota info acquisition into get_quota() Andrey Albershteyn
                   ` (4 more replies)
  0 siblings, 5 replies; 14+ messages in thread
From: Andrey Albershteyn @ 2022-03-28 22:24 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. The XFS_GETNEXTQUOTA is used only when upper limit is not
specified.  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
printing 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 in further call.

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

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

Andrey Albershteyn (5):
  xfs_quota: separate quota info acquisition into get_quota()
  xfs_quota: create fs_disk_quota_t on upper level
  xfs_quota: split get_quota() and report_mount()/dump_file()
  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 | 319 ++++++++++++++++++++++++-------------------------
 1 file changed, 156 insertions(+), 163 deletions(-)

-- 
2.27.0


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

end of thread, other threads:[~2022-04-13 15:54 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-28 22:24 [PATCH 0/5] xfsprogs: optimize -L/-U range calls for xfs_quota's dump/report Andrey Albershteyn
2022-03-28 22:24 ` [PATCH 1/5] xfs_quota: separate quota info acquisition into get_quota() Andrey Albershteyn
2022-03-28 23:44   ` Darrick J. Wong
2022-04-06 16:31   ` Christoph Hellwig
2022-03-28 22:25 ` [PATCH 2/5] xfs_quota: create fs_disk_quota_t on upper level Andrey Albershteyn
2022-04-06 16:34   ` Christoph Hellwig
2022-03-28 22:25 ` [PATCH 3/5] xfs_quota: split get_quota() and report_mount()/dump_file() Andrey Albershteyn
2022-04-06 16:36   ` Christoph Hellwig
2022-04-07 11:06     ` Andrey Albershteyn
2022-04-13 15:54       ` Christoph Hellwig
2022-03-28 22:25 ` [PATCH 4/5] xfs_quota: utilize XFS_GETNEXTQUOTA for ranged calls in report/dump Andrey Albershteyn
2022-04-06 16:38   ` Christoph Hellwig
2022-03-28 22:25 ` [PATCH 5/5] xfs_quota: apply -L/-U range limits in uid/gid/pid loops Andrey Albershteyn
2022-04-06 16:38   ` Christoph Hellwig

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