• Home
  • Raw
  • Download

Lines Matching refs:sc

25 	struct xfs_scrub	*sc,  in xchk_superblock_xref()  argument
28 struct xfs_mount *mp = sc->mp; in xchk_superblock_xref()
29 xfs_agnumber_t agno = sc->sm->sm_agno; in xchk_superblock_xref()
33 if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT) in xchk_superblock_xref()
38 error = xchk_ag_init(sc, agno, &sc->sa); in xchk_superblock_xref()
39 if (!xchk_xref_process_error(sc, agno, agbno, &error)) in xchk_superblock_xref()
42 xchk_xref_is_used_space(sc, agbno, 1); in xchk_superblock_xref()
43 xchk_xref_is_not_inode_chunk(sc, agbno, 1); in xchk_superblock_xref()
44 xchk_xref_is_owned_by(sc, agbno, 1, &XFS_RMAP_OINFO_FS); in xchk_superblock_xref()
45 xchk_xref_is_not_shared(sc, agbno, 1); in xchk_superblock_xref()
60 struct xfs_scrub *sc) in xchk_superblock() argument
62 struct xfs_mount *mp = sc->mp; in xchk_superblock()
71 agno = sc->sm->sm_agno; in xchk_superblock()
75 error = xfs_sb_read_secondary(mp, sc->tp, agno, &bp); in xchk_superblock()
92 if (!xchk_process_error(sc, agno, XFS_SB_BLOCK(mp), &error)) in xchk_superblock()
104 xchk_block_set_corrupt(sc, bp); in xchk_superblock()
107 xchk_block_set_corrupt(sc, bp); in xchk_superblock()
110 xchk_block_set_corrupt(sc, bp); in xchk_superblock()
113 xchk_block_set_corrupt(sc, bp); in xchk_superblock()
116 xchk_block_set_preen(sc, bp); in xchk_superblock()
119 xchk_block_set_corrupt(sc, bp); in xchk_superblock()
122 xchk_block_set_preen(sc, bp); in xchk_superblock()
125 xchk_block_set_preen(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_corrupt(sc, bp); in xchk_superblock()
137 xchk_block_set_corrupt(sc, bp); in xchk_superblock()
140 xchk_block_set_corrupt(sc, bp); in xchk_superblock()
143 xchk_block_set_corrupt(sc, bp); in xchk_superblock()
157 xchk_block_set_corrupt(sc, bp); in xchk_superblock()
165 xchk_block_set_preen(sc, bp); in xchk_superblock()
168 xchk_block_set_corrupt(sc, bp); in xchk_superblock()
171 xchk_block_set_corrupt(sc, bp); in xchk_superblock()
174 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_corrupt(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_preen(sc, bp); in xchk_superblock()
206 xchk_block_set_preen(sc, bp); in xchk_superblock()
209 xchk_block_set_preen(sc, bp); in xchk_superblock()
217 xchk_block_set_corrupt(sc, bp); in xchk_superblock()
220 xchk_block_set_corrupt(sc, bp); in xchk_superblock()
223 xchk_block_set_corrupt(sc, bp); in xchk_superblock()
226 xchk_block_set_preen(sc, bp); in xchk_superblock()
229 xchk_block_set_preen(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_corrupt(sc, bp); in xchk_superblock()
241 xchk_block_set_corrupt(sc, bp); in xchk_superblock()
246 xchk_block_set_corrupt(sc, bp); in xchk_superblock()
253 xchk_block_set_corrupt(sc, bp); in xchk_superblock()
256 xchk_block_set_preen(sc, bp); in xchk_superblock()
266 xchk_block_set_corrupt(sc, bp); in xchk_superblock()
272 xchk_block_set_corrupt(sc, bp); in xchk_superblock()
279 xchk_block_set_corrupt(sc, bp); in xchk_superblock()
285 xchk_block_set_corrupt(sc, bp); in xchk_superblock()
295 xchk_block_set_corrupt(sc, bp); in xchk_superblock()
305 xchk_block_set_corrupt(sc, bp); in xchk_superblock()
312 xchk_block_set_corrupt(sc, bp); in xchk_superblock()
317 xchk_block_set_corrupt(sc, bp); in xchk_superblock()
320 xchk_block_set_preen(sc, bp); in xchk_superblock()
328 xchk_block_set_corrupt(sc, bp); in xchk_superblock()
334 xchk_block_set_corrupt(sc, bp); in xchk_superblock()
336 xchk_superblock_xref(sc, bp); in xchk_superblock()
359 struct xfs_scrub *sc) in xchk_agf_xref_freeblks() argument
361 struct xfs_agf *agf = sc->sa.agf_bp->b_addr; in xchk_agf_xref_freeblks()
365 if (!sc->sa.bno_cur) in xchk_agf_xref_freeblks()
368 error = xfs_alloc_query_all(sc->sa.bno_cur, in xchk_agf_xref_freeblks()
370 if (!xchk_should_check_xref(sc, &error, &sc->sa.bno_cur)) in xchk_agf_xref_freeblks()
373 xchk_block_xref_set_corrupt(sc, sc->sa.agf_bp); in xchk_agf_xref_freeblks()
379 struct xfs_scrub *sc) in xchk_agf_xref_cntbt() argument
381 struct xfs_agf *agf = sc->sa.agf_bp->b_addr; in xchk_agf_xref_cntbt()
387 if (!sc->sa.cnt_cur) in xchk_agf_xref_cntbt()
391 error = xfs_alloc_lookup_le(sc->sa.cnt_cur, 0, -1U, &have); in xchk_agf_xref_cntbt()
392 if (!xchk_should_check_xref(sc, &error, &sc->sa.cnt_cur)) in xchk_agf_xref_cntbt()
396 xchk_block_xref_set_corrupt(sc, sc->sa.agf_bp); in xchk_agf_xref_cntbt()
401 error = xfs_alloc_get_rec(sc->sa.cnt_cur, &agbno, &blocks, &have); in xchk_agf_xref_cntbt()
402 if (!xchk_should_check_xref(sc, &error, &sc->sa.cnt_cur)) in xchk_agf_xref_cntbt()
405 xchk_block_xref_set_corrupt(sc, sc->sa.agf_bp); in xchk_agf_xref_cntbt()
411 struct xfs_scrub *sc) in xchk_agf_xref_btreeblks() argument
413 struct xfs_agf *agf = sc->sa.agf_bp->b_addr; in xchk_agf_xref_btreeblks()
414 struct xfs_mount *mp = sc->mp; in xchk_agf_xref_btreeblks()
420 if (sc->sa.rmap_cur) { in xchk_agf_xref_btreeblks()
421 error = xfs_btree_count_blocks(sc->sa.rmap_cur, &blocks); in xchk_agf_xref_btreeblks()
422 if (!xchk_should_check_xref(sc, &error, &sc->sa.rmap_cur)) in xchk_agf_xref_btreeblks()
426 xchk_block_xref_set_corrupt(sc, sc->sa.agf_bp); in xchk_agf_xref_btreeblks()
435 if ((xfs_sb_version_hasrmapbt(&mp->m_sb) && !sc->sa.rmap_cur) || in xchk_agf_xref_btreeblks()
436 !sc->sa.bno_cur || !sc->sa.cnt_cur) in xchk_agf_xref_btreeblks()
440 error = xfs_btree_count_blocks(sc->sa.bno_cur, &blocks); in xchk_agf_xref_btreeblks()
441 if (!xchk_should_check_xref(sc, &error, &sc->sa.bno_cur)) in xchk_agf_xref_btreeblks()
445 error = xfs_btree_count_blocks(sc->sa.cnt_cur, &blocks); in xchk_agf_xref_btreeblks()
446 if (!xchk_should_check_xref(sc, &error, &sc->sa.cnt_cur)) in xchk_agf_xref_btreeblks()
451 xchk_block_xref_set_corrupt(sc, sc->sa.agf_bp); in xchk_agf_xref_btreeblks()
457 struct xfs_scrub *sc) in xchk_agf_xref_refcblks() argument
459 struct xfs_agf *agf = sc->sa.agf_bp->b_addr; in xchk_agf_xref_refcblks()
463 if (!sc->sa.refc_cur) in xchk_agf_xref_refcblks()
466 error = xfs_btree_count_blocks(sc->sa.refc_cur, &blocks); in xchk_agf_xref_refcblks()
467 if (!xchk_should_check_xref(sc, &error, &sc->sa.refc_cur)) in xchk_agf_xref_refcblks()
470 xchk_block_xref_set_corrupt(sc, sc->sa.agf_bp); in xchk_agf_xref_refcblks()
476 struct xfs_scrub *sc) in xchk_agf_xref() argument
478 struct xfs_mount *mp = sc->mp; in xchk_agf_xref()
482 if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT) in xchk_agf_xref()
487 error = xchk_ag_btcur_init(sc, &sc->sa); in xchk_agf_xref()
491 xchk_xref_is_used_space(sc, agbno, 1); in xchk_agf_xref()
492 xchk_agf_xref_freeblks(sc); in xchk_agf_xref()
493 xchk_agf_xref_cntbt(sc); in xchk_agf_xref()
494 xchk_xref_is_not_inode_chunk(sc, agbno, 1); in xchk_agf_xref()
495 xchk_xref_is_owned_by(sc, agbno, 1, &XFS_RMAP_OINFO_FS); in xchk_agf_xref()
496 xchk_agf_xref_btreeblks(sc); in xchk_agf_xref()
497 xchk_xref_is_not_shared(sc, agbno, 1); in xchk_agf_xref()
498 xchk_agf_xref_refcblks(sc); in xchk_agf_xref()
506 struct xfs_scrub *sc) in xchk_agf() argument
508 struct xfs_mount *mp = sc->mp; in xchk_agf()
521 agno = sc->sa.agno = sc->sm->sm_agno; in xchk_agf()
522 error = xchk_ag_read_headers(sc, agno, &sc->sa.agi_bp, in xchk_agf()
523 &sc->sa.agf_bp, &sc->sa.agfl_bp); in xchk_agf()
524 if (!xchk_process_error(sc, agno, XFS_AGF_BLOCK(sc->mp), &error)) in xchk_agf()
526 xchk_buffer_recheck(sc, sc->sa.agf_bp); in xchk_agf()
528 agf = sc->sa.agf_bp->b_addr; in xchk_agf()
533 xchk_block_set_corrupt(sc, sc->sa.agf_bp); in xchk_agf()
538 xchk_block_set_corrupt(sc, sc->sa.agf_bp); in xchk_agf()
542 xchk_block_set_corrupt(sc, sc->sa.agf_bp); in xchk_agf()
546 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()
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()
565 xchk_block_set_corrupt(sc, sc->sa.agf_bp); in xchk_agf()
569 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()
586 xchk_block_set_corrupt(sc, sc->sa.agf_bp); in xchk_agf()
588 xchk_block_set_corrupt(sc, sc->sa.agf_bp); in xchk_agf()
590 xchk_block_set_corrupt(sc, sc->sa.agf_bp); in xchk_agf()
593 xchk_agf_xref(sc); in xchk_agf()
604 struct xfs_scrub *sc; member
610 struct xfs_scrub *sc, in xchk_agfl_block_xref() argument
613 if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT) in xchk_agfl_block_xref()
616 xchk_xref_is_used_space(sc, agbno, 1); in xchk_agfl_block_xref()
617 xchk_xref_is_not_inode_chunk(sc, agbno, 1); in xchk_agfl_block_xref()
618 xchk_xref_is_owned_by(sc, agbno, 1, &XFS_RMAP_OINFO_AG); in xchk_agfl_block_xref()
619 xchk_xref_is_not_shared(sc, agbno, 1); in xchk_agfl_block_xref()
630 struct xfs_scrub *sc = sai->sc; in xchk_agfl_block() local
631 xfs_agnumber_t agno = sc->sa.agno; in xchk_agfl_block()
637 xchk_block_set_corrupt(sc, sc->sa.agfl_bp); in xchk_agfl_block()
639 xchk_agfl_block_xref(sc, agbno); in xchk_agfl_block()
641 if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT) in xchk_agfl_block()
661 struct xfs_scrub *sc) in xchk_agfl_xref() argument
663 struct xfs_mount *mp = sc->mp; in xchk_agfl_xref()
667 if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT) in xchk_agfl_xref()
672 error = xchk_ag_btcur_init(sc, &sc->sa); in xchk_agfl_xref()
676 xchk_xref_is_used_space(sc, agbno, 1); in xchk_agfl_xref()
677 xchk_xref_is_not_inode_chunk(sc, agbno, 1); in xchk_agfl_xref()
678 xchk_xref_is_owned_by(sc, agbno, 1, &XFS_RMAP_OINFO_FS); in xchk_agfl_xref()
679 xchk_xref_is_not_shared(sc, agbno, 1); in xchk_agfl_xref()
690 struct xfs_scrub *sc) in xchk_agfl() argument
699 agno = sc->sa.agno = sc->sm->sm_agno; in xchk_agfl()
700 error = xchk_ag_read_headers(sc, agno, &sc->sa.agi_bp, in xchk_agfl()
701 &sc->sa.agf_bp, &sc->sa.agfl_bp); in xchk_agfl()
702 if (!xchk_process_error(sc, agno, XFS_AGFL_BLOCK(sc->mp), &error)) in xchk_agfl()
704 if (!sc->sa.agf_bp) in xchk_agfl()
706 xchk_buffer_recheck(sc, sc->sa.agfl_bp); in xchk_agfl()
708 xchk_agfl_xref(sc); in xchk_agfl()
710 if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT) in xchk_agfl()
714 agf = sc->sa.agf_bp->b_addr; in xchk_agfl()
716 if (agflcount > xfs_agfl_size(sc->mp)) { in xchk_agfl()
717 xchk_block_set_corrupt(sc, sc->sa.agf_bp); in xchk_agfl()
721 sai.sc = sc; in xchk_agfl()
731 error = xfs_agfl_walk(sc->mp, sc->sa.agf_bp->b_addr, in xchk_agfl()
732 sc->sa.agfl_bp, xchk_agfl_block, &sai); in xchk_agfl()
741 xchk_block_set_corrupt(sc, sc->sa.agf_bp); in xchk_agfl()
750 xchk_block_set_corrupt(sc, sc->sa.agf_bp); in xchk_agfl()
766 struct xfs_scrub *sc) in xchk_agi_xref_icounts() argument
768 struct xfs_agi *agi = sc->sa.agi_bp->b_addr; in xchk_agi_xref_icounts()
773 if (!sc->sa.ino_cur) in xchk_agi_xref_icounts()
776 error = xfs_ialloc_count_inodes(sc->sa.ino_cur, &icount, &freecount); in xchk_agi_xref_icounts()
777 if (!xchk_should_check_xref(sc, &error, &sc->sa.ino_cur)) in xchk_agi_xref_icounts()
781 xchk_block_xref_set_corrupt(sc, sc->sa.agi_bp); in xchk_agi_xref_icounts()
787 struct xfs_scrub *sc) in xchk_agi_xref_fiblocks() argument
789 struct xfs_agi *agi = sc->sa.agi_bp->b_addr; in xchk_agi_xref_fiblocks()
793 if (!xfs_sb_version_hasinobtcounts(&sc->mp->m_sb)) in xchk_agi_xref_fiblocks()
796 if (sc->sa.ino_cur) { in xchk_agi_xref_fiblocks()
797 error = xfs_btree_count_blocks(sc->sa.ino_cur, &blocks); in xchk_agi_xref_fiblocks()
798 if (!xchk_should_check_xref(sc, &error, &sc->sa.ino_cur)) in xchk_agi_xref_fiblocks()
801 xchk_block_xref_set_corrupt(sc, sc->sa.agi_bp); in xchk_agi_xref_fiblocks()
804 if (sc->sa.fino_cur) { in xchk_agi_xref_fiblocks()
805 error = xfs_btree_count_blocks(sc->sa.fino_cur, &blocks); in xchk_agi_xref_fiblocks()
806 if (!xchk_should_check_xref(sc, &error, &sc->sa.fino_cur)) in xchk_agi_xref_fiblocks()
809 xchk_block_xref_set_corrupt(sc, sc->sa.agi_bp); in xchk_agi_xref_fiblocks()
816 struct xfs_scrub *sc) in xchk_agi_xref() argument
818 struct xfs_mount *mp = sc->mp; in xchk_agi_xref()
822 if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT) in xchk_agi_xref()
827 error = xchk_ag_btcur_init(sc, &sc->sa); in xchk_agi_xref()
831 xchk_xref_is_used_space(sc, agbno, 1); in xchk_agi_xref()
832 xchk_xref_is_not_inode_chunk(sc, agbno, 1); in xchk_agi_xref()
833 xchk_agi_xref_icounts(sc); in xchk_agi_xref()
834 xchk_xref_is_owned_by(sc, agbno, 1, &XFS_RMAP_OINFO_FS); in xchk_agi_xref()
835 xchk_xref_is_not_shared(sc, agbno, 1); in xchk_agi_xref()
836 xchk_agi_xref_fiblocks(sc); in xchk_agi_xref()
844 struct xfs_scrub *sc) in xchk_agi() argument
846 struct xfs_mount *mp = sc->mp; in xchk_agi()
860 agno = sc->sa.agno = sc->sm->sm_agno; in xchk_agi()
861 error = xchk_ag_read_headers(sc, agno, &sc->sa.agi_bp, in xchk_agi()
862 &sc->sa.agf_bp, &sc->sa.agfl_bp); in xchk_agi()
863 if (!xchk_process_error(sc, agno, XFS_AGI_BLOCK(sc->mp), &error)) in xchk_agi()
865 xchk_buffer_recheck(sc, sc->sa.agi_bp); in xchk_agi()
867 agi = sc->sa.agi_bp->b_addr; in xchk_agi()
872 xchk_block_set_corrupt(sc, sc->sa.agi_bp); in xchk_agi()
877 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()
886 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()
898 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()
907 xchk_block_set_corrupt(sc, sc->sa.agi_bp); in xchk_agi()
913 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()
922 xchk_block_set_corrupt(sc, sc->sa.agi_bp); in xchk_agi()
924 xchk_block_set_corrupt(sc, sc->sa.agi_bp); in xchk_agi()
927 xchk_agi_xref(sc); in xchk_agi()