Lines Matching refs:sc

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