Lines Matching full:level
29 int level, in __xchk_btree_process_error() argument
51 trace_xchk_ifork_btree_op_error(sc, cur, level, in __xchk_btree_process_error()
54 trace_xchk_btree_op_error(sc, cur, level, in __xchk_btree_process_error()
65 int level, in xchk_btree_process_error() argument
68 return __xchk_btree_process_error(sc, cur, level, error, in xchk_btree_process_error()
76 int level, in xchk_btree_xref_process_error() argument
79 return __xchk_btree_process_error(sc, cur, level, error, in xchk_btree_xref_process_error()
88 int level, in __xchk_btree_set_corrupt() argument
95 trace_xchk_ifork_btree_error(sc, cur, level, in __xchk_btree_set_corrupt()
98 trace_xchk_btree_error(sc, cur, level, in __xchk_btree_set_corrupt()
106 int level) in xchk_btree_set_corrupt() argument
108 __xchk_btree_set_corrupt(sc, cur, level, XFS_SCRUB_OFLAG_CORRUPT, in xchk_btree_set_corrupt()
116 int level) in xchk_btree_xref_set_corrupt() argument
118 __xchk_btree_set_corrupt(sc, cur, level, XFS_SCRUB_OFLAG_XCORRUPT, in xchk_btree_xref_set_corrupt()
126 int level) in xchk_btree_set_preen() argument
128 __xchk_btree_set_corrupt(sc, cur, level, XFS_SCRUB_OFLAG_PREEN, in xchk_btree_set_preen()
188 int level) in xchk_btree_key() argument
197 block = xfs_btree_get_block(cur, level, &bp); in xchk_btree_key()
198 key = xfs_btree_key_addr(cur, cur->bc_levels[level].ptr, block); in xchk_btree_key()
200 trace_xchk_btree_key(bs->sc, cur, level); in xchk_btree_key()
203 if (bs->lastkey[level - 1].valid && in xchk_btree_key()
204 !cur->bc_ops->keys_inorder(cur, &bs->lastkey[level - 1].key, key)) in xchk_btree_key()
205 xchk_btree_set_corrupt(bs->sc, cur, level); in xchk_btree_key()
206 memcpy(&bs->lastkey[level - 1].key, key, cur->bc_ops->key_len); in xchk_btree_key()
207 bs->lastkey[level - 1].valid = true; in xchk_btree_key()
209 if (level + 1 >= cur->bc_nlevels) in xchk_btree_key()
213 keyblock = xfs_btree_get_block(cur, level + 1, &bp); in xchk_btree_key()
214 keyp = xfs_btree_key_addr(cur, cur->bc_levels[level + 1].ptr, keyblock); in xchk_btree_key()
216 xchk_btree_set_corrupt(bs->sc, cur, level); in xchk_btree_key()
222 key = xfs_btree_high_key_addr(cur, cur->bc_levels[level].ptr, block); in xchk_btree_key()
223 keyp = xfs_btree_high_key_addr(cur, cur->bc_levels[level + 1].ptr, in xchk_btree_key()
226 xchk_btree_set_corrupt(bs->sc, cur, level); in xchk_btree_key()
236 int level, in xchk_btree_ptr_ok() argument
241 level == bs->cur->bc_nlevels) in xchk_btree_ptr_ok()
245 if (__xfs_btree_check_ptr(bs->cur, ptr, 0, level)) { in xchk_btree_ptr_ok()
246 xchk_btree_set_corrupt(bs->sc, bs->cur, level); in xchk_btree_ptr_ok()
257 int level, in xchk_btree_block_check_sibling() argument
270 if (!xchk_btree_process_error(bs->sc, cur, level + 1, &error) || in xchk_btree_block_check_sibling()
276 * level pointer anywhere. in xchk_btree_block_check_sibling()
280 error = xfs_btree_increment(ncur, level + 1, &success); in xchk_btree_block_check_sibling()
282 error = xfs_btree_decrement(ncur, level + 1, &success); in xchk_btree_block_check_sibling()
284 xchk_btree_set_corrupt(bs->sc, cur, level); in xchk_btree_block_check_sibling()
289 /* Increment upper level pointer. */ in xchk_btree_block_check_sibling()
291 error = xfs_btree_increment(ncur, level + 1, &success); in xchk_btree_block_check_sibling()
293 error = xfs_btree_decrement(ncur, level + 1, &success); in xchk_btree_block_check_sibling()
294 if (!xchk_btree_process_error(bs->sc, cur, level + 1, &error)) in xchk_btree_block_check_sibling()
297 xchk_btree_set_corrupt(bs->sc, cur, level + 1); in xchk_btree_block_check_sibling()
301 /* Compare upper level pointer to sibling pointer. */ in xchk_btree_block_check_sibling()
302 pblock = xfs_btree_get_block(ncur, level + 1, &pbp); in xchk_btree_block_check_sibling()
303 pp = xfs_btree_ptr_addr(ncur, ncur->bc_levels[level + 1].ptr, pblock); in xchk_btree_block_check_sibling()
304 if (!xchk_btree_ptr_ok(bs, level + 1, pp)) in xchk_btree_block_check_sibling()
310 xchk_btree_set_corrupt(bs->sc, cur, level); in xchk_btree_block_check_sibling()
325 int level; in xchk_btree_block_check_siblings() local
330 level = xfs_btree_get_level(block); in xchk_btree_block_check_siblings()
333 if (level == cur->bc_nlevels - 1) { in xchk_btree_block_check_siblings()
336 xchk_btree_set_corrupt(bs->sc, cur, level); in xchk_btree_block_check_siblings()
342 * parent level pointers? in xchk_btree_block_check_siblings()
345 error = xchk_btree_block_check_sibling(bs, level, -1, &leftsib); in xchk_btree_block_check_siblings()
348 error = xchk_btree_block_check_sibling(bs, level, 1, &rightsib); in xchk_btree_block_check_siblings()
358 int level; member
368 int level, in xchk_btree_check_block_owner() argument
391 level, &error)) in xchk_btree_check_block_owner()
419 int level, in xchk_btree_check_owner() argument
432 xchk_btree_set_corrupt(bs->sc, bs->cur, level); in xchk_btree_check_owner()
452 co->level = level; in xchk_btree_check_owner()
458 return xchk_btree_check_block_owner(bs, level, xfs_buf_daddr(bp)); in xchk_btree_check_owner()
492 int level, in xchk_btree_check_minrecs() argument
500 if (numrecs >= cur->bc_ops->get_minrecs(cur, level)) in xchk_btree_check_minrecs()
511 level == cur->bc_nlevels - 2) { in xchk_btree_check_minrecs()
521 xchk_btree_set_corrupt(bs->sc, cur, level); in xchk_btree_check_minrecs()
526 * Otherwise, only the root level is allowed to have fewer than minrecs in xchk_btree_check_minrecs()
529 if (level < root_level) in xchk_btree_check_minrecs()
530 xchk_btree_set_corrupt(bs->sc, cur, level); in xchk_btree_check_minrecs()
540 int level, in xchk_btree_block_check_keys() argument
550 if (level == cur->bc_nlevels - 1) in xchk_btree_block_check_keys()
556 parent_block = xfs_btree_get_block(cur, level + 1, &bp); in xchk_btree_block_check_keys()
557 parent_low_key = xfs_btree_key_addr(cur, cur->bc_levels[level + 1].ptr, in xchk_btree_block_check_keys()
560 xchk_btree_set_corrupt(bs->sc, bs->cur, level); in xchk_btree_block_check_keys()
569 cur->bc_levels[level + 1].ptr, parent_block); in xchk_btree_block_check_keys()
572 xchk_btree_set_corrupt(bs->sc, bs->cur, level); in xchk_btree_block_check_keys()
582 int level, in xchk_btree_get_block() argument
592 error = xfs_btree_lookup_get_block(bs->cur, level, pp, pblock); in xchk_btree_get_block()
593 if (!xchk_btree_process_error(bs->sc, bs->cur, level, &error) || in xchk_btree_get_block()
597 xfs_btree_get_block(bs->cur, level, pbp); in xchk_btree_get_block()
598 if (__xfs_btree_check_block(bs->cur, *pblock, level, *pbp)) { in xchk_btree_get_block()
599 xchk_btree_set_corrupt(bs->sc, bs->cur, level); in xchk_btree_get_block()
605 xchk_btree_check_minrecs(bs, level, *pblock); in xchk_btree_get_block()
611 error = xchk_btree_check_owner(bs, level, *pbp); in xchk_btree_get_block()
623 xchk_btree_block_check_keys(bs, level, *pblock); in xchk_btree_get_block()
634 int level, in xchk_btree_block_keys() argument
645 if (level >= cur->bc_nlevels - 1) in xchk_btree_block_keys()
652 parent_block = xfs_btree_get_block(cur, level + 1, &bp); in xchk_btree_block_keys()
653 parent_keys = xfs_btree_key_addr(cur, cur->bc_levels[level + 1].ptr, in xchk_btree_block_keys()
664 high_pk = xfs_btree_high_key_addr(cur, cur->bc_levels[level + 1].ptr, in xchk_btree_block_keys()
693 int level; in xchk_btree() local
722 level = cur->bc_nlevels - 1; in xchk_btree()
726 error = xchk_btree_get_block(bs, level, &ptr, &block, &bp); in xchk_btree()
730 cur->bc_levels[level].ptr = 1; in xchk_btree()
732 while (level < cur->bc_nlevels) { in xchk_btree()
733 block = xfs_btree_get_block(cur, level, &bp); in xchk_btree()
735 if (level == 0) { in xchk_btree()
737 if (cur->bc_levels[level].ptr > in xchk_btree()
739 xchk_btree_block_keys(bs, level, block); in xchk_btree()
740 if (level < cur->bc_nlevels - 1) in xchk_btree()
741 cur->bc_levels[level + 1].ptr++; in xchk_btree()
742 level++; in xchk_btree()
759 cur->bc_levels[level].ptr++; in xchk_btree()
764 if (cur->bc_levels[level].ptr > in xchk_btree()
766 xchk_btree_block_keys(bs, level, block); in xchk_btree()
767 if (level < cur->bc_nlevels - 1) in xchk_btree()
768 cur->bc_levels[level + 1].ptr++; in xchk_btree()
769 level++; in xchk_btree()
774 xchk_btree_key(bs, level); in xchk_btree()
776 /* Drill another level deeper. */ in xchk_btree()
777 pp = xfs_btree_ptr_addr(cur, cur->bc_levels[level].ptr, block); in xchk_btree()
778 if (!xchk_btree_ptr_ok(bs, level, pp)) { in xchk_btree()
779 cur->bc_levels[level].ptr++; in xchk_btree()
782 level--; in xchk_btree()
783 error = xchk_btree_get_block(bs, level, pp, &block, &bp); in xchk_btree()
787 cur->bc_levels[level].ptr = 1; in xchk_btree()
794 error = xchk_btree_check_block_owner(bs, co->level, in xchk_btree()