Lines Matching refs:sc
31 struct xfs_scrub *sc, in xchk_setup_inode() argument
40 error = xchk_get_inode(sc, ip); in xchk_setup_inode()
46 return xchk_trans_alloc(sc, 0); in xchk_setup_inode()
52 sc->ilock_flags = XFS_IOLOCK_EXCL | XFS_MMAPLOCK_EXCL; in xchk_setup_inode()
53 xfs_ilock(sc->ip, sc->ilock_flags); in xchk_setup_inode()
54 error = xchk_trans_alloc(sc, 0); in xchk_setup_inode()
57 sc->ilock_flags |= XFS_ILOCK_EXCL; in xchk_setup_inode()
58 xfs_ilock(sc->ip, XFS_ILOCK_EXCL); in xchk_setup_inode()
70 struct xfs_scrub *sc, in xchk_inode_extsize() argument
78 fa = xfs_inode_validate_extsize(sc->mp, be32_to_cpu(dip->di_extsize), in xchk_inode_extsize()
81 xchk_ino_set_corrupt(sc, ino); in xchk_inode_extsize()
92 struct xfs_scrub *sc, in xchk_inode_cowextsize() argument
101 fa = xfs_inode_validate_cowextsize(sc->mp, in xchk_inode_cowextsize()
105 xchk_ino_set_corrupt(sc, ino); in xchk_inode_cowextsize()
111 struct xfs_scrub *sc, in xchk_inode_flags() argument
117 struct xfs_mount *mp = sc->mp; in xchk_inode_flags()
150 xchk_ino_set_corrupt(sc, ino); in xchk_inode_flags()
156 struct xfs_scrub *sc, in xchk_inode_flags2() argument
163 struct xfs_mount *mp = sc->mp; in xchk_inode_flags2()
167 xchk_ino_set_warning(sc, ino); in xchk_inode_flags2()
199 xchk_ino_set_corrupt(sc, ino); in xchk_inode_flags2()
204 struct xfs_scrub *sc, in xchk_dinode_nsec() argument
213 xchk_ino_set_corrupt(sc, ino); in xchk_dinode_nsec()
219 struct xfs_scrub *sc, in xchk_dinode() argument
223 struct xfs_mount *mp = sc->mp; in xchk_dinode()
250 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
261 xchk_ino_set_preen(sc, ino); in xchk_dinode()
266 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
268 if (dip->di_mode == 0 && sc->ip) in xchk_dinode()
269 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
273 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
276 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
286 xchk_ino_set_warning(sc, ino); in xchk_dinode()
293 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
297 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
301 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
305 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
309 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
314 xchk_dinode_nsec(sc, ino, dip, dip->di_atime); in xchk_dinode()
315 xchk_dinode_nsec(sc, ino, dip, dip->di_mtime); in xchk_dinode()
316 xchk_dinode_nsec(sc, ino, dip, dip->di_ctime); in xchk_dinode()
325 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
329 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
333 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
337 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
346 xchk_ino_set_warning(sc, ino); in xchk_dinode()
361 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
364 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
367 xchk_inode_flags(sc, dip, ino, mode, flags); in xchk_dinode()
369 xchk_inode_extsize(sc, dip, ino, mode, flags); in xchk_dinode()
377 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
381 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
385 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
391 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
393 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
395 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
401 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
409 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
413 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
417 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
421 xchk_dinode_nsec(sc, ino, dip, dip->di_crtime); in xchk_dinode()
422 xchk_inode_flags2(sc, dip, ino, mode, flags, flags2); in xchk_dinode()
423 xchk_inode_cowextsize(sc, dip, ino, mode, flags, in xchk_dinode()
435 struct xfs_scrub *sc, in xchk_inode_xref_finobt() argument
443 if (!sc->sa.fino_cur || xchk_skip_xref(sc->sm)) in xchk_inode_xref_finobt()
446 agino = XFS_INO_TO_AGINO(sc->mp, ino); in xchk_inode_xref_finobt()
452 error = xfs_inobt_lookup(sc->sa.fino_cur, agino, XFS_LOOKUP_LE, in xchk_inode_xref_finobt()
454 if (!xchk_should_check_xref(sc, &error, &sc->sa.fino_cur) || in xchk_inode_xref_finobt()
458 error = xfs_inobt_get_rec(sc->sa.fino_cur, &rec, &has_record); in xchk_inode_xref_finobt()
459 if (!xchk_should_check_xref(sc, &error, &sc->sa.fino_cur) || in xchk_inode_xref_finobt()
472 xchk_btree_xref_set_corrupt(sc, sc->sa.fino_cur, 0); in xchk_inode_xref_finobt()
478 struct xfs_scrub *sc, in xchk_inode_xref_bmap() argument
486 if (xchk_skip_xref(sc->sm)) in xchk_inode_xref_bmap()
490 error = xfs_bmap_count_blocks(sc->tp, sc->ip, XFS_DATA_FORK, in xchk_inode_xref_bmap()
492 if (!xchk_should_check_xref(sc, &error, NULL)) in xchk_inode_xref_bmap()
495 xchk_ino_xref_set_corrupt(sc, sc->ip->i_ino); in xchk_inode_xref_bmap()
497 error = xfs_bmap_count_blocks(sc->tp, sc->ip, XFS_ATTR_FORK, in xchk_inode_xref_bmap()
499 if (!xchk_should_check_xref(sc, &error, NULL)) in xchk_inode_xref_bmap()
502 xchk_ino_xref_set_corrupt(sc, sc->ip->i_ino); in xchk_inode_xref_bmap()
506 xchk_ino_xref_set_corrupt(sc, sc->ip->i_ino); in xchk_inode_xref_bmap()
512 struct xfs_scrub *sc, in xchk_inode_xref() argument
520 if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT) in xchk_inode_xref()
523 agno = XFS_INO_TO_AGNO(sc->mp, ino); in xchk_inode_xref()
524 agbno = XFS_INO_TO_AGBNO(sc->mp, ino); in xchk_inode_xref()
526 error = xchk_ag_init(sc, agno, &sc->sa); in xchk_inode_xref()
527 if (!xchk_xref_process_error(sc, agno, agbno, &error)) in xchk_inode_xref()
530 xchk_xref_is_used_space(sc, agbno, 1); in xchk_inode_xref()
531 xchk_inode_xref_finobt(sc, ino); in xchk_inode_xref()
532 xchk_xref_is_owned_by(sc, agbno, 1, &XFS_RMAP_OINFO_INODES); in xchk_inode_xref()
533 xchk_xref_is_not_shared(sc, agbno, 1); in xchk_inode_xref()
534 xchk_inode_xref_bmap(sc, dip); in xchk_inode_xref()
536 xchk_ag_free(sc, &sc->sa); in xchk_inode_xref()
547 struct xfs_scrub *sc, in xchk_inode_check_reflink_iflag() argument
550 struct xfs_mount *mp = sc->mp; in xchk_inode_check_reflink_iflag()
557 error = xfs_reflink_inode_has_shared_extents(sc->tp, sc->ip, in xchk_inode_check_reflink_iflag()
559 if (!xchk_xref_process_error(sc, XFS_INO_TO_AGNO(mp, ino), in xchk_inode_check_reflink_iflag()
562 if (xfs_is_reflink_inode(sc->ip) && !has_shared) in xchk_inode_check_reflink_iflag()
563 xchk_ino_set_preen(sc, ino); in xchk_inode_check_reflink_iflag()
564 else if (!xfs_is_reflink_inode(sc->ip) && has_shared) in xchk_inode_check_reflink_iflag()
565 xchk_ino_set_corrupt(sc, ino); in xchk_inode_check_reflink_iflag()
571 struct xfs_scrub *sc) in xchk_inode() argument
581 if (!sc->ip) { in xchk_inode()
582 xchk_ino_set_corrupt(sc, sc->sm->sm_ino); in xchk_inode()
587 xfs_inode_to_disk(sc->ip, &di, 0); in xchk_inode()
588 xchk_dinode(sc, &di, sc->ip->i_ino); in xchk_inode()
589 if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT) in xchk_inode()
597 if (S_ISREG(VFS_I(sc->ip)->i_mode)) in xchk_inode()
598 xchk_inode_check_reflink_iflag(sc, sc->ip->i_ino); in xchk_inode()
600 xchk_inode_xref(sc, sc->ip->i_ino, &di); in xchk_inode()