Lines Matching refs:sc

33 	struct xfs_scrub	*sc)  in xchk_prepare_iscrub()  argument
37 xchk_ilock(sc, XFS_IOLOCK_EXCL); in xchk_prepare_iscrub()
39 error = xchk_trans_alloc(sc, 0); in xchk_prepare_iscrub()
43 error = xchk_ino_dqattach(sc); in xchk_prepare_iscrub()
47 xchk_ilock(sc, XFS_ILOCK_EXCL); in xchk_prepare_iscrub()
54 struct xfs_scrub *sc, in xchk_install_handle_iscrub() argument
59 error = xchk_install_handle_inode(sc, ip); in xchk_install_handle_iscrub()
63 return xchk_prepare_iscrub(sc); in xchk_install_handle_iscrub()
74 struct xfs_scrub *sc) in xchk_setup_inode() argument
78 struct xfs_mount *mp = sc->mp; in xchk_setup_inode()
79 struct xfs_inode *ip_in = XFS_I(file_inode(sc->file)); in xchk_setup_inode()
82 xfs_agnumber_t agno = XFS_INO_TO_AGNO(mp, sc->sm->sm_ino); in xchk_setup_inode()
85 if (xchk_need_intent_drain(sc)) in xchk_setup_inode()
86 xchk_fsgates_enable(sc, XCHK_FSGATES_DRAIN); in xchk_setup_inode()
89 if (sc->sm->sm_ino == 0 || sc->sm->sm_ino == ip_in->i_ino) { in xchk_setup_inode()
90 error = xchk_install_live_inode(sc, ip_in); in xchk_setup_inode()
94 return xchk_prepare_iscrub(sc); in xchk_setup_inode()
98 if (xfs_internal_inum(mp, sc->sm->sm_ino)) in xchk_setup_inode()
100 if (!xfs_verify_ino(sc->mp, sc->sm->sm_ino)) in xchk_setup_inode()
104 error = xchk_iget_safe(sc, sc->sm->sm_ino, &ip); in xchk_setup_inode()
106 return xchk_install_handle_iscrub(sc, ip); in xchk_setup_inode()
134 error = xchk_trans_alloc(sc, 0); in xchk_setup_inode()
138 error = xchk_iget_agi(sc, sc->sm->sm_ino, &agi_bp, &ip); in xchk_setup_inode()
141 xchk_trans_cancel(sc); in xchk_setup_inode()
142 return xchk_install_handle_iscrub(sc, ip); in xchk_setup_inode()
167 pag = xfs_perag_get(mp, XFS_INO_TO_AGNO(mp, sc->sm->sm_ino)); in xchk_setup_inode()
173 error = xfs_imap(pag, sc->tp, sc->sm->sm_ino, &imap, in xchk_setup_inode()
192 if (xchk_could_repair(sc)) in xchk_setup_inode()
193 xrep_setup_inode(sc, &imap); in xchk_setup_inode()
197 xchk_trans_cancel(sc); in xchk_setup_inode()
199 trace_xchk_op_error(sc, agno, XFS_INO_TO_AGBNO(mp, sc->sm->sm_ino), in xchk_setup_inode()
204 xchk_trans_cancel(sc); in xchk_setup_inode()
213 struct xfs_scrub *sc, in xchk_inode_extsize() argument
222 fa = xfs_inode_validate_extsize(sc->mp, value, mode, flags); in xchk_inode_extsize()
224 xchk_ino_set_corrupt(sc, ino); in xchk_inode_extsize()
237 xfs_extlen_to_rtxmod(sc->mp, value) > 0) in xchk_inode_extsize()
238 xchk_ino_set_warning(sc, ino); in xchk_inode_extsize()
249 struct xfs_scrub *sc, in xchk_inode_cowextsize() argument
258 fa = xfs_inode_validate_cowextsize(sc->mp, in xchk_inode_cowextsize()
262 xchk_ino_set_corrupt(sc, ino); in xchk_inode_cowextsize()
268 struct xfs_scrub *sc, in xchk_inode_flags() argument
274 struct xfs_mount *mp = sc->mp; in xchk_inode_flags()
307 xchk_ino_set_corrupt(sc, ino); in xchk_inode_flags()
313 struct xfs_scrub *sc, in xchk_inode_flags2() argument
320 struct xfs_mount *mp = sc->mp; in xchk_inode_flags2()
324 xchk_ino_set_warning(sc, ino); in xchk_inode_flags2()
355 xchk_ino_set_corrupt(sc, ino); in xchk_inode_flags2()
360 struct xfs_scrub *sc, in xchk_dinode_nsec() argument
369 xchk_ino_set_corrupt(sc, ino); in xchk_dinode_nsec()
375 struct xfs_scrub *sc, in xchk_dinode() argument
379 struct xfs_mount *mp = sc->mp; in xchk_dinode()
408 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
419 xchk_ino_set_preen(sc, ino); in xchk_dinode()
425 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
427 if (dip->di_mode == 0 && sc->ip) in xchk_dinode()
428 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
432 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
437 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
450 xchk_ino_set_warning(sc, ino); in xchk_dinode()
457 xchk_ino_set_warning(sc, ino); in xchk_dinode()
464 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
468 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
472 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
476 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
480 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
485 xchk_dinode_nsec(sc, ino, dip, dip->di_atime); in xchk_dinode()
486 xchk_dinode_nsec(sc, ino, dip, dip->di_mtime); in xchk_dinode()
487 xchk_dinode_nsec(sc, ino, dip, dip->di_ctime); in xchk_dinode()
496 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
500 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
504 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
508 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
517 xchk_ino_set_warning(sc, ino); in xchk_dinode()
532 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
535 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
538 xchk_inode_flags(sc, dip, ino, mode, flags); in xchk_dinode()
540 xchk_inode_extsize(sc, dip, ino, mode, flags); in xchk_dinode()
550 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
554 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
558 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
564 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
566 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
568 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
574 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
581 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
585 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
589 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
593 xchk_dinode_nsec(sc, ino, dip, dip->di_crtime); in xchk_dinode()
594 xchk_inode_flags2(sc, dip, ino, mode, flags, flags2); in xchk_dinode()
595 xchk_inode_cowextsize(sc, dip, ino, mode, flags, in xchk_dinode()
607 struct xfs_scrub *sc, in xchk_inode_xref_finobt() argument
615 if (!sc->sa.fino_cur || xchk_skip_xref(sc->sm)) in xchk_inode_xref_finobt()
618 agino = XFS_INO_TO_AGINO(sc->mp, ino); in xchk_inode_xref_finobt()
624 error = xfs_inobt_lookup(sc->sa.fino_cur, agino, XFS_LOOKUP_LE, in xchk_inode_xref_finobt()
626 if (!xchk_should_check_xref(sc, &error, &sc->sa.fino_cur) || in xchk_inode_xref_finobt()
630 error = xfs_inobt_get_rec(sc->sa.fino_cur, &rec, &has_record); in xchk_inode_xref_finobt()
631 if (!xchk_should_check_xref(sc, &error, &sc->sa.fino_cur) || in xchk_inode_xref_finobt()
644 xchk_btree_xref_set_corrupt(sc, sc->sa.fino_cur, 0); in xchk_inode_xref_finobt()
650 struct xfs_scrub *sc, in xchk_inode_xref_bmap() argument
658 if (xchk_skip_xref(sc->sm)) in xchk_inode_xref_bmap()
662 error = xfs_bmap_count_blocks(sc->tp, sc->ip, XFS_DATA_FORK, in xchk_inode_xref_bmap()
664 if (!xchk_should_check_xref(sc, &error, NULL)) in xchk_inode_xref_bmap()
667 xchk_ino_xref_set_corrupt(sc, sc->ip->i_ino); in xchk_inode_xref_bmap()
669 error = xfs_bmap_count_blocks(sc->tp, sc->ip, XFS_ATTR_FORK, in xchk_inode_xref_bmap()
671 if (!xchk_should_check_xref(sc, &error, NULL)) in xchk_inode_xref_bmap()
674 xchk_ino_xref_set_corrupt(sc, sc->ip->i_ino); in xchk_inode_xref_bmap()
678 xchk_ino_xref_set_corrupt(sc, sc->ip->i_ino); in xchk_inode_xref_bmap()
684 struct xfs_scrub *sc, in xchk_inode_xref() argument
692 if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT) in xchk_inode_xref()
695 agno = XFS_INO_TO_AGNO(sc->mp, ino); in xchk_inode_xref()
696 agbno = XFS_INO_TO_AGBNO(sc->mp, ino); in xchk_inode_xref()
698 error = xchk_ag_init_existing(sc, agno, &sc->sa); in xchk_inode_xref()
699 if (!xchk_xref_process_error(sc, agno, agbno, &error)) in xchk_inode_xref()
702 xchk_xref_is_used_space(sc, agbno, 1); in xchk_inode_xref()
703 xchk_inode_xref_finobt(sc, ino); in xchk_inode_xref()
704 xchk_xref_is_only_owned_by(sc, agbno, 1, &XFS_RMAP_OINFO_INODES); in xchk_inode_xref()
705 xchk_xref_is_not_shared(sc, agbno, 1); in xchk_inode_xref()
706 xchk_xref_is_not_cow_staging(sc, agbno, 1); in xchk_inode_xref()
707 xchk_inode_xref_bmap(sc, dip); in xchk_inode_xref()
710 xchk_ag_free(sc, &sc->sa); in xchk_inode_xref()
721 struct xfs_scrub *sc, in xchk_inode_check_reflink_iflag() argument
724 struct xfs_mount *mp = sc->mp; in xchk_inode_check_reflink_iflag()
731 error = xfs_reflink_inode_has_shared_extents(sc->tp, sc->ip, in xchk_inode_check_reflink_iflag()
733 if (!xchk_xref_process_error(sc, XFS_INO_TO_AGNO(mp, ino), in xchk_inode_check_reflink_iflag()
736 if (xfs_is_reflink_inode(sc->ip) && !has_shared) in xchk_inode_check_reflink_iflag()
737 xchk_ino_set_preen(sc, ino); in xchk_inode_check_reflink_iflag()
738 else if (!xfs_is_reflink_inode(sc->ip) && has_shared) in xchk_inode_check_reflink_iflag()
739 xchk_ino_set_corrupt(sc, ino); in xchk_inode_check_reflink_iflag()
748 struct xfs_scrub *sc) in xchk_inode_check_unlinked() argument
750 if (VFS_I(sc->ip)->i_nlink == 0) { in xchk_inode_check_unlinked()
751 if (!xfs_inode_on_unlinked_list(sc->ip)) in xchk_inode_check_unlinked()
752 xchk_ino_set_corrupt(sc, sc->ip->i_ino); in xchk_inode_check_unlinked()
754 if (xfs_inode_on_unlinked_list(sc->ip)) in xchk_inode_check_unlinked()
755 xchk_ino_set_corrupt(sc, sc->ip->i_ino); in xchk_inode_check_unlinked()
762 struct xfs_scrub *sc) in xchk_inode() argument
772 if (!sc->ip) { in xchk_inode()
773 xchk_ino_set_corrupt(sc, sc->sm->sm_ino); in xchk_inode()
778 xfs_inode_to_disk(sc->ip, &di, 0); in xchk_inode()
779 xchk_dinode(sc, &di, sc->ip->i_ino); in xchk_inode()
780 if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT) in xchk_inode()
788 if (S_ISREG(VFS_I(sc->ip)->i_mode)) in xchk_inode()
789 xchk_inode_check_reflink_iflag(sc, sc->ip->i_ino); in xchk_inode()
791 xchk_inode_check_unlinked(sc); in xchk_inode()
793 xchk_inode_xref(sc, sc->ip->i_ino, &di); in xchk_inode()