Lines Matching refs:sc

26 	struct xfs_scrub	*sc,  in xchk_superblock_xref()  argument
29 struct xfs_mount *mp = sc->mp; in xchk_superblock_xref()
30 xfs_agnumber_t agno = sc->sm->sm_agno; in xchk_superblock_xref()
34 if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT) in xchk_superblock_xref()
39 error = xchk_ag_init_existing(sc, agno, &sc->sa); in xchk_superblock_xref()
40 if (!xchk_xref_process_error(sc, agno, agbno, &error)) in xchk_superblock_xref()
43 xchk_xref_is_used_space(sc, agbno, 1); in xchk_superblock_xref()
44 xchk_xref_is_not_inode_chunk(sc, agbno, 1); in xchk_superblock_xref()
45 xchk_xref_is_owned_by(sc, agbno, 1, &XFS_RMAP_OINFO_FS); in xchk_superblock_xref()
46 xchk_xref_is_not_shared(sc, agbno, 1); in xchk_superblock_xref()
61 struct xfs_scrub *sc) in xchk_superblock() argument
63 struct xfs_mount *mp = sc->mp; in xchk_superblock()
73 agno = sc->sm->sm_agno; in xchk_superblock()
86 error = xfs_sb_read_secondary(mp, sc->tp, agno, &bp); in xchk_superblock()
104 if (!xchk_process_error(sc, agno, XFS_SB_BLOCK(mp), &error)) in xchk_superblock()
116 xchk_block_set_corrupt(sc, bp); in xchk_superblock()
119 xchk_block_set_corrupt(sc, bp); in xchk_superblock()
122 xchk_block_set_corrupt(sc, bp); in xchk_superblock()
125 xchk_block_set_corrupt(sc, bp); in xchk_superblock()
128 xchk_block_set_preen(sc, bp); in xchk_superblock()
131 xchk_block_set_corrupt(sc, bp); in xchk_superblock()
134 xchk_block_set_preen(sc, bp); in xchk_superblock()
137 xchk_block_set_preen(sc, bp); in xchk_superblock()
140 xchk_block_set_preen(sc, bp); in xchk_superblock()
143 xchk_block_set_corrupt(sc, bp); in xchk_superblock()
146 xchk_block_set_corrupt(sc, bp); in xchk_superblock()
149 xchk_block_set_corrupt(sc, bp); in xchk_superblock()
152 xchk_block_set_corrupt(sc, bp); in xchk_superblock()
155 xchk_block_set_corrupt(sc, bp); in xchk_superblock()
169 xchk_block_set_corrupt(sc, bp); in xchk_superblock()
177 xchk_block_set_preen(sc, bp); in xchk_superblock()
180 xchk_block_set_corrupt(sc, bp); in xchk_superblock()
183 xchk_block_set_corrupt(sc, bp); in xchk_superblock()
186 xchk_block_set_corrupt(sc, bp); in xchk_superblock()
189 xchk_block_set_preen(sc, bp); in xchk_superblock()
192 xchk_block_set_corrupt(sc, bp); in xchk_superblock()
195 xchk_block_set_corrupt(sc, bp); in xchk_superblock()
198 xchk_block_set_corrupt(sc, bp); in xchk_superblock()
201 xchk_block_set_corrupt(sc, bp); in xchk_superblock()
204 xchk_block_set_corrupt(sc, bp); in xchk_superblock()
207 xchk_block_set_corrupt(sc, bp); in xchk_superblock()
210 xchk_block_set_preen(sc, bp); in xchk_superblock()
218 xchk_block_set_preen(sc, bp); in xchk_superblock()
221 xchk_block_set_preen(sc, bp); in xchk_superblock()
229 xchk_block_set_corrupt(sc, bp); in xchk_superblock()
232 xchk_block_set_corrupt(sc, bp); in xchk_superblock()
235 xchk_block_set_corrupt(sc, bp); in xchk_superblock()
238 xchk_block_set_preen(sc, bp); in xchk_superblock()
241 xchk_block_set_preen(sc, bp); in xchk_superblock()
244 xchk_block_set_corrupt(sc, bp); in xchk_superblock()
247 xchk_block_set_corrupt(sc, bp); in xchk_superblock()
250 xchk_block_set_corrupt(sc, bp); in xchk_superblock()
253 xchk_block_set_corrupt(sc, bp); in xchk_superblock()
258 xchk_block_set_corrupt(sc, bp); in xchk_superblock()
265 xchk_block_set_corrupt(sc, bp); in xchk_superblock()
268 xchk_block_set_preen(sc, bp); in xchk_superblock()
278 xchk_block_set_corrupt(sc, bp); in xchk_superblock()
284 xchk_block_set_corrupt(sc, bp); in xchk_superblock()
291 xchk_block_set_corrupt(sc, bp); in xchk_superblock()
297 xchk_block_set_corrupt(sc, bp); in xchk_superblock()
307 xchk_block_set_corrupt(sc, bp); in xchk_superblock()
317 xchk_block_set_corrupt(sc, bp); in xchk_superblock()
324 xchk_block_set_corrupt(sc, bp); in xchk_superblock()
329 xchk_block_set_corrupt(sc, bp); in xchk_superblock()
332 xchk_block_set_preen(sc, bp); in xchk_superblock()
340 xchk_block_set_corrupt(sc, bp); in xchk_superblock()
346 xchk_block_set_corrupt(sc, bp); in xchk_superblock()
348 xchk_superblock_xref(sc, bp); in xchk_superblock()
372 struct xfs_scrub *sc) in xchk_agf_xref_freeblks() argument
374 struct xfs_agf *agf = sc->sa.agf_bp->b_addr; in xchk_agf_xref_freeblks()
378 if (!sc->sa.bno_cur) in xchk_agf_xref_freeblks()
381 error = xfs_alloc_query_all(sc->sa.bno_cur, in xchk_agf_xref_freeblks()
383 if (!xchk_should_check_xref(sc, &error, &sc->sa.bno_cur)) in xchk_agf_xref_freeblks()
386 xchk_block_xref_set_corrupt(sc, sc->sa.agf_bp); in xchk_agf_xref_freeblks()
392 struct xfs_scrub *sc) in xchk_agf_xref_cntbt() argument
394 struct xfs_agf *agf = sc->sa.agf_bp->b_addr; in xchk_agf_xref_cntbt()
400 if (!sc->sa.cnt_cur) in xchk_agf_xref_cntbt()
404 error = xfs_alloc_lookup_le(sc->sa.cnt_cur, 0, -1U, &have); in xchk_agf_xref_cntbt()
405 if (!xchk_should_check_xref(sc, &error, &sc->sa.cnt_cur)) in xchk_agf_xref_cntbt()
409 xchk_block_xref_set_corrupt(sc, sc->sa.agf_bp); in xchk_agf_xref_cntbt()
414 error = xfs_alloc_get_rec(sc->sa.cnt_cur, &agbno, &blocks, &have); in xchk_agf_xref_cntbt()
415 if (!xchk_should_check_xref(sc, &error, &sc->sa.cnt_cur)) in xchk_agf_xref_cntbt()
418 xchk_block_xref_set_corrupt(sc, sc->sa.agf_bp); in xchk_agf_xref_cntbt()
424 struct xfs_scrub *sc) in xchk_agf_xref_btreeblks() argument
426 struct xfs_agf *agf = sc->sa.agf_bp->b_addr; in xchk_agf_xref_btreeblks()
427 struct xfs_mount *mp = sc->mp; in xchk_agf_xref_btreeblks()
433 if (!xfs_has_lazysbcount(sc->mp)) in xchk_agf_xref_btreeblks()
437 if (sc->sa.rmap_cur) { in xchk_agf_xref_btreeblks()
438 error = xfs_btree_count_blocks(sc->sa.rmap_cur, &blocks); in xchk_agf_xref_btreeblks()
439 if (!xchk_should_check_xref(sc, &error, &sc->sa.rmap_cur)) in xchk_agf_xref_btreeblks()
443 xchk_block_xref_set_corrupt(sc, sc->sa.agf_bp); in xchk_agf_xref_btreeblks()
452 if ((xfs_has_rmapbt(mp) && !sc->sa.rmap_cur) || in xchk_agf_xref_btreeblks()
453 !sc->sa.bno_cur || !sc->sa.cnt_cur) in xchk_agf_xref_btreeblks()
457 error = xfs_btree_count_blocks(sc->sa.bno_cur, &blocks); in xchk_agf_xref_btreeblks()
458 if (!xchk_should_check_xref(sc, &error, &sc->sa.bno_cur)) in xchk_agf_xref_btreeblks()
462 error = xfs_btree_count_blocks(sc->sa.cnt_cur, &blocks); in xchk_agf_xref_btreeblks()
463 if (!xchk_should_check_xref(sc, &error, &sc->sa.cnt_cur)) in xchk_agf_xref_btreeblks()
468 xchk_block_xref_set_corrupt(sc, sc->sa.agf_bp); in xchk_agf_xref_btreeblks()
474 struct xfs_scrub *sc) in xchk_agf_xref_refcblks() argument
476 struct xfs_agf *agf = sc->sa.agf_bp->b_addr; in xchk_agf_xref_refcblks()
480 if (!sc->sa.refc_cur) in xchk_agf_xref_refcblks()
483 error = xfs_btree_count_blocks(sc->sa.refc_cur, &blocks); in xchk_agf_xref_refcblks()
484 if (!xchk_should_check_xref(sc, &error, &sc->sa.refc_cur)) in xchk_agf_xref_refcblks()
487 xchk_block_xref_set_corrupt(sc, sc->sa.agf_bp); in xchk_agf_xref_refcblks()
493 struct xfs_scrub *sc) in xchk_agf_xref() argument
495 struct xfs_mount *mp = sc->mp; in xchk_agf_xref()
498 if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT) in xchk_agf_xref()
503 xchk_ag_btcur_init(sc, &sc->sa); in xchk_agf_xref()
505 xchk_xref_is_used_space(sc, agbno, 1); in xchk_agf_xref()
506 xchk_agf_xref_freeblks(sc); in xchk_agf_xref()
507 xchk_agf_xref_cntbt(sc); in xchk_agf_xref()
508 xchk_xref_is_not_inode_chunk(sc, agbno, 1); in xchk_agf_xref()
509 xchk_xref_is_owned_by(sc, agbno, 1, &XFS_RMAP_OINFO_FS); in xchk_agf_xref()
510 xchk_agf_xref_btreeblks(sc); in xchk_agf_xref()
511 xchk_xref_is_not_shared(sc, agbno, 1); in xchk_agf_xref()
512 xchk_agf_xref_refcblks(sc); in xchk_agf_xref()
520 struct xfs_scrub *sc) in xchk_agf() argument
522 struct xfs_mount *mp = sc->mp; in xchk_agf()
525 xfs_agnumber_t agno = sc->sm->sm_agno; in xchk_agf()
535 error = xchk_ag_read_headers(sc, agno, &sc->sa); in xchk_agf()
536 if (!xchk_process_error(sc, agno, XFS_AGF_BLOCK(sc->mp), &error)) in xchk_agf()
538 xchk_buffer_recheck(sc, sc->sa.agf_bp); in xchk_agf()
540 agf = sc->sa.agf_bp->b_addr; in xchk_agf()
541 pag = sc->sa.pag; in xchk_agf()
546 xchk_block_set_corrupt(sc, sc->sa.agf_bp); in xchk_agf()
551 xchk_block_set_corrupt(sc, sc->sa.agf_bp); in xchk_agf()
555 xchk_block_set_corrupt(sc, sc->sa.agf_bp); in xchk_agf()
559 xchk_block_set_corrupt(sc, sc->sa.agf_bp); in xchk_agf()
563 xchk_block_set_corrupt(sc, sc->sa.agf_bp); in xchk_agf()
568 xchk_block_set_corrupt(sc, sc->sa.agf_bp); in xchk_agf()
572 xchk_block_set_corrupt(sc, sc->sa.agf_bp); in xchk_agf()
578 xchk_block_set_corrupt(sc, sc->sa.agf_bp); in xchk_agf()
582 xchk_block_set_corrupt(sc, sc->sa.agf_bp); in xchk_agf()
594 xchk_block_set_corrupt(sc, sc->sa.agf_bp); in xchk_agf()
598 xchk_block_set_corrupt(sc, sc->sa.agf_bp); in xchk_agf()
600 xchk_block_set_corrupt(sc, sc->sa.agf_bp); in xchk_agf()
601 if (xfs_has_lazysbcount(sc->mp) && in xchk_agf()
603 xchk_block_set_corrupt(sc, sc->sa.agf_bp); in xchk_agf()
605 xchk_agf_xref(sc); in xchk_agf()
616 struct xfs_scrub *sc; member
622 struct xfs_scrub *sc, in xchk_agfl_block_xref() argument
625 if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT) in xchk_agfl_block_xref()
628 xchk_xref_is_used_space(sc, agbno, 1); in xchk_agfl_block_xref()
629 xchk_xref_is_not_inode_chunk(sc, agbno, 1); in xchk_agfl_block_xref()
630 xchk_xref_is_owned_by(sc, agbno, 1, &XFS_RMAP_OINFO_AG); in xchk_agfl_block_xref()
631 xchk_xref_is_not_shared(sc, agbno, 1); in xchk_agfl_block_xref()
642 struct xfs_scrub *sc = sai->sc; in xchk_agfl_block() local
643 xfs_agnumber_t agno = sc->sa.pag->pag_agno; in xchk_agfl_block()
649 xchk_block_set_corrupt(sc, sc->sa.agfl_bp); in xchk_agfl_block()
651 xchk_agfl_block_xref(sc, agbno); in xchk_agfl_block()
653 if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT) in xchk_agfl_block()
673 struct xfs_scrub *sc) in xchk_agfl_xref() argument
675 struct xfs_mount *mp = sc->mp; in xchk_agfl_xref()
678 if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT) in xchk_agfl_xref()
683 xchk_ag_btcur_init(sc, &sc->sa); in xchk_agfl_xref()
685 xchk_xref_is_used_space(sc, agbno, 1); in xchk_agfl_xref()
686 xchk_xref_is_not_inode_chunk(sc, agbno, 1); in xchk_agfl_xref()
687 xchk_xref_is_owned_by(sc, agbno, 1, &XFS_RMAP_OINFO_FS); in xchk_agfl_xref()
688 xchk_xref_is_not_shared(sc, agbno, 1); in xchk_agfl_xref()
699 struct xfs_scrub *sc) in xchk_agfl() argument
703 xfs_agnumber_t agno = sc->sm->sm_agno; in xchk_agfl()
708 error = xchk_ag_read_headers(sc, agno, &sc->sa); in xchk_agfl()
709 if (!xchk_process_error(sc, agno, XFS_AGFL_BLOCK(sc->mp), &error)) in xchk_agfl()
711 if (!sc->sa.agf_bp) in xchk_agfl()
713 xchk_buffer_recheck(sc, sc->sa.agfl_bp); in xchk_agfl()
715 xchk_agfl_xref(sc); in xchk_agfl()
717 if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT) in xchk_agfl()
721 agf = sc->sa.agf_bp->b_addr; in xchk_agfl()
723 if (agflcount > xfs_agfl_size(sc->mp)) { in xchk_agfl()
724 xchk_block_set_corrupt(sc, sc->sa.agf_bp); in xchk_agfl()
728 sai.sc = sc; in xchk_agfl()
738 error = xfs_agfl_walk(sc->mp, sc->sa.agf_bp->b_addr, in xchk_agfl()
739 sc->sa.agfl_bp, xchk_agfl_block, &sai); in xchk_agfl()
748 xchk_block_set_corrupt(sc, sc->sa.agf_bp); in xchk_agfl()
757 xchk_block_set_corrupt(sc, sc->sa.agf_bp); in xchk_agfl()
773 struct xfs_scrub *sc) in xchk_agi_xref_icounts() argument
775 struct xfs_agi *agi = sc->sa.agi_bp->b_addr; in xchk_agi_xref_icounts()
780 if (!sc->sa.ino_cur) in xchk_agi_xref_icounts()
783 error = xfs_ialloc_count_inodes(sc->sa.ino_cur, &icount, &freecount); in xchk_agi_xref_icounts()
784 if (!xchk_should_check_xref(sc, &error, &sc->sa.ino_cur)) in xchk_agi_xref_icounts()
788 xchk_block_xref_set_corrupt(sc, sc->sa.agi_bp); in xchk_agi_xref_icounts()
794 struct xfs_scrub *sc) in xchk_agi_xref_fiblocks() argument
796 struct xfs_agi *agi = sc->sa.agi_bp->b_addr; in xchk_agi_xref_fiblocks()
800 if (!xfs_has_inobtcounts(sc->mp)) in xchk_agi_xref_fiblocks()
803 if (sc->sa.ino_cur) { in xchk_agi_xref_fiblocks()
804 error = xfs_btree_count_blocks(sc->sa.ino_cur, &blocks); in xchk_agi_xref_fiblocks()
805 if (!xchk_should_check_xref(sc, &error, &sc->sa.ino_cur)) in xchk_agi_xref_fiblocks()
808 xchk_block_xref_set_corrupt(sc, sc->sa.agi_bp); in xchk_agi_xref_fiblocks()
811 if (sc->sa.fino_cur) { in xchk_agi_xref_fiblocks()
812 error = xfs_btree_count_blocks(sc->sa.fino_cur, &blocks); in xchk_agi_xref_fiblocks()
813 if (!xchk_should_check_xref(sc, &error, &sc->sa.fino_cur)) in xchk_agi_xref_fiblocks()
816 xchk_block_xref_set_corrupt(sc, sc->sa.agi_bp); in xchk_agi_xref_fiblocks()
823 struct xfs_scrub *sc) in xchk_agi_xref() argument
825 struct xfs_mount *mp = sc->mp; in xchk_agi_xref()
828 if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT) in xchk_agi_xref()
833 xchk_ag_btcur_init(sc, &sc->sa); in xchk_agi_xref()
835 xchk_xref_is_used_space(sc, agbno, 1); in xchk_agi_xref()
836 xchk_xref_is_not_inode_chunk(sc, agbno, 1); in xchk_agi_xref()
837 xchk_agi_xref_icounts(sc); in xchk_agi_xref()
838 xchk_xref_is_owned_by(sc, agbno, 1, &XFS_RMAP_OINFO_FS); in xchk_agi_xref()
839 xchk_xref_is_not_shared(sc, agbno, 1); in xchk_agi_xref()
840 xchk_agi_xref_fiblocks(sc); in xchk_agi_xref()
848 struct xfs_scrub *sc) in xchk_agi() argument
850 struct xfs_mount *mp = sc->mp; in xchk_agi()
853 struct xfs_ino_geometry *igeo = M_IGEO(sc->mp); in xchk_agi()
854 xfs_agnumber_t agno = sc->sm->sm_agno; in xchk_agi()
865 error = xchk_ag_read_headers(sc, agno, &sc->sa); in xchk_agi()
866 if (!xchk_process_error(sc, agno, XFS_AGI_BLOCK(sc->mp), &error)) in xchk_agi()
868 xchk_buffer_recheck(sc, sc->sa.agi_bp); in xchk_agi()
870 agi = sc->sa.agi_bp->b_addr; in xchk_agi()
871 pag = sc->sa.pag; in xchk_agi()
876 xchk_block_set_corrupt(sc, sc->sa.agi_bp); in xchk_agi()
881 xchk_block_set_corrupt(sc, sc->sa.agi_bp); in xchk_agi()
885 xchk_block_set_corrupt(sc, sc->sa.agi_bp); in xchk_agi()
890 xchk_block_set_corrupt(sc, sc->sa.agi_bp); in xchk_agi()
894 xchk_block_set_corrupt(sc, sc->sa.agi_bp); in xchk_agi()
902 xchk_block_set_corrupt(sc, sc->sa.agi_bp); in xchk_agi()
907 xchk_block_set_corrupt(sc, sc->sa.agi_bp); in xchk_agi()
911 xchk_block_set_corrupt(sc, sc->sa.agi_bp); in xchk_agi()
917 xchk_block_set_corrupt(sc, sc->sa.agi_bp); in xchk_agi()
921 xchk_block_set_corrupt(sc, sc->sa.agi_bp); in xchk_agi()
925 xchk_block_set_corrupt(sc, sc->sa.agi_bp); in xchk_agi()
927 xchk_block_set_corrupt(sc, sc->sa.agi_bp); in xchk_agi()
929 xchk_agi_xref(sc); in xchk_agi()