xref: /linux/fs/xfs/scrub/attr.h (revision 55d0969c451159cff86949b38c39171cab962069)
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 /*
3  * Copyright (C) 2019-2023 Oracle.  All Rights Reserved.
4  * Author: Darrick J. Wong <djwong@kernel.org>
5  */
6 #ifndef __XFS_SCRUB_ATTR_H__
7 #define __XFS_SCRUB_ATTR_H__
8 
9 /*
10  * Temporary storage for online scrub and repair of extended attributes.
11  */
12 struct xchk_xattr_buf {
13 	/* Bitmap of used space in xattr leaf blocks and shortform forks. */
14 	unsigned long		*usedmap;
15 
16 	/* Bitmap of free space in xattr leaf blocks. */
17 	unsigned long		*freemap;
18 
19 	/* Memory buffer used to hold salvaged xattr names. */
20 	unsigned char		*name;
21 
22 	/* Memory buffer used to extract xattr values. */
23 	void			*value;
24 	size_t			value_sz;
25 };
26 
27 bool xchk_xattr_set_map(struct xfs_scrub *sc, unsigned long *map,
28 		unsigned int start, unsigned int len);
29 int xchk_setup_xattr_buf(struct xfs_scrub *sc, size_t value_size);
30 
31 #endif	/* __XFS_SCRUB_ATTR_H__ */
32