0001
0002
0003
0004
0005
0006 #ifndef __XFS_SCRUB_BTREE_H__
0007 #define __XFS_SCRUB_BTREE_H__
0008
0009
0010
0011
0012 bool xchk_btree_process_error(struct xfs_scrub *sc,
0013 struct xfs_btree_cur *cur, int level, int *error);
0014
0015
0016 bool xchk_btree_xref_process_error(struct xfs_scrub *sc,
0017 struct xfs_btree_cur *cur, int level, int *error);
0018
0019
0020 void xchk_btree_set_corrupt(struct xfs_scrub *sc,
0021 struct xfs_btree_cur *cur, int level);
0022
0023
0024 void xchk_btree_xref_set_corrupt(struct xfs_scrub *sc,
0025 struct xfs_btree_cur *cur, int level);
0026
0027 struct xchk_btree;
0028 typedef int (*xchk_btree_rec_fn)(
0029 struct xchk_btree *bs,
0030 const union xfs_btree_rec *rec);
0031
0032 struct xchk_btree {
0033
0034 struct xfs_scrub *sc;
0035 struct xfs_btree_cur *cur;
0036 xchk_btree_rec_fn scrub_rec;
0037 const struct xfs_owner_info *oinfo;
0038 void *private;
0039
0040
0041 union xfs_btree_rec lastrec;
0042 struct list_head to_check;
0043
0044
0045 union xfs_btree_key lastkey[];
0046 };
0047
0048
0049
0050
0051
0052 static inline size_t
0053 xchk_btree_sizeof(unsigned int nlevels)
0054 {
0055 return struct_size((struct xchk_btree *)NULL, lastkey, nlevels - 1);
0056 }
0057
0058 int xchk_btree(struct xfs_scrub *sc, struct xfs_btree_cur *cur,
0059 xchk_btree_rec_fn scrub_fn, const struct xfs_owner_info *oinfo,
0060 void *private);
0061
0062 #endif