Lines Matching refs:level

32 	int			level,  in xchk_da_process_error()  argument
54 ds->state->path.blk[level].blkno), in xchk_da_process_error()
68 int level) in xchk_da_set_corrupt() argument
76 ds->state->path.blk[level].blkno), in xchk_da_set_corrupt()
84 int level, in xchk_da_btree_entry() argument
92 blk = &ds->state->path.blk[level]; in xchk_da_btree_entry()
120 int level, in xchk_da_btree_hash() argument
130 if (hash < ds->hashes[level]) in xchk_da_btree_hash()
131 xchk_da_set_corrupt(ds, level); in xchk_da_btree_hash()
132 ds->hashes[level] = hash; in xchk_da_btree_hash()
134 if (level == 0) in xchk_da_btree_hash()
139 entry = xchk_da_btree_entry(ds, level - 1, blks[level - 1].index); in xchk_da_btree_hash()
142 xchk_da_set_corrupt(ds, level); in xchk_da_btree_hash()
154 int level, in xchk_da_btree_ptr_ok() argument
158 xchk_da_set_corrupt(ds, level); in xchk_da_btree_ptr_ok()
242 int level, in xchk_da_btree_block_check_sibling() argument
260 xchk_da_set_corrupt(ds, level); in xchk_da_btree_block_check_sibling()
268 if (!xchk_da_process_error(ds, level, &error)) in xchk_da_btree_block_check_sibling()
271 xchk_da_set_corrupt(ds, level); in xchk_da_btree_block_check_sibling()
274 if (ds->state->altpath.blk[level].bp) in xchk_da_btree_block_check_sibling()
276 ds->state->altpath.blk[level].bp); in xchk_da_btree_block_check_sibling()
279 if (ds->state->altpath.blk[level].blkno != sibling) in xchk_da_btree_block_check_sibling()
280 xchk_da_set_corrupt(ds, level); in xchk_da_btree_block_check_sibling()
281 if (ds->state->altpath.blk[level].bp) { in xchk_da_btree_block_check_sibling()
283 ds->state->altpath.blk[level].bp); in xchk_da_btree_block_check_sibling()
284 ds->state->altpath.blk[level].bp = NULL; in xchk_da_btree_block_check_sibling()
294 int level, in xchk_da_btree_block_check_siblings() argument
305 if (level == 0) { in xchk_da_btree_block_check_siblings()
307 xchk_da_set_corrupt(ds, level); in xchk_da_btree_block_check_siblings()
315 error = xchk_da_btree_block_check_sibling(ds, level, 0, back); in xchk_da_btree_block_check_siblings()
318 error = xchk_da_btree_block_check_sibling(ds, level, 1, forw); in xchk_da_btree_block_check_siblings()
329 int level, in xchk_da_btree_block() argument
343 blk = &ds->state->path.blk[level]; in xchk_da_btree_block()
344 ds->state->path.active = level + 1; in xchk_da_btree_block()
354 if (!xchk_da_btree_ptr_ok(ds, level, blkno)) in xchk_da_btree_block()
361 if (!xchk_da_process_error(ds, level, &error)) in xchk_da_btree_block()
371 if (ds->dargs.whichfork == XFS_DATA_FORK && level == 0 && in xchk_da_btree_block()
377 xchk_da_set_corrupt(ds, level); in xchk_da_btree_block()
383 pmaxrecs = &ds->maxrecs[level]; in xchk_da_btree_block()
387 xchk_da_set_corrupt(ds, level); in xchk_da_btree_block()
393 xchk_da_set_corrupt(ds, level); in xchk_da_btree_block()
397 error = xchk_da_btree_block_check_siblings(ds, level, &hdr3->hdr); in xchk_da_btree_block()
410 xchk_da_set_corrupt(ds, level); in xchk_da_btree_block()
419 xchk_da_set_corrupt(ds, level); in xchk_da_btree_block()
428 xchk_da_set_corrupt(ds, level); in xchk_da_btree_block()
440 if (level == 0) { in xchk_da_btree_block()
441 if (nodehdr.level >= XFS_DA_NODE_MAXDEPTH) { in xchk_da_btree_block()
442 xchk_da_set_corrupt(ds, level); in xchk_da_btree_block()
445 ds->tree_level = nodehdr.level; in xchk_da_btree_block()
447 if (ds->tree_level != nodehdr.level) { in xchk_da_btree_block()
448 xchk_da_set_corrupt(ds, level); in xchk_da_btree_block()
456 xchk_da_set_corrupt(ds, level); in xchk_da_btree_block()
484 int level; in xchk_da_btree() local
512 level = 0; in xchk_da_btree()
516 error = xchk_da_btree_block(&ds, level, blkno); in xchk_da_btree()
524 if (blks[level].bp == NULL) in xchk_da_btree()
527 blks[level].index = 0; in xchk_da_btree()
528 while (level >= 0 && level < XFS_DA_NODE_MAXDEPTH) { in xchk_da_btree()
530 if (blks[level].magic != XFS_DA_NODE_MAGIC) { in xchk_da_btree()
532 if (blks[level].index >= ds.maxrecs[level]) { in xchk_da_btree()
533 if (level > 0) in xchk_da_btree()
534 blks[level - 1].index++; in xchk_da_btree()
536 level--; in xchk_da_btree()
541 rec = xchk_da_btree_entry(&ds, level, in xchk_da_btree()
542 blks[level].index); in xchk_da_btree()
543 error = scrub_fn(&ds, level, rec); in xchk_da_btree()
550 blks[level].index++; in xchk_da_btree()
556 if (blks[level].index >= ds.maxrecs[level]) { in xchk_da_btree()
557 if (level > 0) in xchk_da_btree()
558 blks[level - 1].index++; in xchk_da_btree()
560 level--; in xchk_da_btree()
565 key = xchk_da_btree_entry(&ds, level, blks[level].index); in xchk_da_btree()
566 error = xchk_da_btree_hash(&ds, level, &key->hashval); in xchk_da_btree()
572 level++; in xchk_da_btree()
573 if (level >= XFS_DA_NODE_MAXDEPTH) { in xchk_da_btree()
575 xchk_da_set_corrupt(&ds, level - 1); in xchk_da_btree()
579 error = xchk_da_btree_block(&ds, level, blkno); in xchk_da_btree()
582 if (blks[level].bp == NULL) in xchk_da_btree()
585 blks[level].index = 0; in xchk_da_btree()
590 for (level = 0; level < XFS_DA_NODE_MAXDEPTH; level++) { in xchk_da_btree()
591 if (blks[level].bp == NULL) in xchk_da_btree()
593 xfs_trans_brelse(sc->tp, blks[level].bp); in xchk_da_btree()
594 blks[level].bp = NULL; in xchk_da_btree()