Lines Matching full:sc
44 struct xfs_scrub *sc; member
88 struct xfs_scrub *sc, in xchk_setup_metapath_scan() argument
99 error = xchk_install_live_inode(sc, ip); in xchk_setup_metapath_scan()
111 mpath->sc = sc; in xchk_setup_metapath_scan()
112 sc->buf = mpath; in xchk_setup_metapath_scan()
113 sc->buf_cleanup = xchk_metapath_cleanup; in xchk_setup_metapath_scan()
129 struct xfs_scrub *sc) in xchk_setup_metapath_rtdir() argument
131 if (!sc->mp->m_rtdirip) in xchk_setup_metapath_rtdir()
134 return xchk_setup_metapath_scan(sc, sc->mp->m_metadirip, in xchk_setup_metapath_rtdir()
135 kasprintf(GFP_KERNEL, "rtgroups"), sc->mp->m_rtdirip); in xchk_setup_metapath_rtdir()
141 struct xfs_scrub *sc, in xchk_setup_metapath_rtginode() argument
148 rtg = xfs_rtgroup_get(sc->mp, sc->sm->sm_agno); in xchk_setup_metapath_rtginode()
158 error = xchk_setup_metapath_scan(sc, sc->mp->m_rtdirip, in xchk_setup_metapath_rtginode()
174 struct xfs_scrub *sc) in xchk_setup_metapath_quotadir() argument
176 struct xfs_quotainfo *qi = sc->mp->m_quotainfo; in xchk_setup_metapath_quotadir()
181 return xchk_setup_metapath_scan(sc, sc->mp->m_metadirip, in xchk_setup_metapath_quotadir()
188 struct xfs_scrub *sc, in xchk_setup_metapath_dqinode() argument
191 struct xfs_quotainfo *qi = sc->mp->m_quotainfo; in xchk_setup_metapath_dqinode()
214 return xchk_setup_metapath_scan(sc, qi->qi_dirip, in xchk_setup_metapath_dqinode()
224 struct xfs_scrub *sc) in xchk_setup_metapath() argument
226 if (!xfs_has_metadir(sc->mp)) in xchk_setup_metapath()
228 if (sc->sm->sm_gen) in xchk_setup_metapath()
231 switch (sc->sm->sm_ino) { in xchk_setup_metapath()
234 if (sc->sm->sm_agno) in xchk_setup_metapath()
238 return xchk_setup_metapath_rtdir(sc); in xchk_setup_metapath()
240 return xchk_setup_metapath_rtginode(sc, XFS_RTGI_BITMAP); in xchk_setup_metapath()
242 return xchk_setup_metapath_rtginode(sc, XFS_RTGI_SUMMARY); in xchk_setup_metapath()
244 return xchk_setup_metapath_quotadir(sc); in xchk_setup_metapath()
246 return xchk_setup_metapath_dqinode(sc, XFS_DQTYPE_USER); in xchk_setup_metapath()
248 return xchk_setup_metapath_dqinode(sc, XFS_DQTYPE_GROUP); in xchk_setup_metapath()
250 return xchk_setup_metapath_dqinode(sc, XFS_DQTYPE_PROJ); in xchk_setup_metapath()
252 return xchk_setup_metapath_rtginode(sc, XFS_RTGI_RMAP); in xchk_setup_metapath()
254 return xchk_setup_metapath_rtginode(sc, XFS_RTGI_REFCOUNT); in xchk_setup_metapath()
269 struct xfs_scrub *sc = mpath->sc; in xchk_metapath_ilock_both() local
274 if (xchk_ilock_nowait(sc, XFS_ILOCK_EXCL)) { in xchk_metapath_ilock_both()
280 if (xchk_should_terminate(sc, &error)) in xchk_metapath_ilock_both()
295 struct xfs_scrub *sc = mpath->sc; in xchk_metapath_iunlock() local
297 xchk_iunlock(sc, XFS_ILOCK_EXCL); in xchk_metapath_iunlock()
305 struct xfs_scrub *sc) in xchk_metapath() argument
307 struct xchk_metapath *mpath = sc->buf; in xchk_metapath()
312 if (sc->sm->sm_ino == XFS_SCRUB_METAPATH_PROBE) in xchk_metapath()
317 xchk_ino_set_corrupt(sc, sc->ip->i_ino); in xchk_metapath()
321 error = xchk_trans_alloc_empty(sc); in xchk_metapath()
330 error = xchk_dir_lookup(sc, mpath->dp, &mpath->xname, &ino); in xchk_metapath()
331 trace_xchk_metapath_lookup(sc, mpath->path, mpath->dp, ino); in xchk_metapath()
334 xchk_ino_set_corrupt(sc, sc->ip->i_ino); in xchk_metapath()
338 if (!xchk_fblock_xref_process_error(sc, XFS_DATA_FORK, 0, &error)) in xchk_metapath()
340 if (ino != sc->ip->i_ino) { in xchk_metapath()
342 xchk_ino_set_corrupt(sc, sc->ip->i_ino); in xchk_metapath()
348 xchk_trans_cancel(sc); in xchk_metapath()
358 struct xfs_scrub *sc = mpath->sc; in xrep_metapath_link() local
362 mpath->du.ip = sc->ip; in xrep_metapath_link()
364 if (xfs_has_parent(sc->mp)) in xrep_metapath_link()
369 trace_xrep_metapath_link(sc, mpath->path, mpath->dp, sc->ip->i_ino); in xrep_metapath_link()
371 return xfs_dir_add_child(sc->tp, mpath->link_resblks, &mpath->du); in xrep_metapath_link()
382 struct xfs_scrub *sc = mpath->sc; in xrep_metapath_unlink() local
383 struct xfs_mount *mp = sc->mp; in xrep_metapath_unlink()
386 trace_xrep_metapath_unlink(sc, mpath->path, mpath->dp, ino); in xrep_metapath_unlink()
390 xfs_trans_log_inode(sc->tp, mpath->dp, XFS_ILOG_CORE); in xrep_metapath_unlink()
391 return xfs_dir_removename(sc->tp, mpath->dp, &mpath->xname, in xrep_metapath_unlink()
403 error = xfs_parent_lookup(sc->tp, ip, &mpath->xname, &rec, in xrep_metapath_unlink()
416 return xfs_dir_remove_child(sc->tp, mpath->unlink_resblks, &mpath->du); in xrep_metapath_unlink()
421 * to @sc->ip. Returns:
424 * 0 if there is now a dirent pointing to @sc->ip; or
432 struct xfs_scrub *sc = mpath->sc; in xrep_metapath_try_link() local
437 error = xchk_trans_alloc(sc, mpath->link_resblks); in xrep_metapath_try_link()
443 xchk_trans_cancel(sc); in xrep_metapath_try_link()
446 xfs_trans_ijoin(sc->tp, mpath->dp, 0); in xrep_metapath_try_link()
447 xfs_trans_ijoin(sc->tp, sc->ip, 0); in xrep_metapath_try_link()
449 error = xchk_dir_lookup(sc, mpath->dp, &mpath->xname, &ino); in xrep_metapath_try_link()
450 trace_xrep_metapath_lookup(sc, mpath->path, mpath->dp, ino); in xrep_metapath_try_link()
454 * pointing to @sc->ip. in xrep_metapath_try_link()
460 error = xrep_trans_commit(sc); in xrep_metapath_try_link()
467 if (ino == sc->ip->i_ino) { in xrep_metapath_try_link()
468 /* The dirent already points to @sc->ip; we're done. */ in xrep_metapath_try_link()
481 xchk_trans_cancel(sc); in xrep_metapath_try_link()
497 struct xfs_scrub *sc = mpath->sc; in xchk_metapath_ilock_parent_and_child() local
506 if (xchk_should_terminate(sc, &error)) in xchk_metapath_ilock_parent_and_child()
521 * -EEXIST if the dirent points to @sc->ip;
530 struct xfs_scrub *sc = mpath->sc; in xrep_metapath_try_unlink() local
535 ASSERT(*alleged_child != sc->ip->i_ino); in xrep_metapath_try_unlink()
537 trace_xrep_metapath_try_unlink(sc, mpath->path, mpath->dp, in xrep_metapath_try_unlink()
544 error = xchk_trans_alloc(sc, mpath->unlink_resblks); in xrep_metapath_try_unlink()
548 error = xchk_iget(sc, *alleged_child, &ip); in xrep_metapath_try_unlink()
554 xchk_trans_cancel(sc); in xrep_metapath_try_unlink()
560 xchk_trans_cancel(sc); in xrep_metapath_try_unlink()
563 xfs_trans_ijoin(sc->tp, mpath->dp, 0); in xrep_metapath_try_unlink()
565 xfs_trans_ijoin(sc->tp, ip, 0); in xrep_metapath_try_unlink()
567 error = xchk_dir_lookup(sc, mpath->dp, &mpath->xname, &ino); in xrep_metapath_try_unlink()
568 trace_xrep_metapath_lookup(sc, mpath->path, mpath->dp, ino); in xrep_metapath_try_unlink()
580 if (ino == sc->ip->i_ino) { in xrep_metapath_try_unlink()
581 /* The dirent already points to @sc->ip; we're done. */ in xrep_metapath_try_unlink()
601 error = xrep_trans_commit(sc); in xrep_metapath_try_unlink()
605 xchk_trans_cancel(sc); in xrep_metapath_try_unlink()
610 xchk_irele(sc, ip); in xrep_metapath_try_unlink()
624 struct xfs_scrub *sc) in xrep_metapath() argument
626 struct xchk_metapath *mpath = sc->buf; in xrep_metapath()
627 struct xfs_mount *mp = sc->mp; in xrep_metapath()
631 if (sc->sm->sm_ino == XFS_SCRUB_METAPATH_PROBE) in xrep_metapath()
643 error = xfs_attr_add_fork(sc->ip, in xrep_metapath()