xref: /linux/fs/xfs/scrub/quota.h (revision 06d07429858317ded2db7986113a9e0129cd599b)
1 // SPDX-License-Identifier: GPL-2.0-or-later
2 /*
3  * Copyright (C) 2018-2023 Oracle.  All Rights Reserved.
4  * Author: Darrick J. Wong <djwong@kernel.org>
5  */
6 #ifndef __XFS_SCRUB_QUOTA_H__
7 #define __XFS_SCRUB_QUOTA_H__
8 
9 xfs_dqtype_t xchk_quota_to_dqtype(struct xfs_scrub *sc);
10 
11 /* dquot iteration code */
12 
13 struct xchk_dqiter {
14 	struct xfs_scrub	*sc;
15 
16 	/* Quota file that we're walking. */
17 	struct xfs_inode	*quota_ip;
18 
19 	/* Cached data fork mapping for the dquot. */
20 	struct xfs_bmbt_irec	bmap;
21 
22 	/* The next dquot to scan. */
23 	uint64_t		id;
24 
25 	/* Quota type (user/group/project). */
26 	xfs_dqtype_t		dqtype;
27 
28 	/* Data fork sequence number to detect stale mappings. */
29 	unsigned int		if_seq;
30 };
31 
32 void xchk_dqiter_init(struct xchk_dqiter *cursor, struct xfs_scrub *sc,
33 		xfs_dqtype_t dqtype);
34 int xchk_dquot_iter(struct xchk_dqiter *cursor, struct xfs_dquot **dqpp);
35 
36 #endif /* __XFS_SCRUB_QUOTA_H__ */
37