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 kstrdup_const("rtgroups", GFP_KERNEL), 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 xchk_trans_alloc_empty(sc); in xchk_metapath()
328 error = xchk_dir_lookup(sc, mpath->dp, &mpath->xname, &ino); in xchk_metapath()
329 trace_xchk_metapath_lookup(sc, mpath->path, mpath->dp, ino); in xchk_metapath()
332 xchk_ino_set_corrupt(sc, sc->ip->i_ino); in xchk_metapath()
336 if (!xchk_fblock_xref_process_error(sc, XFS_DATA_FORK, 0, &error)) in xchk_metapath()
338 if (ino != sc->ip->i_ino) { in xchk_metapath()
340 xchk_ino_set_corrupt(sc, sc->ip->i_ino); in xchk_metapath()
346 xchk_trans_cancel(sc); in xchk_metapath()
356 struct xfs_scrub *sc = mpath->sc; in xrep_metapath_link() local
360 mpath->du.ip = sc->ip; in xrep_metapath_link()
362 if (xfs_has_parent(sc->mp)) in xrep_metapath_link()
367 trace_xrep_metapath_link(sc, mpath->path, mpath->dp, sc->ip->i_ino); in xrep_metapath_link()
369 return xfs_dir_add_child(sc->tp, mpath->link_resblks, &mpath->du); in xrep_metapath_link()
380 struct xfs_scrub *sc = mpath->sc; in xrep_metapath_unlink() local
381 struct xfs_mount *mp = sc->mp; in xrep_metapath_unlink()
384 trace_xrep_metapath_unlink(sc, mpath->path, mpath->dp, ino); in xrep_metapath_unlink()
388 xfs_trans_log_inode(sc->tp, mpath->dp, XFS_ILOG_CORE); in xrep_metapath_unlink()
389 return xfs_dir_removename(sc->tp, mpath->dp, &mpath->xname, in xrep_metapath_unlink()
401 error = xfs_parent_lookup(sc->tp, ip, &mpath->xname, &rec, in xrep_metapath_unlink()
414 return xfs_dir_remove_child(sc->tp, mpath->unlink_resblks, &mpath->du); in xrep_metapath_unlink()
419 * to @sc->ip. Returns:
422 * 0 if there is now a dirent pointing to @sc->ip; or
430 struct xfs_scrub *sc = mpath->sc; in xrep_metapath_try_link() local
435 error = xchk_trans_alloc(sc, mpath->link_resblks); in xrep_metapath_try_link()
441 xchk_trans_cancel(sc); in xrep_metapath_try_link()
444 xfs_trans_ijoin(sc->tp, mpath->dp, 0); in xrep_metapath_try_link()
445 xfs_trans_ijoin(sc->tp, sc->ip, 0); in xrep_metapath_try_link()
447 error = xchk_dir_lookup(sc, mpath->dp, &mpath->xname, &ino); in xrep_metapath_try_link()
448 trace_xrep_metapath_lookup(sc, mpath->path, mpath->dp, ino); in xrep_metapath_try_link()
452 * pointing to @sc->ip. in xrep_metapath_try_link()
458 error = xrep_trans_commit(sc); in xrep_metapath_try_link()
465 if (ino == sc->ip->i_ino) { in xrep_metapath_try_link()
466 /* The dirent already points to @sc->ip; we're done. */ in xrep_metapath_try_link()
479 xchk_trans_cancel(sc); in xrep_metapath_try_link()
495 struct xfs_scrub *sc = mpath->sc; in xchk_metapath_ilock_parent_and_child() local
504 if (xchk_should_terminate(sc, &error)) in xchk_metapath_ilock_parent_and_child()
519 * -EEXIST if the dirent points to @sc->ip;
528 struct xfs_scrub *sc = mpath->sc; in xrep_metapath_try_unlink() local
533 ASSERT(*alleged_child != sc->ip->i_ino); in xrep_metapath_try_unlink()
535 trace_xrep_metapath_try_unlink(sc, mpath->path, mpath->dp, in xrep_metapath_try_unlink()
542 error = xchk_trans_alloc(sc, mpath->unlink_resblks); in xrep_metapath_try_unlink()
546 error = xchk_iget(sc, *alleged_child, &ip); in xrep_metapath_try_unlink()
552 xchk_trans_cancel(sc); in xrep_metapath_try_unlink()
558 xchk_trans_cancel(sc); in xrep_metapath_try_unlink()
561 xfs_trans_ijoin(sc->tp, mpath->dp, 0); in xrep_metapath_try_unlink()
563 xfs_trans_ijoin(sc->tp, ip, 0); in xrep_metapath_try_unlink()
565 error = xchk_dir_lookup(sc, mpath->dp, &mpath->xname, &ino); in xrep_metapath_try_unlink()
566 trace_xrep_metapath_lookup(sc, mpath->path, mpath->dp, ino); in xrep_metapath_try_unlink()
578 if (ino == sc->ip->i_ino) { in xrep_metapath_try_unlink()
579 /* The dirent already points to @sc->ip; we're done. */ in xrep_metapath_try_unlink()
599 error = xrep_trans_commit(sc); in xrep_metapath_try_unlink()
603 xchk_trans_cancel(sc); in xrep_metapath_try_unlink()
608 xchk_irele(sc, ip); in xrep_metapath_try_unlink()
622 struct xfs_scrub *sc) in xrep_metapath() argument
624 struct xchk_metapath *mpath = sc->buf; in xrep_metapath()
625 struct xfs_mount *mp = sc->mp; in xrep_metapath()
629 if (sc->sm->sm_ino == XFS_SCRUB_METAPATH_PROBE) in xrep_metapath()
641 error = xfs_attr_add_fork(sc->ip, in xrep_metapath()