xfs: improve dquot iteration for scrub
authorDarrick J. Wong <djwong@kernel.org>
Fri, 15 Dec 2023 18:03:45 +0000 (10:03 -0800)
committerDarrick J. Wong <djwong@kernel.org>
Fri, 15 Dec 2023 18:03:45 +0000 (10:03 -0800)
commit21d7500929c8a0b10e22a6755850c6f9a9280284
tree35c571883e7554258ec8f2069ce689f0e02f34af
parent774b5c0a5152892bf5f43ce560f3a814b1fdf3b7
xfs: improve dquot iteration for scrub

Upon a closer inspection of the quota record scrubber, I noticed that
dqiterate wasn't actually walking all possible dquots for the mapped
blocks in the quota file.  This is due to xfs_qm_dqget_next skipping all
XFS_IS_DQUOT_UNINITIALIZED dquots.

For a fsck program, we really want to look at all the dquots, even if
all counters and limits in the dquot record are zero.  Rewrite the
implementation to do this, as well as switching to an iterator paradigm
to reduce the number of indirect calls.

This enables removal of the old broken dqiterate code from xfs_dquot.c.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
fs/xfs/Makefile
fs/xfs/libxfs/xfs_format.h
fs/xfs/scrub/dqiterate.c [new file with mode: 0644]
fs/xfs/scrub/quota.c
fs/xfs/scrub/quota.h [new file with mode: 0644]
fs/xfs/scrub/trace.c
fs/xfs/scrub/trace.h
fs/xfs/xfs_dquot.c
fs/xfs/xfs_dquot.h