Lines Matching refs:sc
23 struct xfs_scrub *sc) in xchk_setup_parent() argument
25 return xchk_setup_inode_contents(sc, 0); in xchk_setup_parent()
34 struct xfs_scrub *sc; member
62 if (xchk_should_terminate(spc->sc, &error)) in xchk_parent_actor()
71 struct xfs_scrub *sc, in xchk_parent_count_parent_dentries() argument
77 .ino = sc->ip->i_ino, in xchk_parent_count_parent_dentries()
78 .sc = sc, in xchk_parent_count_parent_dentries()
107 error = xfs_readdir(sc->tp, parent, &spc.dc, bufsize); in xchk_parent_count_parent_dentries()
130 struct xfs_scrub *sc, in xchk_parent_validate() argument
134 struct xfs_mount *mp = sc->mp; in xchk_parent_validate()
142 if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT) in xchk_parent_validate()
146 if (sc->ip->i_ino == dnum) { in xchk_parent_validate()
147 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, 0); in xchk_parent_validate()
155 expected_nlink = VFS_I(sc->ip)->i_nlink == 0 ? 0 : 1; in xchk_parent_validate()
171 error = xfs_iget(mp, sc->tp, dnum, XFS_IGET_UNTRUSTED, 0, &dp); in xchk_parent_validate()
174 xchk_fblock_process_error(sc, XFS_DATA_FORK, 0, &error); in xchk_parent_validate()
177 if (!xchk_fblock_xref_process_error(sc, XFS_DATA_FORK, 0, &error)) in xchk_parent_validate()
179 if (dp == sc->ip || !S_ISDIR(VFS_I(dp)->i_mode)) { in xchk_parent_validate()
180 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, 0); in xchk_parent_validate()
192 error = xchk_parent_count_parent_dentries(sc, dp, &nlink); in xchk_parent_validate()
193 if (!xchk_fblock_xref_process_error(sc, XFS_DATA_FORK, 0, in xchk_parent_validate()
197 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, 0); in xchk_parent_validate()
207 xfs_iunlock(sc->ip, sc->ilock_flags); in xchk_parent_validate()
208 sc->ilock_flags = 0; in xchk_parent_validate()
214 error = xchk_parent_count_parent_dentries(sc, dp, &nlink); in xchk_parent_validate()
215 if (!xchk_fblock_xref_process_error(sc, XFS_DATA_FORK, 0, &error)) in xchk_parent_validate()
220 error = xchk_ilock_inverted(sc->ip, XFS_IOLOCK_EXCL); in xchk_parent_validate()
223 sc->ilock_flags = XFS_IOLOCK_EXCL; in xchk_parent_validate()
230 expected_nlink = VFS_I(sc->ip)->i_nlink == 0 ? 0 : 1; in xchk_parent_validate()
233 error = xfs_dir_lookup(sc->tp, sc->ip, &xfs_name_dotdot, &dnum, NULL); in xchk_parent_validate()
234 if (!xchk_fblock_process_error(sc, XFS_DATA_FORK, 0, &error)) in xchk_parent_validate()
250 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, 0); in xchk_parent_validate()
264 struct xfs_scrub *sc) in xchk_parent() argument
266 struct xfs_mount *mp = sc->mp; in xchk_parent()
276 if (!S_ISDIR(VFS_I(sc->ip)->i_mode)) in xchk_parent()
280 if (!xfs_verify_dir_ino(mp, sc->ip->i_ino)) { in xchk_parent()
281 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, 0); in xchk_parent()
292 sc->ilock_flags &= ~(XFS_ILOCK_EXCL | XFS_MMAPLOCK_EXCL); in xchk_parent()
293 xfs_iunlock(sc->ip, XFS_ILOCK_EXCL | XFS_MMAPLOCK_EXCL); in xchk_parent()
296 error = xfs_dir_lookup(sc->tp, sc->ip, &xfs_name_dotdot, &dnum, NULL); in xchk_parent()
297 if (!xchk_fblock_process_error(sc, XFS_DATA_FORK, 0, &error)) in xchk_parent()
300 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, 0); in xchk_parent()
305 if (sc->ip == mp->m_rootip) { in xchk_parent()
306 if (sc->ip->i_ino != mp->m_sb.sb_rootino || in xchk_parent()
307 sc->ip->i_ino != dnum) in xchk_parent()
308 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, 0); in xchk_parent()
313 error = xchk_parent_validate(sc, dnum, &try_again); in xchk_parent()
323 xchk_set_incomplete(sc); in xchk_parent()
329 if ((sc->flags & XCHK_TRY_HARDER) && error == -EDEADLOCK) { in xchk_parent()
331 xchk_set_incomplete(sc); in xchk_parent()