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()
258 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
269 xchk_ino_set_preen(sc, ino); in xchk_dinode()
274 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
276 if (dip->di_mode == 0 && sc->ip) in xchk_dinode()
277 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
281 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
284 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
294 xchk_ino_set_warning(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()
313 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
317 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
322 xchk_dinode_nsec(sc, ino, dip, dip->di_atime); in xchk_dinode()
323 xchk_dinode_nsec(sc, ino, dip, dip->di_mtime); in xchk_dinode()
324 xchk_dinode_nsec(sc, ino, dip, dip->di_ctime); in xchk_dinode()
333 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
337 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
341 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
345 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
354 xchk_ino_set_warning(sc, ino); in xchk_dinode()
369 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
372 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
375 xchk_inode_flags(sc, dip, ino, mode, flags); in xchk_dinode()
377 xchk_inode_extsize(sc, dip, ino, mode, flags); in xchk_dinode()
385 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
389 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
393 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
399 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
401 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
403 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
409 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
417 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
421 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
425 xchk_ino_set_corrupt(sc, ino); in xchk_dinode()
429 xchk_dinode_nsec(sc, ino, dip, dip->di_crtime); in xchk_dinode()
430 xchk_inode_flags2(sc, dip, ino, mode, flags, flags2); in xchk_dinode()
431 xchk_inode_cowextsize(sc, dip, ino, mode, flags, in xchk_dinode()
443 struct xfs_scrub *sc, in xchk_inode_xref_finobt() argument
451 if (!sc->sa.fino_cur || xchk_skip_xref(sc->sm)) in xchk_inode_xref_finobt()
454 agino = XFS_INO_TO_AGINO(sc->mp, ino); in xchk_inode_xref_finobt()
460 error = xfs_inobt_lookup(sc->sa.fino_cur, agino, XFS_LOOKUP_LE, in xchk_inode_xref_finobt()
462 if (!xchk_should_check_xref(sc, &error, &sc->sa.fino_cur) || in xchk_inode_xref_finobt()
466 error = xfs_inobt_get_rec(sc->sa.fino_cur, &rec, &has_record); in xchk_inode_xref_finobt()
467 if (!xchk_should_check_xref(sc, &error, &sc->sa.fino_cur) || in xchk_inode_xref_finobt()
480 xchk_btree_xref_set_corrupt(sc, sc->sa.fino_cur, 0); in xchk_inode_xref_finobt()
486 struct xfs_scrub *sc, in xchk_inode_xref_bmap() argument
494 if (xchk_skip_xref(sc->sm)) in xchk_inode_xref_bmap()
498 error = xfs_bmap_count_blocks(sc->tp, sc->ip, XFS_DATA_FORK, in xchk_inode_xref_bmap()
500 if (!xchk_should_check_xref(sc, &error, NULL)) in xchk_inode_xref_bmap()
503 xchk_ino_xref_set_corrupt(sc, sc->ip->i_ino); in xchk_inode_xref_bmap()
505 error = xfs_bmap_count_blocks(sc->tp, sc->ip, XFS_ATTR_FORK, in xchk_inode_xref_bmap()
507 if (!xchk_should_check_xref(sc, &error, NULL)) in xchk_inode_xref_bmap()
510 xchk_ino_xref_set_corrupt(sc, sc->ip->i_ino); in xchk_inode_xref_bmap()
514 xchk_ino_xref_set_corrupt(sc, sc->ip->i_ino); in xchk_inode_xref_bmap()
520 struct xfs_scrub *sc, in xchk_inode_xref() argument
528 if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT) in xchk_inode_xref()
531 agno = XFS_INO_TO_AGNO(sc->mp, ino); in xchk_inode_xref()
532 agbno = XFS_INO_TO_AGBNO(sc->mp, ino); in xchk_inode_xref()
534 error = xchk_ag_init_existing(sc, agno, &sc->sa); in xchk_inode_xref()
535 if (!xchk_xref_process_error(sc, agno, agbno, &error)) in xchk_inode_xref()
538 xchk_xref_is_used_space(sc, agbno, 1); in xchk_inode_xref()
539 xchk_inode_xref_finobt(sc, ino); in xchk_inode_xref()
540 xchk_xref_is_owned_by(sc, agbno, 1, &XFS_RMAP_OINFO_INODES); in xchk_inode_xref()
541 xchk_xref_is_not_shared(sc, agbno, 1); in xchk_inode_xref()
542 xchk_inode_xref_bmap(sc, dip); in xchk_inode_xref()
545 xchk_ag_free(sc, &sc->sa); in xchk_inode_xref()
556 struct xfs_scrub *sc, in xchk_inode_check_reflink_iflag() argument
559 struct xfs_mount *mp = sc->mp; in xchk_inode_check_reflink_iflag()
566 error = xfs_reflink_inode_has_shared_extents(sc->tp, sc->ip, in xchk_inode_check_reflink_iflag()
568 if (!xchk_xref_process_error(sc, XFS_INO_TO_AGNO(mp, ino), in xchk_inode_check_reflink_iflag()
571 if (xfs_is_reflink_inode(sc->ip) && !has_shared) in xchk_inode_check_reflink_iflag()
572 xchk_ino_set_preen(sc, ino); in xchk_inode_check_reflink_iflag()
573 else if (!xfs_is_reflink_inode(sc->ip) && has_shared) in xchk_inode_check_reflink_iflag()
574 xchk_ino_set_corrupt(sc, ino); in xchk_inode_check_reflink_iflag()
580 struct xfs_scrub *sc) in xchk_inode() argument
590 if (!sc->ip) { in xchk_inode()
591 xchk_ino_set_corrupt(sc, sc->sm->sm_ino); in xchk_inode()
596 xfs_inode_to_disk(sc->ip, &di, 0); in xchk_inode()
597 xchk_dinode(sc, &di, sc->ip->i_ino); in xchk_inode()
598 if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT) in xchk_inode()
606 if (S_ISREG(VFS_I(sc->ip)->i_mode)) in xchk_inode()
607 xchk_inode_check_reflink_iflag(sc, sc->ip->i_ino); in xchk_inode()
609 xchk_inode_xref(sc, sc->ip->i_ino, &di); in xchk_inode()