// SPDX-License-Identifier: GPL-2.0-or-later /* * Copyright (C) 2023 Oracle. All Rights Reserved. * Author: Darrick J. Wong <[email protected]> */ #include "xfs.h" #include "xfs_fs.h" #include "xfs_shared.h" #include "xfs_bit.h" #include "xfs_format.h" #include "xfs_trans_resv.h" #include "xfs_mount.h" #include "xfs_log_format.h" #include "xfs_trans.h" #include "xfs_inode.h" #include "xfs_quota.h" #include "xfs_qm.h" #include "xfs_bmap.h" #include "scrub/scrub.h" #include "scrub/common.h" #include "scrub/quota.h" #include "scrub/trace.h" /* Initialize a dquot iteration cursor. */ void xchk_dqiter_init( struct xchk_dqiter *cursor, struct xfs_scrub *sc, xfs_dqtype_t dqtype) { … } /* * Ensure that the cached data fork mapping for the dqiter cursor is fresh and * covers the dquot pointed to by the scan cursor. */ STATIC int xchk_dquot_iter_revalidate_bmap( struct xchk_dqiter *cursor) { … } /* Advance the dqiter cursor to the next non-sparse region of the quota file. */ STATIC int xchk_dquot_iter_advance_bmap( struct xchk_dqiter *cursor, uint64_t *next_ondisk_id) { … } /* * Find the id of the next highest incore dquot. Normally this will correspond * exactly with the quota file block mappings, but repair might have erased a * mapping because it was crosslinked; in that case, we need to re-allocate the * space so that we can reset q_blkno. */ STATIC void xchk_dquot_iter_advance_incore( struct xchk_dqiter *cursor, uint64_t *next_incore_id) { … } /* * Walk all incore dquots of this filesystem. Caller must set *@cursorp to * zero before the first call, and must not hold the quota file ILOCK. * Returns 1 and a valid *@dqpp; 0 and *@dqpp == NULL when there are no more * dquots to iterate; or a negative errno. */ int xchk_dquot_iter( struct xchk_dqiter *cursor, struct xfs_dquot **dqpp) { … }