Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0+
0002 /*
0003  * Copyright (C) 2017 Oracle.  All Rights Reserved.
0004  * Author: Darrick J. Wong <darrick.wong@oracle.com>
0005  */
0006 #ifndef __XFS_SCRUB_DABTREE_H__
0007 #define __XFS_SCRUB_DABTREE_H__
0008 
0009 /* dir/attr btree */
0010 
0011 struct xchk_da_btree {
0012     struct xfs_da_args  dargs;
0013     xfs_dahash_t        hashes[XFS_DA_NODE_MAXDEPTH];
0014     int         maxrecs[XFS_DA_NODE_MAXDEPTH];
0015     struct xfs_da_state *state;
0016     struct xfs_scrub    *sc;
0017     void            *private;
0018 
0019     /*
0020      * Lowest and highest directory block address in which we expect
0021      * to find dir/attr btree node blocks.  For a directory this
0022      * (presumably) means between LEAF_OFFSET and FREE_OFFSET; for
0023      * attributes there is no limit.
0024      */
0025     xfs_dablk_t     lowest;
0026     xfs_dablk_t     highest;
0027 
0028     int         tree_level;
0029 };
0030 
0031 typedef int (*xchk_da_btree_rec_fn)(struct xchk_da_btree *ds, int level);
0032 
0033 /* Check for da btree operation errors. */
0034 bool xchk_da_process_error(struct xchk_da_btree *ds, int level, int *error);
0035 
0036 /* Check for da btree corruption. */
0037 void xchk_da_set_corrupt(struct xchk_da_btree *ds, int level);
0038 
0039 int xchk_da_btree_hash(struct xchk_da_btree *ds, int level, __be32 *hashp);
0040 int xchk_da_btree(struct xfs_scrub *sc, int whichfork,
0041         xchk_da_btree_rec_fn scrub_fn, void *private);
0042 
0043 #endif /* __XFS_SCRUB_DABTREE_H__ */