Lines Matching refs:sc

34 	struct xfs_scrub	*sc)  in xchk_setup_parent()  argument
38 if (xchk_could_repair(sc)) { in xchk_setup_parent()
39 error = xrep_setup_parent(sc); in xchk_setup_parent()
44 return xchk_setup_inode_contents(sc, 0); in xchk_setup_parent()
52 struct xfs_scrub *sc; member
59 struct xfs_scrub *sc, in xchk_parent_actor() argument
72 if (!xchk_fblock_xref_process_error(sc, XFS_DATA_FORK, 0, &error)) in xchk_parent_actor()
75 if (sc->ip->i_ino == ino) in xchk_parent_actor()
78 if (xchk_should_terminate(spc->sc, &error)) in xchk_parent_actor()
114 struct xfs_scrub *sc, in xchk_parent_validate() argument
118 .sc = sc, in xchk_parent_validate()
121 struct xfs_mount *mp = sc->mp; in xchk_parent_validate()
128 if (sc->ip == mp->m_rootip) { in xchk_parent_validate()
129 if (sc->ip->i_ino != mp->m_sb.sb_rootino || in xchk_parent_validate()
130 sc->ip->i_ino != parent_ino) in xchk_parent_validate()
131 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, 0); in xchk_parent_validate()
136 if (sc->ip->i_ino == parent_ino) { in xchk_parent_validate()
137 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, 0); in xchk_parent_validate()
145 expected_nlink = VFS_I(sc->ip)->i_nlink == 0 ? 0 : 1; in xchk_parent_validate()
156 error = xchk_iget(sc, parent_ino, &dp); in xchk_parent_validate()
159 xchk_fblock_process_error(sc, XFS_DATA_FORK, 0, &error); in xchk_parent_validate()
162 if (!xchk_fblock_xref_process_error(sc, XFS_DATA_FORK, 0, &error)) in xchk_parent_validate()
164 if (dp == sc->ip || xrep_is_tempfile(dp) || in xchk_parent_validate()
166 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, 0); in xchk_parent_validate()
172 xchk_iunlock(sc, XFS_ILOCK_EXCL); in xchk_parent_validate()
173 xchk_ilock(sc, XFS_ILOCK_EXCL); in xchk_parent_validate()
184 xchk_set_incomplete(sc); in xchk_parent_validate()
189 error = xchk_dir_walk(sc, dp, xchk_parent_actor, &spc); in xchk_parent_validate()
190 if (!xchk_fblock_xref_process_error(sc, XFS_DATA_FORK, 0, &error)) in xchk_parent_validate()
198 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, 0); in xchk_parent_validate()
203 xchk_irele(sc, dp); in xchk_parent_validate()
230 struct xfs_scrub *sc; member
258 struct xfs_scrub *sc, in xchk_parent_scan_dotdot() argument
274 error = xfs_parent_from_attr(sc->mp, attr_flags, name, namelen, value, in xchk_parent_scan_dotdot()
290 struct xfs_scrub *sc = pp->sc; in xchk_parent_pptr_and_dotdot() local
294 error = xchk_dir_lookup(sc, sc->ip, &xfs_name_dotdot, &pp->parent_ino); in xchk_parent_pptr_and_dotdot()
295 if (!xchk_fblock_process_error(sc, XFS_DATA_FORK, 0, &error)) in xchk_parent_pptr_and_dotdot()
297 if (!xfs_verify_dir_ino(sc->mp, pp->parent_ino)) { in xchk_parent_pptr_and_dotdot()
298 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, 0); in xchk_parent_pptr_and_dotdot()
303 if (sc->ip == sc->mp->m_rootip) { in xchk_parent_pptr_and_dotdot()
304 if (sc->ip->i_ino != pp->parent_ino) in xchk_parent_pptr_and_dotdot()
305 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, 0); in xchk_parent_pptr_and_dotdot()
313 if (VFS_I(sc->ip)->i_nlink == 0) in xchk_parent_pptr_and_dotdot()
316 if (pp->sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT) in xchk_parent_pptr_and_dotdot()
320 error = xchk_xattr_walk(sc, sc->ip, xchk_parent_scan_dotdot, NULL, pp); in xchk_parent_pptr_and_dotdot()
327 xchk_fblock_set_corrupt(sc, XFS_ATTR_FORK, 0); in xchk_parent_pptr_and_dotdot()
339 struct xfs_scrub *sc, in xchk_parent_lock_dir() argument
370 struct xfs_scrub *sc = pp->sc; in xchk_parent_dirent() local
378 error = xchk_dir_lookup(sc, dp, xname, &child_ino); in xchk_parent_dirent()
380 xchk_fblock_xref_set_corrupt(sc, XFS_ATTR_FORK, 0); in xchk_parent_dirent()
383 if (!xchk_fblock_xref_process_error(sc, XFS_ATTR_FORK, 0, &error)) in xchk_parent_dirent()
387 if (child_ino != sc->ip->i_ino) { in xchk_parent_dirent()
388 xchk_fblock_xref_set_corrupt(sc, XFS_ATTR_FORK, 0); in xchk_parent_dirent()
402 struct xfs_scrub *sc = pp->sc; in xchk_parent_iget() local
408 error = xfs_dir_ino_validate(sc->mp, parent_ino); in xchk_parent_iget()
410 xchk_fblock_set_corrupt(sc, XFS_ATTR_FORK, 0); in xchk_parent_iget()
414 error = xchk_iget(sc, parent_ino, &ip); in xchk_parent_iget()
416 xchk_fblock_set_corrupt(sc, XFS_ATTR_FORK, 0); in xchk_parent_iget()
419 if (!xchk_fblock_xref_process_error(sc, XFS_ATTR_FORK, 0, &error)) in xchk_parent_iget()
424 xchk_fblock_xref_set_corrupt(sc, XFS_ATTR_FORK, 0); in xchk_parent_iget()
430 xchk_fblock_xref_set_corrupt(sc, XFS_ATTR_FORK, 0); in xchk_parent_iget()
437 xchk_irele(sc, ip); in xchk_parent_iget()
448 struct xfs_scrub *sc, in xchk_parent_scan_attr() argument
471 error = xfs_parent_from_attr(sc->mp, attr_flags, name, namelen, value, in xchk_parent_scan_attr()
474 xchk_fblock_set_corrupt(sc, XFS_ATTR_FORK, 0); in xchk_parent_scan_attr()
479 if (parent_ino == sc->ip->i_ino) { in xchk_parent_scan_attr()
480 xchk_fblock_set_corrupt(sc, XFS_ATTR_FORK, 0); in xchk_parent_scan_attr()
493 lockmode = xchk_parent_lock_dir(sc, dp); in xchk_parent_scan_attr()
501 trace_xchk_parent_defer(sc->ip, &xname, dp->i_ino); in xchk_parent_scan_attr()
505 if (!xchk_fblock_xref_process_error(sc, XFS_ATTR_FORK, 0, in xchk_parent_scan_attr()
510 if (!xchk_fblock_xref_process_error(sc, XFS_ATTR_FORK, 0, in xchk_parent_scan_attr()
524 xchk_irele(sc, dp); in xchk_parent_scan_attr()
539 struct xfs_scrub *sc = pp->sc; in xchk_parent_revalidate_pptr() local
542 error = xfs_parent_lookup(sc->tp, sc->ip, xname, pptr, &pp->pptr_args); in xchk_parent_revalidate_pptr()
561 struct xfs_scrub *sc = pp->sc; in xchk_parent_slow_pptr() local
571 if (!xchk_fblock_xref_process_error(sc, XFS_ATTR_FORK, 0, in xchk_parent_slow_pptr()
586 lockmode = xchk_parent_lock_dir(sc, dp); in xchk_parent_slow_pptr()
588 trace_xchk_parent_slowpath(sc->ip, xname, dp->i_ino); in xchk_parent_slow_pptr()
596 xchk_iunlock(sc, sc->ilock_flags); in xchk_parent_slow_pptr()
599 trace_xchk_parent_ultraslowpath(sc->ip, xname, dp->i_ino); in xchk_parent_slow_pptr()
601 error = xchk_dir_trylock_for_pptrs(sc, dp, &lockmode); in xchk_parent_slow_pptr()
611 if (!xchk_fblock_xref_process_error(sc, XFS_ATTR_FORK, 0, &error)) in xchk_parent_slow_pptr()
619 xchk_irele(sc, dp); in xchk_parent_slow_pptr()
634 if (pp->sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT) in xchk_parent_finish_slow_pptrs()
660 struct xfs_scrub *sc, in xchk_parent_count_pptr() argument
675 error = xfs_parent_from_attr(sc->mp, attr_flags, name, namelen, value, in xchk_parent_count_pptr()
693 struct xfs_scrub *sc = pp->sc; in xchk_parent_count_pptrs() local
702 error = xchk_xattr_walk(sc, sc->ip, xchk_parent_count_pptr, in xchk_parent_count_pptrs()
706 xchk_fblock_set_corrupt(sc, XFS_ATTR_FORK, 0); in xchk_parent_count_pptrs()
713 if (S_ISDIR(VFS_I(sc->ip)->i_mode)) { in xchk_parent_count_pptrs()
714 if (sc->ip == sc->mp->m_rootip) in xchk_parent_count_pptrs()
717 if (VFS_I(sc->ip)->i_nlink == 0 && pp->pptrs_found > 0) in xchk_parent_count_pptrs()
718 xchk_ino_set_corrupt(sc, sc->ip->i_ino); in xchk_parent_count_pptrs()
719 else if (VFS_I(sc->ip)->i_nlink > 0 && in xchk_parent_count_pptrs()
721 xchk_ino_set_corrupt(sc, sc->ip->i_ino); in xchk_parent_count_pptrs()
723 if (VFS_I(sc->ip)->i_nlink != pp->pptrs_found) in xchk_parent_count_pptrs()
724 xchk_ino_set_corrupt(sc, sc->ip->i_ino); in xchk_parent_count_pptrs()
733 struct xfs_scrub *sc) in xchk_parent_pptr() argument
742 pp->sc = sc; in xchk_parent_pptr()
749 descr = xchk_xfile_ino_descr(sc, "slow parent pointer entries"); in xchk_parent_pptr()
756 descr = xchk_xfile_ino_descr(sc, "slow parent pointer names"); in xchk_parent_pptr()
762 error = xchk_xattr_walk(sc, sc->ip, xchk_parent_scan_attr, NULL, pp); in xchk_parent_pptr()
779 if (pp->sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT) in xchk_parent_pptr()
795 if (S_ISDIR(VFS_I(sc->ip)->i_mode)) { in xchk_parent_pptr()
801 if (pp->sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT) in xchk_parent_pptr()
825 struct xfs_scrub *sc) in xchk_parent() argument
827 struct xfs_mount *mp = sc->mp; in xchk_parent()
832 return xchk_parent_pptr(sc); in xchk_parent()
838 if (!S_ISDIR(VFS_I(sc->ip)->i_mode)) in xchk_parent()
842 if (!xfs_verify_dir_ino(mp, sc->ip->i_ino)) { in xchk_parent()
843 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, 0); in xchk_parent()
848 if (xchk_should_terminate(sc, &error)) in xchk_parent()
852 error = xchk_dir_lookup(sc, sc->ip, &xfs_name_dotdot, in xchk_parent()
854 if (!xchk_fblock_process_error(sc, XFS_DATA_FORK, 0, &error)) in xchk_parent()
857 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, 0); in xchk_parent()
865 error = xchk_parent_validate(sc, parent_ino); in xchk_parent()