Lines Matching refs:sc
23 struct xfs_scrub *sc, in xchk_setup_parent() argument
26 return xchk_setup_inode_contents(sc, ip, 0); in xchk_setup_parent()
35 struct xfs_scrub *sc; member
63 if (xchk_should_terminate(spc->sc, &error)) in xchk_parent_actor()
72 struct xfs_scrub *sc, in xchk_parent_count_parent_dentries() argument
78 .ino = sc->ip->i_ino, in xchk_parent_count_parent_dentries()
79 .sc = sc, in xchk_parent_count_parent_dentries()
108 error = xfs_readdir(sc->tp, parent, &spc.dc, bufsize); in xchk_parent_count_parent_dentries()
131 struct xfs_scrub *sc, in xchk_parent_validate() argument
135 struct xfs_mount *mp = sc->mp; in xchk_parent_validate()
143 if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT) in xchk_parent_validate()
147 if (sc->ip->i_ino == dnum) { in xchk_parent_validate()
148 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, 0); in xchk_parent_validate()
156 expected_nlink = VFS_I(sc->ip)->i_nlink == 0 ? 0 : 1; in xchk_parent_validate()
172 error = xfs_iget(mp, sc->tp, dnum, XFS_IGET_UNTRUSTED, 0, &dp); in xchk_parent_validate()
175 xchk_fblock_process_error(sc, XFS_DATA_FORK, 0, &error); in xchk_parent_validate()
178 if (!xchk_fblock_xref_process_error(sc, XFS_DATA_FORK, 0, &error)) in xchk_parent_validate()
180 if (dp == sc->ip || !S_ISDIR(VFS_I(dp)->i_mode)) { in xchk_parent_validate()
181 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, 0); in xchk_parent_validate()
193 error = xchk_parent_count_parent_dentries(sc, dp, &nlink); in xchk_parent_validate()
194 if (!xchk_fblock_xref_process_error(sc, XFS_DATA_FORK, 0, in xchk_parent_validate()
198 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, 0); in xchk_parent_validate()
208 xfs_iunlock(sc->ip, sc->ilock_flags); in xchk_parent_validate()
209 sc->ilock_flags = 0; in xchk_parent_validate()
215 error = xchk_parent_count_parent_dentries(sc, dp, &nlink); in xchk_parent_validate()
216 if (!xchk_fblock_xref_process_error(sc, XFS_DATA_FORK, 0, &error)) in xchk_parent_validate()
221 error = xchk_ilock_inverted(sc->ip, XFS_IOLOCK_EXCL); in xchk_parent_validate()
224 sc->ilock_flags = XFS_IOLOCK_EXCL; in xchk_parent_validate()
231 expected_nlink = VFS_I(sc->ip)->i_nlink == 0 ? 0 : 1; in xchk_parent_validate()
234 error = xfs_dir_lookup(sc->tp, sc->ip, &xfs_name_dotdot, &dnum, NULL); in xchk_parent_validate()
235 if (!xchk_fblock_process_error(sc, XFS_DATA_FORK, 0, &error)) in xchk_parent_validate()
251 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, 0); in xchk_parent_validate()
265 struct xfs_scrub *sc) in xchk_parent() argument
267 struct xfs_mount *mp = sc->mp; in xchk_parent()
277 if (!S_ISDIR(VFS_I(sc->ip)->i_mode)) in xchk_parent()
281 if (!xfs_verify_dir_ino(mp, sc->ip->i_ino)) { in xchk_parent()
282 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, 0); in xchk_parent()
293 sc->ilock_flags &= ~(XFS_ILOCK_EXCL | XFS_MMAPLOCK_EXCL); in xchk_parent()
294 xfs_iunlock(sc->ip, XFS_ILOCK_EXCL | XFS_MMAPLOCK_EXCL); in xchk_parent()
297 error = xfs_dir_lookup(sc->tp, sc->ip, &xfs_name_dotdot, &dnum, NULL); in xchk_parent()
298 if (!xchk_fblock_process_error(sc, XFS_DATA_FORK, 0, &error)) in xchk_parent()
301 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, 0); in xchk_parent()
306 if (sc->ip == mp->m_rootip) { in xchk_parent()
307 if (sc->ip->i_ino != mp->m_sb.sb_rootino || in xchk_parent()
308 sc->ip->i_ino != dnum) in xchk_parent()
309 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, 0); in xchk_parent()
314 error = xchk_parent_validate(sc, dnum, &try_again); in xchk_parent()
324 xchk_set_incomplete(sc); in xchk_parent()
330 if ((sc->flags & XCHK_TRY_HARDER) && error == -EDEADLOCK) { in xchk_parent()
332 xchk_set_incomplete(sc); in xchk_parent()