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_preen(sc, bp); in xchk_superblock()
291 xchk_block_set_corrupt(sc, bp); in xchk_superblock()
296 xchk_block_set_corrupt(sc, bp); in xchk_superblock()
301 xchk_block_set_corrupt(sc, bp); in xchk_superblock()
310 xchk_block_set_preen(sc, bp); in xchk_superblock()
315 xchk_block_set_corrupt(sc, bp); in xchk_superblock()
323 xchk_block_set_preen(sc, bp); in xchk_superblock()
328 xchk_block_set_corrupt(sc, bp); in xchk_superblock()
331 xchk_block_set_preen(sc, bp); in xchk_superblock()
339 xchk_block_set_corrupt(sc, bp); in xchk_superblock()
345 xchk_block_set_corrupt(sc, bp); in xchk_superblock()
347 xchk_superblock_xref(sc, bp); in xchk_superblock()
371 struct xfs_scrub *sc) in xchk_agf_xref_freeblks() argument
373 struct xfs_agf *agf = sc->sa.agf_bp->b_addr; in xchk_agf_xref_freeblks()
377 if (!sc->sa.bno_cur) in xchk_agf_xref_freeblks()
380 error = xfs_alloc_query_all(sc->sa.bno_cur, in xchk_agf_xref_freeblks()
382 if (!xchk_should_check_xref(sc, &error, &sc->sa.bno_cur)) in xchk_agf_xref_freeblks()
385 xchk_block_xref_set_corrupt(sc, sc->sa.agf_bp); in xchk_agf_xref_freeblks()
391 struct xfs_scrub *sc) in xchk_agf_xref_cntbt() argument
393 struct xfs_agf *agf = sc->sa.agf_bp->b_addr; in xchk_agf_xref_cntbt()
399 if (!sc->sa.cnt_cur) in xchk_agf_xref_cntbt()
403 error = xfs_alloc_lookup_le(sc->sa.cnt_cur, 0, -1U, &have); in xchk_agf_xref_cntbt()
404 if (!xchk_should_check_xref(sc, &error, &sc->sa.cnt_cur)) in xchk_agf_xref_cntbt()
408 xchk_block_xref_set_corrupt(sc, sc->sa.agf_bp); in xchk_agf_xref_cntbt()
413 error = xfs_alloc_get_rec(sc->sa.cnt_cur, &agbno, &blocks, &have); in xchk_agf_xref_cntbt()
414 if (!xchk_should_check_xref(sc, &error, &sc->sa.cnt_cur)) in xchk_agf_xref_cntbt()
417 xchk_block_xref_set_corrupt(sc, sc->sa.agf_bp); in xchk_agf_xref_cntbt()
423 struct xfs_scrub *sc) in xchk_agf_xref_btreeblks() argument
425 struct xfs_agf *agf = sc->sa.agf_bp->b_addr; in xchk_agf_xref_btreeblks()
426 struct xfs_mount *mp = sc->mp; in xchk_agf_xref_btreeblks()
432 if (!xfs_has_lazysbcount(sc->mp)) in xchk_agf_xref_btreeblks()
436 if (sc->sa.rmap_cur) { in xchk_agf_xref_btreeblks()
437 error = xfs_btree_count_blocks(sc->sa.rmap_cur, &blocks); in xchk_agf_xref_btreeblks()
438 if (!xchk_should_check_xref(sc, &error, &sc->sa.rmap_cur)) in xchk_agf_xref_btreeblks()
442 xchk_block_xref_set_corrupt(sc, sc->sa.agf_bp); in xchk_agf_xref_btreeblks()
451 if ((xfs_has_rmapbt(mp) && !sc->sa.rmap_cur) || in xchk_agf_xref_btreeblks()
452 !sc->sa.bno_cur || !sc->sa.cnt_cur) in xchk_agf_xref_btreeblks()
456 error = xfs_btree_count_blocks(sc->sa.bno_cur, &blocks); in xchk_agf_xref_btreeblks()
457 if (!xchk_should_check_xref(sc, &error, &sc->sa.bno_cur)) in xchk_agf_xref_btreeblks()
461 error = xfs_btree_count_blocks(sc->sa.cnt_cur, &blocks); in xchk_agf_xref_btreeblks()
462 if (!xchk_should_check_xref(sc, &error, &sc->sa.cnt_cur)) in xchk_agf_xref_btreeblks()
467 xchk_block_xref_set_corrupt(sc, sc->sa.agf_bp); in xchk_agf_xref_btreeblks()
473 struct xfs_scrub *sc) in xchk_agf_xref_refcblks() argument
475 struct xfs_agf *agf = sc->sa.agf_bp->b_addr; in xchk_agf_xref_refcblks()
479 if (!sc->sa.refc_cur) in xchk_agf_xref_refcblks()
482 error = xfs_btree_count_blocks(sc->sa.refc_cur, &blocks); in xchk_agf_xref_refcblks()
483 if (!xchk_should_check_xref(sc, &error, &sc->sa.refc_cur)) in xchk_agf_xref_refcblks()
486 xchk_block_xref_set_corrupt(sc, sc->sa.agf_bp); in xchk_agf_xref_refcblks()
492 struct xfs_scrub *sc) in xchk_agf_xref() argument
494 struct xfs_mount *mp = sc->mp; in xchk_agf_xref()
497 if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT) in xchk_agf_xref()
502 xchk_ag_btcur_init(sc, &sc->sa); in xchk_agf_xref()
504 xchk_xref_is_used_space(sc, agbno, 1); in xchk_agf_xref()
505 xchk_agf_xref_freeblks(sc); in xchk_agf_xref()
506 xchk_agf_xref_cntbt(sc); in xchk_agf_xref()
507 xchk_xref_is_not_inode_chunk(sc, agbno, 1); in xchk_agf_xref()
508 xchk_xref_is_owned_by(sc, agbno, 1, &XFS_RMAP_OINFO_FS); in xchk_agf_xref()
509 xchk_agf_xref_btreeblks(sc); in xchk_agf_xref()
510 xchk_xref_is_not_shared(sc, agbno, 1); in xchk_agf_xref()
511 xchk_agf_xref_refcblks(sc); in xchk_agf_xref()
519 struct xfs_scrub *sc) in xchk_agf() argument
521 struct xfs_mount *mp = sc->mp; in xchk_agf()
524 xfs_agnumber_t agno = sc->sm->sm_agno; in xchk_agf()
534 error = xchk_ag_read_headers(sc, agno, &sc->sa); in xchk_agf()
535 if (!xchk_process_error(sc, agno, XFS_AGF_BLOCK(sc->mp), &error)) in xchk_agf()
537 xchk_buffer_recheck(sc, sc->sa.agf_bp); in xchk_agf()
539 agf = sc->sa.agf_bp->b_addr; in xchk_agf()
540 pag = sc->sa.pag; in xchk_agf()
545 xchk_block_set_corrupt(sc, sc->sa.agf_bp); in xchk_agf()
550 xchk_block_set_corrupt(sc, sc->sa.agf_bp); in xchk_agf()
554 xchk_block_set_corrupt(sc, sc->sa.agf_bp); in xchk_agf()
558 xchk_block_set_corrupt(sc, sc->sa.agf_bp); in xchk_agf()
562 xchk_block_set_corrupt(sc, sc->sa.agf_bp); in xchk_agf()
567 xchk_block_set_corrupt(sc, sc->sa.agf_bp); in xchk_agf()
571 xchk_block_set_corrupt(sc, sc->sa.agf_bp); in xchk_agf()
577 xchk_block_set_corrupt(sc, sc->sa.agf_bp); in xchk_agf()
581 xchk_block_set_corrupt(sc, sc->sa.agf_bp); in xchk_agf()
593 xchk_block_set_corrupt(sc, sc->sa.agf_bp); in xchk_agf()
597 xchk_block_set_corrupt(sc, sc->sa.agf_bp); in xchk_agf()
599 xchk_block_set_corrupt(sc, sc->sa.agf_bp); in xchk_agf()
600 if (xfs_has_lazysbcount(sc->mp) && in xchk_agf()
602 xchk_block_set_corrupt(sc, sc->sa.agf_bp); in xchk_agf()
604 xchk_agf_xref(sc); in xchk_agf()
622 struct xfs_scrub *sc; member
628 struct xfs_scrub *sc, in xchk_agfl_block_xref() argument
631 if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT) in xchk_agfl_block_xref()
634 xchk_xref_is_used_space(sc, agbno, 1); in xchk_agfl_block_xref()
635 xchk_xref_is_not_inode_chunk(sc, agbno, 1); in xchk_agfl_block_xref()
636 xchk_xref_is_owned_by(sc, agbno, 1, &XFS_RMAP_OINFO_AG); in xchk_agfl_block_xref()
637 xchk_xref_is_not_shared(sc, agbno, 1); in xchk_agfl_block_xref()
648 struct xfs_scrub *sc = sai->sc; in xchk_agfl_block() local
650 if (xfs_verify_agbno(sc->sa.pag, agbno) && in xchk_agfl_block()
654 xchk_block_set_corrupt(sc, sai->agfl_bp); in xchk_agfl_block()
656 xchk_agfl_block_xref(sc, agbno); in xchk_agfl_block()
658 if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT) in xchk_agfl_block()
678 struct xfs_scrub *sc) in xchk_agfl_xref() argument
680 struct xfs_mount *mp = sc->mp; in xchk_agfl_xref()
683 if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT) in xchk_agfl_xref()
688 xchk_ag_btcur_init(sc, &sc->sa); in xchk_agfl_xref()
690 xchk_xref_is_used_space(sc, agbno, 1); in xchk_agfl_xref()
691 xchk_xref_is_not_inode_chunk(sc, agbno, 1); in xchk_agfl_xref()
692 xchk_xref_is_owned_by(sc, agbno, 1, &XFS_RMAP_OINFO_FS); in xchk_agfl_xref()
693 xchk_xref_is_not_shared(sc, agbno, 1); in xchk_agfl_xref()
704 struct xfs_scrub *sc) in xchk_agfl() argument
707 .sc = sc, in xchk_agfl()
710 xfs_agnumber_t agno = sc->sm->sm_agno; in xchk_agfl()
715 error = xchk_ag_read_headers(sc, agno, &sc->sa); in xchk_agfl()
716 if (!xchk_process_error(sc, agno, XFS_AGFL_BLOCK(sc->mp), &error)) in xchk_agfl()
718 if (!sc->sa.agf_bp) in xchk_agfl()
722 error = xfs_alloc_read_agfl(sc->sa.pag, sc->tp, &sai.agfl_bp); in xchk_agfl()
723 if (!xchk_process_error(sc, agno, XFS_AGFL_BLOCK(sc->mp), &error)) in xchk_agfl()
725 xchk_buffer_recheck(sc, sai.agfl_bp); in xchk_agfl()
727 xchk_agfl_xref(sc); in xchk_agfl()
729 if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT) in xchk_agfl()
733 agf = sc->sa.agf_bp->b_addr; in xchk_agfl()
735 if (sai.agflcount > xfs_agfl_size(sc->mp)) { in xchk_agfl()
736 xchk_block_set_corrupt(sc, sc->sa.agf_bp); in xchk_agfl()
747 error = xfs_agfl_walk(sc->mp, sc->sa.agf_bp->b_addr, sai.agfl_bp, in xchk_agfl()
757 xchk_block_set_corrupt(sc, sc->sa.agf_bp); in xchk_agfl()
766 xchk_block_set_corrupt(sc, sc->sa.agf_bp); in xchk_agfl()
782 struct xfs_scrub *sc) in xchk_agi_xref_icounts() argument
784 struct xfs_agi *agi = sc->sa.agi_bp->b_addr; in xchk_agi_xref_icounts()
789 if (!sc->sa.ino_cur) in xchk_agi_xref_icounts()
792 error = xfs_ialloc_count_inodes(sc->sa.ino_cur, &icount, &freecount); in xchk_agi_xref_icounts()
793 if (!xchk_should_check_xref(sc, &error, &sc->sa.ino_cur)) in xchk_agi_xref_icounts()
797 xchk_block_xref_set_corrupt(sc, sc->sa.agi_bp); in xchk_agi_xref_icounts()
803 struct xfs_scrub *sc) in xchk_agi_xref_fiblocks() argument
805 struct xfs_agi *agi = sc->sa.agi_bp->b_addr; in xchk_agi_xref_fiblocks()
809 if (!xfs_has_inobtcounts(sc->mp)) in xchk_agi_xref_fiblocks()
812 if (sc->sa.ino_cur) { in xchk_agi_xref_fiblocks()
813 error = xfs_btree_count_blocks(sc->sa.ino_cur, &blocks); in xchk_agi_xref_fiblocks()
814 if (!xchk_should_check_xref(sc, &error, &sc->sa.ino_cur)) in xchk_agi_xref_fiblocks()
817 xchk_block_xref_set_corrupt(sc, sc->sa.agi_bp); in xchk_agi_xref_fiblocks()
820 if (sc->sa.fino_cur) { in xchk_agi_xref_fiblocks()
821 error = xfs_btree_count_blocks(sc->sa.fino_cur, &blocks); in xchk_agi_xref_fiblocks()
822 if (!xchk_should_check_xref(sc, &error, &sc->sa.fino_cur)) in xchk_agi_xref_fiblocks()
825 xchk_block_xref_set_corrupt(sc, sc->sa.agi_bp); in xchk_agi_xref_fiblocks()
832 struct xfs_scrub *sc) in xchk_agi_xref() argument
834 struct xfs_mount *mp = sc->mp; in xchk_agi_xref()
837 if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT) in xchk_agi_xref()
842 xchk_ag_btcur_init(sc, &sc->sa); in xchk_agi_xref()
844 xchk_xref_is_used_space(sc, agbno, 1); in xchk_agi_xref()
845 xchk_xref_is_not_inode_chunk(sc, agbno, 1); in xchk_agi_xref()
846 xchk_agi_xref_icounts(sc); in xchk_agi_xref()
847 xchk_xref_is_owned_by(sc, agbno, 1, &XFS_RMAP_OINFO_FS); in xchk_agi_xref()
848 xchk_xref_is_not_shared(sc, agbno, 1); in xchk_agi_xref()
849 xchk_agi_xref_fiblocks(sc); in xchk_agi_xref()
857 struct xfs_scrub *sc) in xchk_agi() argument
859 struct xfs_mount *mp = sc->mp; in xchk_agi()
862 struct xfs_ino_geometry *igeo = M_IGEO(sc->mp); in xchk_agi()
863 xfs_agnumber_t agno = sc->sm->sm_agno; in xchk_agi()
874 error = xchk_ag_read_headers(sc, agno, &sc->sa); in xchk_agi()
875 if (!xchk_process_error(sc, agno, XFS_AGI_BLOCK(sc->mp), &error)) in xchk_agi()
877 xchk_buffer_recheck(sc, sc->sa.agi_bp); in xchk_agi()
879 agi = sc->sa.agi_bp->b_addr; in xchk_agi()
880 pag = sc->sa.pag; 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()
899 xchk_block_set_corrupt(sc, sc->sa.agi_bp); in xchk_agi()
903 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()
916 xchk_block_set_corrupt(sc, sc->sa.agi_bp); in xchk_agi()
920 xchk_block_set_corrupt(sc, sc->sa.agi_bp); in xchk_agi()
926 xchk_block_set_corrupt(sc, sc->sa.agi_bp); in xchk_agi()
930 xchk_block_set_corrupt(sc, sc->sa.agi_bp); in xchk_agi()
934 xchk_block_set_corrupt(sc, sc->sa.agi_bp); in xchk_agi()
936 xchk_block_set_corrupt(sc, sc->sa.agi_bp); in xchk_agi()
938 xchk_agi_xref(sc); in xchk_agi()