Lines Matching refs:level
40 int level, in xchk_da_process_error() argument
62 ds->state->path.blk[level].blkno), in xchk_da_process_error()
76 int level) in xchk_da_set_corrupt() argument
84 ds->state->path.blk[level].blkno), in xchk_da_set_corrupt()
92 int level, in xchk_da_btree_entry() argument
100 blk = &ds->state->path.blk[level]; in xchk_da_btree_entry()
128 int level, in xchk_da_btree_hash() argument
138 if (hash < ds->hashes[level]) in xchk_da_btree_hash()
139 xchk_da_set_corrupt(ds, level); in xchk_da_btree_hash()
140 ds->hashes[level] = hash; in xchk_da_btree_hash()
142 if (level == 0) in xchk_da_btree_hash()
147 entry = xchk_da_btree_entry(ds, level - 1, blks[level - 1].index); in xchk_da_btree_hash()
150 xchk_da_set_corrupt(ds, level); in xchk_da_btree_hash()
162 int level, in xchk_da_btree_ptr_ok() argument
166 xchk_da_set_corrupt(ds, level); in xchk_da_btree_ptr_ok()
250 int level, in xchk_da_btree_block_check_sibling() argument
268 xchk_da_set_corrupt(ds, level); in xchk_da_btree_block_check_sibling()
276 if (!xchk_da_process_error(ds, level, &error)) in xchk_da_btree_block_check_sibling()
279 xchk_da_set_corrupt(ds, level); in xchk_da_btree_block_check_sibling()
282 if (ds->state->altpath.blk[level].bp) in xchk_da_btree_block_check_sibling()
284 ds->state->altpath.blk[level].bp); in xchk_da_btree_block_check_sibling()
287 if (ds->state->altpath.blk[level].blkno != sibling) in xchk_da_btree_block_check_sibling()
288 xchk_da_set_corrupt(ds, level); in xchk_da_btree_block_check_sibling()
289 xfs_trans_brelse(ds->dargs.trans, ds->state->altpath.blk[level].bp); in xchk_da_btree_block_check_sibling()
298 int level, in xchk_da_btree_block_check_siblings() argument
309 if (level == 0) { in xchk_da_btree_block_check_siblings()
311 xchk_da_set_corrupt(ds, level); in xchk_da_btree_block_check_siblings()
319 error = xchk_da_btree_block_check_sibling(ds, level, 0, back); in xchk_da_btree_block_check_siblings()
322 error = xchk_da_btree_block_check_sibling(ds, level, 1, forw); in xchk_da_btree_block_check_siblings()
333 int level, in xchk_da_btree_block() argument
347 blk = &ds->state->path.blk[level]; in xchk_da_btree_block()
348 ds->state->path.active = level + 1; in xchk_da_btree_block()
358 if (!xchk_da_btree_ptr_ok(ds, level, blkno)) in xchk_da_btree_block()
365 if (!xchk_da_process_error(ds, level, &error)) in xchk_da_btree_block()
375 if (ds->dargs.whichfork == XFS_DATA_FORK && level == 0 && in xchk_da_btree_block()
381 xchk_da_set_corrupt(ds, level); in xchk_da_btree_block()
387 pmaxrecs = &ds->maxrecs[level]; in xchk_da_btree_block()
391 xchk_da_set_corrupt(ds, level); in xchk_da_btree_block()
397 xchk_da_set_corrupt(ds, level); in xchk_da_btree_block()
401 error = xchk_da_btree_block_check_siblings(ds, level, &hdr3->hdr); in xchk_da_btree_block()
414 xchk_da_set_corrupt(ds, level); in xchk_da_btree_block()
423 xchk_da_set_corrupt(ds, level); in xchk_da_btree_block()
432 xchk_da_set_corrupt(ds, level); in xchk_da_btree_block()
444 if (level == 0) { in xchk_da_btree_block()
445 if (nodehdr.level >= XFS_DA_NODE_MAXDEPTH) { in xchk_da_btree_block()
446 xchk_da_set_corrupt(ds, level); in xchk_da_btree_block()
449 ds->tree_level = nodehdr.level; in xchk_da_btree_block()
451 if (ds->tree_level != nodehdr.level) { in xchk_da_btree_block()
452 xchk_da_set_corrupt(ds, level); in xchk_da_btree_block()
460 xchk_da_set_corrupt(ds, level); in xchk_da_btree_block()
488 int level; in xchk_da_btree() local
516 level = 0; in xchk_da_btree()
520 error = xchk_da_btree_block(&ds, level, blkno); in xchk_da_btree()
528 if (blks[level].bp == NULL) in xchk_da_btree()
531 blks[level].index = 0; in xchk_da_btree()
532 while (level >= 0 && level < XFS_DA_NODE_MAXDEPTH) { in xchk_da_btree()
534 if (blks[level].magic != XFS_DA_NODE_MAGIC) { in xchk_da_btree()
536 if (blks[level].index >= ds.maxrecs[level]) { in xchk_da_btree()
537 if (level > 0) in xchk_da_btree()
538 blks[level - 1].index++; in xchk_da_btree()
540 level--; in xchk_da_btree()
545 rec = xchk_da_btree_entry(&ds, level, in xchk_da_btree()
546 blks[level].index); in xchk_da_btree()
547 error = scrub_fn(&ds, level, rec); in xchk_da_btree()
554 blks[level].index++; in xchk_da_btree()
560 if (blks[level].index >= ds.maxrecs[level]) { in xchk_da_btree()
561 if (level > 0) in xchk_da_btree()
562 blks[level - 1].index++; in xchk_da_btree()
564 level--; in xchk_da_btree()
569 key = xchk_da_btree_entry(&ds, level, blks[level].index); in xchk_da_btree()
570 error = xchk_da_btree_hash(&ds, level, &key->hashval); in xchk_da_btree()
576 level++; in xchk_da_btree()
578 error = xchk_da_btree_block(&ds, level, blkno); in xchk_da_btree()
581 if (blks[level].bp == NULL) in xchk_da_btree()
584 blks[level].index = 0; in xchk_da_btree()
589 for (level = 0; level < XFS_DA_NODE_MAXDEPTH; level++) { in xchk_da_btree()
590 if (blks[level].bp == NULL) in xchk_da_btree()
592 xfs_trans_brelse(sc->tp, blks[level].bp); in xchk_da_btree()
593 blks[level].bp = NULL; in xchk_da_btree()