Lines Matching refs:sc
31 struct xfs_scrub *sc) in xchk_prepare_iscrub() argument
35 xchk_ilock(sc, XFS_IOLOCK_EXCL); in xchk_prepare_iscrub()
37 error = xchk_trans_alloc(sc, 0); in xchk_prepare_iscrub()
41 xchk_ilock(sc, XFS_ILOCK_EXCL); in xchk_prepare_iscrub()
48 struct xfs_scrub *sc, in xchk_install_handle_iscrub() argument
53 error = xchk_install_handle_inode(sc, ip); in xchk_install_handle_iscrub()
57 return xchk_prepare_iscrub(sc); in xchk_install_handle_iscrub()
68 struct xfs_scrub *sc) in xchk_setup_inode() argument
72 struct xfs_mount *mp = sc->mp; in xchk_setup_inode()
73 struct xfs_inode *ip_in = XFS_I(file_inode(sc->file)); in xchk_setup_inode()
76 xfs_agnumber_t agno = XFS_INO_TO_AGNO(mp, sc->sm->sm_ino); in xchk_setup_inode()
79 if (xchk_need_intent_drain(sc)) in xchk_setup_inode()
80 xchk_fsgates_enable(sc, XCHK_FSGATES_DRAIN); in xchk_setup_inode()
83 if (sc->sm->sm_ino == 0 || sc->sm->sm_ino == ip_in->i_ino) { in xchk_setup_inode()
84 error = xchk_install_live_inode(sc, ip_in); in xchk_setup_inode()
88 return xchk_prepare_iscrub(sc); in xchk_setup_inode()
92 if (xfs_internal_inum(mp, sc->sm->sm_ino)) in xchk_setup_inode()
94 if (!xfs_verify_ino(sc->mp, sc->sm->sm_ino)) in xchk_setup_inode()
98 error = xchk_iget_safe(sc, sc->sm->sm_ino, &ip); in xchk_setup_inode()
100 return xchk_install_handle_iscrub(sc, ip); in xchk_setup_inode()
128 error = xchk_trans_alloc(sc, 0); in xchk_setup_inode()
132 error = xchk_iget_agi(sc, sc->sm->sm_ino, &agi_bp, &ip); in xchk_setup_inode()
135 xchk_trans_cancel(sc); in xchk_setup_inode()
136 return xchk_install_handle_iscrub(sc, ip); in xchk_setup_inode()
161 pag = xfs_perag_get(mp, XFS_INO_TO_AGNO(mp, sc->sm->sm_ino)); in xchk_setup_inode()
167 error = xfs_imap(pag, sc->tp, sc->sm->sm_ino, &imap, in xchk_setup_inode()
188 xchk_trans_cancel(sc); in xchk_setup_inode()
190 trace_xchk_op_error(sc, agno, XFS_INO_TO_AGBNO(mp, sc->sm->sm_ino), in xchk_setup_inode()
195 xchk_trans_cancel(sc); in xchk_setup_inode()
204 struct xfs_scrub *sc, in xchk_inode_extsize() argument
213 fa = xfs_inode_validate_extsize(sc->mp, value, mode, flags); in xchk_inode_extsize()
215 xchk_ino_set_corrupt(sc, ino); in xchk_inode_extsize()
228 value % sc->mp->m_sb.sb_rextsize > 0) in xchk_inode_extsize()
229 xchk_ino_set_warning(sc, ino); in xchk_inode_extsize()
240 struct xfs_scrub *sc, in xchk_inode_cowextsize() argument
249 fa = xfs_inode_validate_cowextsize(sc->mp, in xchk_inode_cowextsize()
253 xchk_ino_set_corrupt(sc, ino); in xchk_inode_cowextsize()
259 struct xfs_scrub *sc, in xchk_inode_flags() argument
265 struct xfs_mount *mp = sc->mp; in xchk_inode_flags()
298 xchk_ino_set_corrupt(sc, ino); in xchk_inode_flags()
304 struct xfs_scrub *sc, in xchk_inode_flags2() argument
311 struct xfs_mount *mp = sc->mp; in xchk_inode_flags2()
315 xchk_ino_set_warning(sc, ino); in xchk_inode_flags2()
346 xchk_ino_set_corrupt(sc, ino); in xchk_inode_flags2()
351 struct xfs_scrub *sc, in xchk_dinode_nsec() argument
360 xchk_ino_set_corrupt(sc, ino); in xchk_dinode_nsec()
366 struct xfs_scrub *sc, in xchk_dinode() argument
370 struct xfs_mount *mp = sc->mp; in xchk_dinode()
399 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
410 xchk_ino_set_preen(sc, ino); in xchk_dinode()
416 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
418 if (dip->di_mode == 0 && sc->ip) in xchk_dinode()
419 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
423 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
428 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
441 xchk_ino_set_warning(sc, ino); in xchk_dinode()
448 xchk_ino_set_warning(sc, ino); in xchk_dinode()
455 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
459 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
463 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
467 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
471 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
476 xchk_dinode_nsec(sc, ino, dip, dip->di_atime); in xchk_dinode()
477 xchk_dinode_nsec(sc, ino, dip, dip->di_mtime); in xchk_dinode()
478 xchk_dinode_nsec(sc, ino, dip, dip->di_ctime); in xchk_dinode()
487 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
491 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
495 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
499 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
508 xchk_ino_set_warning(sc, ino); in xchk_dinode()
523 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
526 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
529 xchk_inode_flags(sc, dip, ino, mode, flags); in xchk_dinode()
531 xchk_inode_extsize(sc, dip, ino, mode, flags); in xchk_dinode()
541 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
545 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
549 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
555 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
557 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
559 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
565 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
572 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
576 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
580 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
584 xchk_dinode_nsec(sc, ino, dip, dip->di_crtime); in xchk_dinode()
585 xchk_inode_flags2(sc, dip, ino, mode, flags, flags2); in xchk_dinode()
586 xchk_inode_cowextsize(sc, dip, ino, mode, flags, in xchk_dinode()
598 struct xfs_scrub *sc, in xchk_inode_xref_finobt() argument
606 if (!sc->sa.fino_cur || xchk_skip_xref(sc->sm)) in xchk_inode_xref_finobt()
609 agino = XFS_INO_TO_AGINO(sc->mp, ino); in xchk_inode_xref_finobt()
615 error = xfs_inobt_lookup(sc->sa.fino_cur, agino, XFS_LOOKUP_LE, in xchk_inode_xref_finobt()
617 if (!xchk_should_check_xref(sc, &error, &sc->sa.fino_cur) || in xchk_inode_xref_finobt()
621 error = xfs_inobt_get_rec(sc->sa.fino_cur, &rec, &has_record); in xchk_inode_xref_finobt()
622 if (!xchk_should_check_xref(sc, &error, &sc->sa.fino_cur) || in xchk_inode_xref_finobt()
635 xchk_btree_xref_set_corrupt(sc, sc->sa.fino_cur, 0); in xchk_inode_xref_finobt()
641 struct xfs_scrub *sc, in xchk_inode_xref_bmap() argument
649 if (xchk_skip_xref(sc->sm)) in xchk_inode_xref_bmap()
653 error = xfs_bmap_count_blocks(sc->tp, sc->ip, XFS_DATA_FORK, in xchk_inode_xref_bmap()
655 if (!xchk_should_check_xref(sc, &error, NULL)) in xchk_inode_xref_bmap()
658 xchk_ino_xref_set_corrupt(sc, sc->ip->i_ino); in xchk_inode_xref_bmap()
660 error = xfs_bmap_count_blocks(sc->tp, sc->ip, XFS_ATTR_FORK, in xchk_inode_xref_bmap()
662 if (!xchk_should_check_xref(sc, &error, NULL)) in xchk_inode_xref_bmap()
665 xchk_ino_xref_set_corrupt(sc, sc->ip->i_ino); in xchk_inode_xref_bmap()
669 xchk_ino_xref_set_corrupt(sc, sc->ip->i_ino); in xchk_inode_xref_bmap()
675 struct xfs_scrub *sc, in xchk_inode_xref() argument
683 if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT) in xchk_inode_xref()
686 agno = XFS_INO_TO_AGNO(sc->mp, ino); in xchk_inode_xref()
687 agbno = XFS_INO_TO_AGBNO(sc->mp, ino); in xchk_inode_xref()
689 error = xchk_ag_init_existing(sc, agno, &sc->sa); in xchk_inode_xref()
690 if (!xchk_xref_process_error(sc, agno, agbno, &error)) in xchk_inode_xref()
693 xchk_xref_is_used_space(sc, agbno, 1); in xchk_inode_xref()
694 xchk_inode_xref_finobt(sc, ino); in xchk_inode_xref()
695 xchk_xref_is_only_owned_by(sc, agbno, 1, &XFS_RMAP_OINFO_INODES); in xchk_inode_xref()
696 xchk_xref_is_not_shared(sc, agbno, 1); in xchk_inode_xref()
697 xchk_xref_is_not_cow_staging(sc, agbno, 1); in xchk_inode_xref()
698 xchk_inode_xref_bmap(sc, dip); in xchk_inode_xref()
701 xchk_ag_free(sc, &sc->sa); in xchk_inode_xref()
712 struct xfs_scrub *sc, in xchk_inode_check_reflink_iflag() argument
715 struct xfs_mount *mp = sc->mp; in xchk_inode_check_reflink_iflag()
722 error = xfs_reflink_inode_has_shared_extents(sc->tp, sc->ip, in xchk_inode_check_reflink_iflag()
724 if (!xchk_xref_process_error(sc, XFS_INO_TO_AGNO(mp, ino), in xchk_inode_check_reflink_iflag()
727 if (xfs_is_reflink_inode(sc->ip) && !has_shared) in xchk_inode_check_reflink_iflag()
728 xchk_ino_set_preen(sc, ino); in xchk_inode_check_reflink_iflag()
729 else if (!xfs_is_reflink_inode(sc->ip) && has_shared) in xchk_inode_check_reflink_iflag()
730 xchk_ino_set_corrupt(sc, ino); in xchk_inode_check_reflink_iflag()
736 struct xfs_scrub *sc) in xchk_inode() argument
746 if (!sc->ip) { in xchk_inode()
747 xchk_ino_set_corrupt(sc, sc->sm->sm_ino); in xchk_inode()
752 xfs_inode_to_disk(sc->ip, &di, 0); in xchk_inode()
753 xchk_dinode(sc, &di, sc->ip->i_ino); in xchk_inode()
754 if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT) in xchk_inode()
762 if (S_ISREG(VFS_I(sc->ip)->i_mode)) in xchk_inode()
763 xchk_inode_check_reflink_iflag(sc, sc->ip->i_ino); in xchk_inode()
765 xchk_inode_xref(sc, sc->ip->i_ino, &di); in xchk_inode()