Lines Matching full:level
32 int level, in xchk_da_process_error() argument
55 ds->state->path.blk[level].blkno), in xchk_da_process_error()
69 int level) in xchk_da_set_corrupt() argument
77 ds->state->path.blk[level].blkno), in xchk_da_set_corrupt()
85 int level) in xchk_da_set_preen() argument
92 ds->state->path.blk[level].blkno), in xchk_da_set_preen()
96 /* Find an entry at a certain level in a da btree. */
100 int level) in xchk_da_btree_node_entry() argument
102 struct xfs_da_state_blk *blk = &ds->state->path.blk[level]; in xchk_da_btree_node_entry()
115 int level, in xchk_da_btree_hash() argument
124 if (hash < ds->hashes[level]) in xchk_da_btree_hash()
125 xchk_da_set_corrupt(ds, level); in xchk_da_btree_hash()
126 ds->hashes[level] = hash; in xchk_da_btree_hash()
128 if (level == 0) in xchk_da_btree_hash()
132 entry = xchk_da_btree_node_entry(ds, level - 1); in xchk_da_btree_hash()
135 xchk_da_set_corrupt(ds, level); in xchk_da_btree_hash()
147 int level, in xchk_da_btree_ptr_ok() argument
151 xchk_da_set_corrupt(ds, level); in xchk_da_btree_ptr_ok()
235 int level, in xchk_da_btree_block_check_sibling() argument
249 * level pointer anywhere. in xchk_da_btree_block_check_sibling()
255 xchk_da_set_corrupt(ds, level); in xchk_da_btree_block_check_sibling()
263 if (!xchk_da_process_error(ds, level, &error)) in xchk_da_btree_block_check_sibling()
266 xchk_da_set_corrupt(ds, level); in xchk_da_btree_block_check_sibling()
269 if (altpath->blk[level].bp) in xchk_da_btree_block_check_sibling()
270 xchk_buffer_recheck(ds->sc, altpath->blk[level].bp); in xchk_da_btree_block_check_sibling()
272 /* Compare upper level pointer to sibling pointer. */ in xchk_da_btree_block_check_sibling()
273 if (altpath->blk[level].blkno != sibling) in xchk_da_btree_block_check_sibling()
274 xchk_da_set_corrupt(ds, level); in xchk_da_btree_block_check_sibling()
295 int level, in xchk_da_btree_block_check_siblings() argument
305 /* Top level blocks should not have sibling pointers. */ in xchk_da_btree_block_check_siblings()
306 if (level == 0) { in xchk_da_btree_block_check_siblings()
308 xchk_da_set_corrupt(ds, level); in xchk_da_btree_block_check_siblings()
316 error = xchk_da_btree_block_check_sibling(ds, level, 0, back); in xchk_da_btree_block_check_siblings()
319 error = xchk_da_btree_block_check_sibling(ds, level, 1, forw); in xchk_da_btree_block_check_siblings()
330 int level, in xchk_da_btree_block() argument
345 blk = &ds->state->path.blk[level]; in xchk_da_btree_block()
346 ds->state->path.active = level + 1; in xchk_da_btree_block()
356 if (!xchk_da_btree_ptr_ok(ds, level, blkno)) in xchk_da_btree_block()
363 if (!xchk_da_process_error(ds, level, &error)) in xchk_da_btree_block()
373 if (ds->dargs.whichfork == XFS_DATA_FORK && level == 0 && in xchk_da_btree_block()
379 xchk_da_set_corrupt(ds, level); in xchk_da_btree_block()
385 pmaxrecs = &ds->maxrecs[level]; in xchk_da_btree_block()
389 xchk_da_set_corrupt(ds, level); in xchk_da_btree_block()
395 xchk_da_set_corrupt(ds, level); in xchk_da_btree_block()
399 error = xchk_da_btree_block_check_siblings(ds, level, &hdr3->hdr); in xchk_da_btree_block()
412 xchk_da_set_corrupt(ds, level); in xchk_da_btree_block()
421 xchk_da_set_corrupt(ds, level); in xchk_da_btree_block()
430 xchk_da_set_corrupt(ds, level); in xchk_da_btree_block()
442 if (level == 0) { in xchk_da_btree_block()
443 if (nodehdr.level >= XFS_DA_NODE_MAXDEPTH) { in xchk_da_btree_block()
444 xchk_da_set_corrupt(ds, level); in xchk_da_btree_block()
447 ds->tree_level = nodehdr.level; in xchk_da_btree_block()
449 if (ds->tree_level != nodehdr.level) { in xchk_da_btree_block()
450 xchk_da_set_corrupt(ds, level); in xchk_da_btree_block()
458 xchk_da_set_corrupt(ds, level); in xchk_da_btree_block()
464 xchk_da_set_corrupt(ds, level); in xchk_da_btree_block()
472 if (level > 0) { in xchk_da_btree_block()
475 key = xchk_da_btree_node_entry(ds, level - 1); in xchk_da_btree_block()
477 xchk_da_set_corrupt(ds, level); in xchk_da_btree_block()
505 int level; in xchk_da_btree() local
534 level = 0; in xchk_da_btree()
538 error = xchk_da_btree_block(ds, level, blkno); in xchk_da_btree()
546 if (blks[level].bp == NULL) in xchk_da_btree()
549 blks[level].index = 0; in xchk_da_btree()
550 while (level >= 0 && level < XFS_DA_NODE_MAXDEPTH) { in xchk_da_btree()
552 if (blks[level].magic != XFS_DA_NODE_MAGIC) { in xchk_da_btree()
554 if (blks[level].index >= ds->maxrecs[level]) { in xchk_da_btree()
555 if (level > 0) in xchk_da_btree()
556 blks[level - 1].index++; in xchk_da_btree()
558 level--; in xchk_da_btree()
563 error = scrub_fn(ds, level); in xchk_da_btree()
570 blks[level].index++; in xchk_da_btree()
576 if (blks[level].index >= ds->maxrecs[level]) { in xchk_da_btree()
577 if (level > 0) in xchk_da_btree()
578 blks[level - 1].index++; in xchk_da_btree()
580 level--; in xchk_da_btree()
585 key = xchk_da_btree_node_entry(ds, level); in xchk_da_btree()
586 error = xchk_da_btree_hash(ds, level, &key->hashval); in xchk_da_btree()
590 /* Drill another level deeper. */ in xchk_da_btree()
592 level++; in xchk_da_btree()
593 if (level >= XFS_DA_NODE_MAXDEPTH) { in xchk_da_btree()
595 xchk_da_set_corrupt(ds, level - 1); in xchk_da_btree()
599 error = xchk_da_btree_block(ds, level, blkno); in xchk_da_btree()
602 if (blks[level].bp == NULL) in xchk_da_btree()
605 blks[level].index = 0; in xchk_da_btree()
610 for (level = 0; level < XFS_DA_NODE_MAXDEPTH; level++) { in xchk_da_btree()
611 if (blks[level].bp == NULL) in xchk_da_btree()
613 xfs_trans_brelse(sc->tp, blks[level].bp); in xchk_da_btree()
614 blks[level].bp = NULL; in xchk_da_btree()