Lines Matching refs:sc

31 	struct xfs_scrub	*sc)
35 xchk_ilock(sc, XFS_IOLOCK_EXCL);
37 error = xchk_trans_alloc(sc, 0);
41 xchk_ilock(sc, XFS_ILOCK_EXCL);
48 struct xfs_scrub *sc,
53 error = xchk_install_handle_inode(sc, ip);
57 return xchk_prepare_iscrub(sc);
68 struct xfs_scrub *sc)
72 struct xfs_mount *mp = sc->mp;
73 struct xfs_inode *ip_in = XFS_I(file_inode(sc->file));
76 xfs_agnumber_t agno = XFS_INO_TO_AGNO(mp, sc->sm->sm_ino);
79 if (xchk_need_intent_drain(sc))
80 xchk_fsgates_enable(sc, XCHK_FSGATES_DRAIN);
83 if (sc->sm->sm_ino == 0 || sc->sm->sm_ino == ip_in->i_ino) {
84 error = xchk_install_live_inode(sc, ip_in);
88 return xchk_prepare_iscrub(sc);
92 if (xfs_internal_inum(mp, sc->sm->sm_ino))
94 if (!xfs_verify_ino(sc->mp, sc->sm->sm_ino))
98 error = xchk_iget(sc, sc->sm->sm_ino, &ip);
100 return xchk_install_handle_iscrub(sc, ip);
128 error = xchk_trans_alloc(sc, 0);
132 error = xchk_iget_agi(sc, sc->sm->sm_ino, &agi_bp, &ip);
135 xchk_trans_cancel(sc);
136 return xchk_install_handle_iscrub(sc, ip);
161 pag = xfs_perag_get(mp, XFS_INO_TO_AGNO(mp, sc->sm->sm_ino));
167 error = xfs_imap(pag, sc->tp, sc->sm->sm_ino, &imap,
188 xchk_trans_cancel(sc);
190 trace_xchk_op_error(sc, agno, XFS_INO_TO_AGBNO(mp, sc->sm->sm_ino),
195 xchk_trans_cancel(sc);
204 struct xfs_scrub *sc,
213 fa = xfs_inode_validate_extsize(sc->mp, value, mode, flags);
215 xchk_ino_set_corrupt(sc, ino);
228 value % sc->mp->m_sb.sb_rextsize > 0)
229 xchk_ino_set_warning(sc, ino);
240 struct xfs_scrub *sc,
249 fa = xfs_inode_validate_cowextsize(sc->mp,
253 xchk_ino_set_corrupt(sc, ino);
259 struct xfs_scrub *sc,
265 struct xfs_mount *mp = sc->mp;
298 xchk_ino_set_corrupt(sc, ino);
304 struct xfs_scrub *sc,
311 struct xfs_mount *mp = sc->mp;
315 xchk_ino_set_warning(sc, ino);
342 xchk_ino_set_corrupt(sc, ino);
347 struct xfs_scrub *sc,
356 xchk_ino_set_corrupt(sc, ino);
362 struct xfs_scrub *sc,
366 struct xfs_mount *mp = sc->mp;
395 xchk_ino_set_corrupt(sc, ino);
406 xchk_ino_set_preen(sc, ino);
412 xchk_ino_set_corrupt(sc, ino);
414 if (dip->di_mode == 0 && sc->ip)
415 xchk_ino_set_corrupt(sc, ino);
419 xchk_ino_set_corrupt(sc, ino);
424 xchk_ino_set_corrupt(sc, ino);
437 xchk_ino_set_warning(sc, ino);
444 xchk_ino_set_warning(sc, ino);
451 xchk_ino_set_corrupt(sc, ino);
455 xchk_ino_set_corrupt(sc, ino);
459 xchk_ino_set_corrupt(sc, ino);
463 xchk_ino_set_corrupt(sc, ino);
467 xchk_ino_set_corrupt(sc, ino);
472 xchk_dinode_nsec(sc, ino, dip, dip->di_atime);
473 xchk_dinode_nsec(sc, ino, dip, dip->di_mtime);
474 xchk_dinode_nsec(sc, ino, dip, dip->di_ctime);
483 xchk_ino_set_corrupt(sc, ino);
487 xchk_ino_set_corrupt(sc, ino);
491 xchk_ino_set_corrupt(sc, ino);
495 xchk_ino_set_corrupt(sc, ino);
504 xchk_ino_set_warning(sc, ino);
519 xchk_ino_set_corrupt(sc, ino);
522 xchk_ino_set_corrupt(sc, ino);
525 xchk_inode_flags(sc, dip, ino, mode, flags);
527 xchk_inode_extsize(sc, dip, ino, mode, flags);
537 xchk_ino_set_corrupt(sc, ino);
541 xchk_ino_set_corrupt(sc, ino);
545 xchk_ino_set_corrupt(sc, ino);
551 xchk_ino_set_corrupt(sc, ino);
553 xchk_ino_set_corrupt(sc, ino);
555 xchk_ino_set_corrupt(sc, ino);
561 xchk_ino_set_corrupt(sc, ino);
568 xchk_ino_set_corrupt(sc, ino);
572 xchk_ino_set_corrupt(sc, ino);
576 xchk_ino_set_corrupt(sc, ino);
580 xchk_dinode_nsec(sc, ino, dip, dip->di_crtime);
581 xchk_inode_flags2(sc, dip, ino, mode, flags, flags2);
582 xchk_inode_cowextsize(sc, dip, ino, mode, flags,
594 struct xfs_scrub *sc,
602 if (!sc->sa.fino_cur || xchk_skip_xref(sc->sm))
605 agino = XFS_INO_TO_AGINO(sc->mp, ino);
611 error = xfs_inobt_lookup(sc->sa.fino_cur, agino, XFS_LOOKUP_LE,
613 if (!xchk_should_check_xref(sc, &error, &sc->sa.fino_cur) ||
617 error = xfs_inobt_get_rec(sc->sa.fino_cur, &rec, &has_record);
618 if (!xchk_should_check_xref(sc, &error, &sc->sa.fino_cur) ||
631 xchk_btree_xref_set_corrupt(sc, sc->sa.fino_cur, 0);
637 struct xfs_scrub *sc,
645 if (xchk_skip_xref(sc->sm))
649 error = xfs_bmap_count_blocks(sc->tp, sc->ip, XFS_DATA_FORK,
651 if (!xchk_should_check_xref(sc, &error, NULL))
654 xchk_ino_xref_set_corrupt(sc, sc->ip->i_ino);
656 error = xfs_bmap_count_blocks(sc->tp, sc->ip, XFS_ATTR_FORK,
658 if (!xchk_should_check_xref(sc, &error, NULL))
661 xchk_ino_xref_set_corrupt(sc, sc->ip->i_ino);
665 xchk_ino_xref_set_corrupt(sc, sc->ip->i_ino);
671 struct xfs_scrub *sc,
679 if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)
682 agno = XFS_INO_TO_AGNO(sc->mp, ino);
683 agbno = XFS_INO_TO_AGBNO(sc->mp, ino);
685 error = xchk_ag_init_existing(sc, agno, &sc->sa);
686 if (!xchk_xref_process_error(sc, agno, agbno, &error))
689 xchk_xref_is_used_space(sc, agbno, 1);
690 xchk_inode_xref_finobt(sc, ino);
691 xchk_xref_is_only_owned_by(sc, agbno, 1, &XFS_RMAP_OINFO_INODES);
692 xchk_xref_is_not_shared(sc, agbno, 1);
693 xchk_xref_is_not_cow_staging(sc, agbno, 1);
694 xchk_inode_xref_bmap(sc, dip);
697 xchk_ag_free(sc, &sc->sa);
708 struct xfs_scrub *sc,
711 struct xfs_mount *mp = sc->mp;
718 error = xfs_reflink_inode_has_shared_extents(sc->tp, sc->ip,
720 if (!xchk_xref_process_error(sc, XFS_INO_TO_AGNO(mp, ino),
723 if (xfs_is_reflink_inode(sc->ip) && !has_shared)
724 xchk_ino_set_preen(sc, ino);
725 else if (!xfs_is_reflink_inode(sc->ip) && has_shared)
726 xchk_ino_set_corrupt(sc, ino);
732 struct xfs_scrub *sc)
738 * If sc->ip is NULL, that means that the setup function called
742 if (!sc->ip) {
743 xchk_ino_set_corrupt(sc, sc->sm->sm_ino);
748 xfs_inode_to_disk(sc->ip, &di, 0);
749 xchk_dinode(sc, &di, sc->ip->i_ino);
750 if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)
758 if (S_ISREG(VFS_I(sc->ip)->i_mode))
759 xchk_inode_check_reflink_iflag(sc, sc->ip->i_ino);
761 xchk_inode_xref(sc, sc->ip->i_ino, &di);