Lines Matching refs:sc
31 struct xfs_scrub *sc) in xchk_setup_inode() argument
39 error = xchk_get_inode(sc); in xchk_setup_inode()
45 return xchk_trans_alloc(sc, 0); in xchk_setup_inode()
51 sc->ilock_flags = XFS_IOLOCK_EXCL | XFS_MMAPLOCK_EXCL; in xchk_setup_inode()
52 xfs_ilock(sc->ip, sc->ilock_flags); in xchk_setup_inode()
53 error = xchk_trans_alloc(sc, 0); in xchk_setup_inode()
56 sc->ilock_flags |= XFS_ILOCK_EXCL; in xchk_setup_inode()
57 xfs_ilock(sc->ip, XFS_ILOCK_EXCL); in xchk_setup_inode()
69 struct xfs_scrub *sc, in xchk_inode_extsize() argument
78 fa = xfs_inode_validate_extsize(sc->mp, value, mode, flags); in xchk_inode_extsize()
80 xchk_ino_set_corrupt(sc, ino); in xchk_inode_extsize()
93 value % sc->mp->m_sb.sb_rextsize > 0) in xchk_inode_extsize()
94 xchk_ino_set_warning(sc, ino); in xchk_inode_extsize()
105 struct xfs_scrub *sc, in xchk_inode_cowextsize() argument
114 fa = xfs_inode_validate_cowextsize(sc->mp, in xchk_inode_cowextsize()
118 xchk_ino_set_corrupt(sc, ino); in xchk_inode_cowextsize()
124 struct xfs_scrub *sc, in xchk_inode_flags() argument
130 struct xfs_mount *mp = sc->mp; in xchk_inode_flags()
163 xchk_ino_set_corrupt(sc, ino); in xchk_inode_flags()
169 struct xfs_scrub *sc, in xchk_inode_flags2() argument
176 struct xfs_mount *mp = sc->mp; in xchk_inode_flags2()
180 xchk_ino_set_warning(sc, ino); in xchk_inode_flags2()
207 xchk_ino_set_corrupt(sc, ino); in xchk_inode_flags2()
212 struct xfs_scrub *sc, in xchk_dinode_nsec() argument
221 xchk_ino_set_corrupt(sc, ino); in xchk_dinode_nsec()
227 struct xfs_scrub *sc, in xchk_dinode() argument
231 struct xfs_mount *mp = sc->mp; in xchk_dinode()
260 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
271 xchk_ino_set_preen(sc, ino); in xchk_dinode()
277 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
279 if (dip->di_mode == 0 && sc->ip) in xchk_dinode()
280 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
284 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
289 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
302 xchk_ino_set_warning(sc, ino); in xchk_dinode()
309 xchk_ino_set_warning(sc, ino); in xchk_dinode()
316 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
320 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
324 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
328 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
332 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
337 xchk_dinode_nsec(sc, ino, dip, dip->di_atime); in xchk_dinode()
338 xchk_dinode_nsec(sc, ino, dip, dip->di_mtime); in xchk_dinode()
339 xchk_dinode_nsec(sc, ino, dip, dip->di_ctime); in xchk_dinode()
348 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
352 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
356 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
360 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
369 xchk_ino_set_warning(sc, ino); in xchk_dinode()
384 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
387 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
390 xchk_inode_flags(sc, dip, ino, mode, flags); in xchk_dinode()
392 xchk_inode_extsize(sc, dip, ino, mode, flags); in xchk_dinode()
402 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
406 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
410 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
416 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
418 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
420 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
426 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
433 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
437 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
441 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
445 xchk_dinode_nsec(sc, ino, dip, dip->di_crtime); in xchk_dinode()
446 xchk_inode_flags2(sc, dip, ino, mode, flags, flags2); in xchk_dinode()
447 xchk_inode_cowextsize(sc, dip, ino, mode, flags, in xchk_dinode()
459 struct xfs_scrub *sc, in xchk_inode_xref_finobt() argument
467 if (!sc->sa.fino_cur || xchk_skip_xref(sc->sm)) in xchk_inode_xref_finobt()
470 agino = XFS_INO_TO_AGINO(sc->mp, ino); in xchk_inode_xref_finobt()
476 error = xfs_inobt_lookup(sc->sa.fino_cur, agino, XFS_LOOKUP_LE, in xchk_inode_xref_finobt()
478 if (!xchk_should_check_xref(sc, &error, &sc->sa.fino_cur) || in xchk_inode_xref_finobt()
482 error = xfs_inobt_get_rec(sc->sa.fino_cur, &rec, &has_record); in xchk_inode_xref_finobt()
483 if (!xchk_should_check_xref(sc, &error, &sc->sa.fino_cur) || in xchk_inode_xref_finobt()
496 xchk_btree_xref_set_corrupt(sc, sc->sa.fino_cur, 0); in xchk_inode_xref_finobt()
502 struct xfs_scrub *sc, in xchk_inode_xref_bmap() argument
510 if (xchk_skip_xref(sc->sm)) in xchk_inode_xref_bmap()
514 error = xfs_bmap_count_blocks(sc->tp, sc->ip, XFS_DATA_FORK, in xchk_inode_xref_bmap()
516 if (!xchk_should_check_xref(sc, &error, NULL)) in xchk_inode_xref_bmap()
519 xchk_ino_xref_set_corrupt(sc, sc->ip->i_ino); in xchk_inode_xref_bmap()
521 error = xfs_bmap_count_blocks(sc->tp, sc->ip, XFS_ATTR_FORK, in xchk_inode_xref_bmap()
523 if (!xchk_should_check_xref(sc, &error, NULL)) in xchk_inode_xref_bmap()
526 xchk_ino_xref_set_corrupt(sc, sc->ip->i_ino); in xchk_inode_xref_bmap()
530 xchk_ino_xref_set_corrupt(sc, sc->ip->i_ino); in xchk_inode_xref_bmap()
536 struct xfs_scrub *sc, in xchk_inode_xref() argument
544 if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT) in xchk_inode_xref()
547 agno = XFS_INO_TO_AGNO(sc->mp, ino); in xchk_inode_xref()
548 agbno = XFS_INO_TO_AGBNO(sc->mp, ino); in xchk_inode_xref()
550 error = xchk_ag_init_existing(sc, agno, &sc->sa); in xchk_inode_xref()
551 if (!xchk_xref_process_error(sc, agno, agbno, &error)) in xchk_inode_xref()
554 xchk_xref_is_used_space(sc, agbno, 1); in xchk_inode_xref()
555 xchk_inode_xref_finobt(sc, ino); in xchk_inode_xref()
556 xchk_xref_is_owned_by(sc, agbno, 1, &XFS_RMAP_OINFO_INODES); in xchk_inode_xref()
557 xchk_xref_is_not_shared(sc, agbno, 1); in xchk_inode_xref()
558 xchk_inode_xref_bmap(sc, dip); in xchk_inode_xref()
561 xchk_ag_free(sc, &sc->sa); in xchk_inode_xref()
572 struct xfs_scrub *sc, in xchk_inode_check_reflink_iflag() argument
575 struct xfs_mount *mp = sc->mp; in xchk_inode_check_reflink_iflag()
582 error = xfs_reflink_inode_has_shared_extents(sc->tp, sc->ip, in xchk_inode_check_reflink_iflag()
584 if (!xchk_xref_process_error(sc, XFS_INO_TO_AGNO(mp, ino), in xchk_inode_check_reflink_iflag()
587 if (xfs_is_reflink_inode(sc->ip) && !has_shared) in xchk_inode_check_reflink_iflag()
588 xchk_ino_set_preen(sc, ino); in xchk_inode_check_reflink_iflag()
589 else if (!xfs_is_reflink_inode(sc->ip) && has_shared) in xchk_inode_check_reflink_iflag()
590 xchk_ino_set_corrupt(sc, ino); in xchk_inode_check_reflink_iflag()
596 struct xfs_scrub *sc) in xchk_inode() argument
606 if (!sc->ip) { in xchk_inode()
607 xchk_ino_set_corrupt(sc, sc->sm->sm_ino); in xchk_inode()
612 xfs_inode_to_disk(sc->ip, &di, 0); in xchk_inode()
613 xchk_dinode(sc, &di, sc->ip->i_ino); in xchk_inode()
614 if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT) in xchk_inode()
622 if (S_ISREG(VFS_I(sc->ip)->i_mode)) in xchk_inode()
623 xchk_inode_check_reflink_iflag(sc, sc->ip->i_ino); in xchk_inode()
625 xchk_inode_xref(sc, sc->ip->i_ino, &di); in xchk_inode()