dabtree.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. // SPDX-License-Identifier: GPL-2.0+
  2. /*
  3. * Copyright (C) 2017 Oracle. All Rights Reserved.
  4. * Author: Darrick J. Wong <[email protected]>
  5. */
  6. #ifndef __XFS_SCRUB_DABTREE_H__
  7. #define __XFS_SCRUB_DABTREE_H__
  8. /* dir/attr btree */
  9. struct xchk_da_btree {
  10. struct xfs_da_args dargs;
  11. xfs_dahash_t hashes[XFS_DA_NODE_MAXDEPTH];
  12. int maxrecs[XFS_DA_NODE_MAXDEPTH];
  13. struct xfs_da_state *state;
  14. struct xfs_scrub *sc;
  15. void *private;
  16. /*
  17. * Lowest and highest directory block address in which we expect
  18. * to find dir/attr btree node blocks. For a directory this
  19. * (presumably) means between LEAF_OFFSET and FREE_OFFSET; for
  20. * attributes there is no limit.
  21. */
  22. xfs_dablk_t lowest;
  23. xfs_dablk_t highest;
  24. int tree_level;
  25. };
  26. typedef int (*xchk_da_btree_rec_fn)(struct xchk_da_btree *ds, int level);
  27. /* Check for da btree operation errors. */
  28. bool xchk_da_process_error(struct xchk_da_btree *ds, int level, int *error);
  29. /* Check for da btree corruption. */
  30. void xchk_da_set_corrupt(struct xchk_da_btree *ds, int level);
  31. int xchk_da_btree_hash(struct xchk_da_btree *ds, int level, __be32 *hashp);
  32. int xchk_da_btree(struct xfs_scrub *sc, int whichfork,
  33. xchk_da_btree_rec_fn scrub_fn, void *private);
  34. #endif /* __XFS_SCRUB_DABTREE_H__ */