Lines Matching refs:xnc

50 	struct xchk_nlink_ctrs	*xnc;
61 xnc = kvzalloc(sizeof(struct xchk_nlink_ctrs), XCHK_GFP_FLAGS);
62 if (!xnc)
64 xnc->xname.name = xnc->namebuf;
65 xnc->sc = sc;
66 sc->buf = xnc;
119 struct xchk_nlink_ctrs *xnc,
128 if (!xnc->nlinks)
131 error = xfarray_load_sparse(xnc->nlinks, ino, &nl);
135 trace_xchk_nlinks_update_incore(xnc->sc->mp, ino, &nl, parents_delta,
143 error = xfarray_store(xnc->nlinks, ino, &nl);
166 struct xchk_nlink_ctrs *xnc;
169 xnc = container_of(nb, struct xchk_nlink_ctrs, dhook.dirent_hook.nb);
178 trace_xchk_nlinks_live_update(xnc->sc->mp, p->dp, action, p->ip->i_ino,
186 if (xchk_iscan_want_live_update(&xnc->collect_iscan, p->dp->i_ino)) {
187 mutex_lock(&xnc->lock);
188 error = xchk_nlinks_update_incore(xnc, p->ip->i_ino, p->delta,
191 error = xchk_nlinks_update_incore(xnc, p->dp->i_ino, 0,
193 mutex_unlock(&xnc->lock);
203 xchk_iscan_want_live_update(&xnc->collect_iscan, p->ip->i_ino)) {
204 mutex_lock(&xnc->lock);
205 error = xchk_nlinks_update_incore(xnc, p->dp->i_ino, 0,
207 mutex_unlock(&xnc->lock);
215 xchk_iscan_abort(&xnc->collect_iscan);
229 struct xchk_nlink_ctrs *xnc = priv;
259 if (xchk_iscan_aborted(&xnc->collect_iscan)) {
266 mutex_lock(&xnc->lock);
283 error = xchk_nlinks_update_incore(xnc, ino, 1, 0, 0);
285 error = xchk_nlinks_update_incore(xnc, ino, 0, 1, 0);
297 error = xchk_nlinks_update_incore(xnc, ino, 1, 0, 0);
307 error = xchk_nlinks_update_incore(xnc, dp->i_ino, 0, 0, 1);
312 mutex_unlock(&xnc->lock);
316 mutex_unlock(&xnc->lock);
318 xchk_iscan_abort(&xnc->collect_iscan);
340 struct xchk_nlink_ctrs *xnc = priv;
347 if (xchk_iscan_aborted(&xnc->collect_iscan)) {
362 mutex_lock(&xnc->lock);
364 error = xchk_nlinks_update_incore(xnc, parent_ino, 0, 1, 0);
368 mutex_unlock(&xnc->lock);
372 mutex_unlock(&xnc->lock);
373 xchk_iscan_abort(&xnc->collect_iscan);
382 struct xchk_nlink_ctrs *xnc,
385 struct xfs_scrub *sc = xnc->sc;
417 error = xchk_dir_walk(sc, dp, xchk_nlinks_collect_dirent, xnc);
438 xnc);
447 xchk_iscan_mark_visited(&xnc->collect_iscan, dp);
452 xchk_iscan_abort(&xnc->collect_iscan);
462 struct xchk_nlink_ctrs *xnc,
465 if (!xfs_verify_ino(xnc->sc->mp, ino))
468 trace_xchk_nlinks_collect_metafile(xnc->sc->mp, ino);
469 return xchk_nlinks_update_incore(xnc, ino, 1, 0, 0);
475 struct xchk_nlink_ctrs *xnc)
477 struct xfs_mount *mp = xnc->sc->mp;
481 if (xchk_iscan_aborted(&xnc->collect_iscan))
484 mutex_lock(&xnc->lock);
485 error = xchk_nlinks_collect_metafile(xnc, mp->m_sb.sb_rbmino);
489 error = xchk_nlinks_collect_metafile(xnc, mp->m_sb.sb_rsumino);
493 error = xchk_nlinks_collect_metafile(xnc, mp->m_sb.sb_uquotino);
497 error = xchk_nlinks_collect_metafile(xnc, mp->m_sb.sb_gquotino);
501 error = xchk_nlinks_collect_metafile(xnc, mp->m_sb.sb_pquotino);
504 mutex_unlock(&xnc->lock);
509 mutex_unlock(&xnc->lock);
510 xchk_iscan_abort(&xnc->collect_iscan);
512 xchk_set_incomplete(xnc->sc);
519 struct xchk_nlink_ctrs *xnc,
523 xchk_iscan_mark_visited(&xnc->collect_iscan, ip);
531 struct xchk_nlink_ctrs *xnc)
533 struct xfs_scrub *sc = xnc->sc;
538 error = xchk_nlinks_collect_metafiles(xnc);
562 while ((error = xchk_iscan_iter(&xnc->collect_iscan, &ip)) == 1) {
564 error = xchk_nlinks_collect_dir(xnc, ip);
566 error = xchk_nlinks_collect_file(xnc, ip);
574 xchk_iscan_iter_finish(&xnc->collect_iscan);
605 struct xchk_nlink_ctrs *xnc,
612 error = xfarray_load_sparse(xnc->nlinks, ino, &nl);
618 error = xfarray_store(xnc->nlinks, ino, &nl);
626 xchk_set_incomplete(xnc->sc);
643 struct xchk_nlink_ctrs *xnc,
647 struct xfs_scrub *sc = xnc->sc;
661 mutex_lock(&xnc->lock);
663 if (xchk_iscan_aborted(&xnc->collect_iscan)) {
664 xchk_set_incomplete(xnc->sc);
669 error = xchk_nlinks_comparison_read(xnc, ip->i_ino, &obs);
764 mutex_unlock(&xnc->lock);
776 struct xchk_nlink_ctrs *xnc,
780 struct xfs_mount *mp = xnc->sc->mp;
781 struct xfs_trans *tp = xnc->sc->tp;
793 error = xchk_iget_agi(xnc->sc, ino, &agi_bp, &ip);
796 error = xchk_nlinks_compare_inode(xnc, ip);
797 xchk_irele(xnc->sc, ip);
810 xchk_set_incomplete(xnc->sc);
814 if (xchk_iscan_aborted(&xnc->collect_iscan)) {
815 xchk_set_incomplete(xnc->sc);
820 mutex_lock(&xnc->lock);
821 error = xchk_nlinks_comparison_read(xnc, ino, &obs);
832 xchk_ino_set_corrupt(xnc->sc, ino);
837 mutex_unlock(&xnc->lock);
851 struct xchk_nlink_ctrs *xnc,
857 error = xchk_iscan_iter(&xnc->compare_iscan, ipp);
866 struct xchk_nlink_ctrs *xnc)
869 struct xfs_scrub *sc = xnc->sc;
892 xchk_iscan_start(sc, 0, 0, &xnc->compare_iscan);
893 while ((error = xchk_nlinks_compare_iter(xnc, &ip)) == 1) {
894 error = xchk_nlinks_compare_inode(xnc, ip);
895 xchk_iscan_mark_visited(&xnc->compare_iscan, ip);
903 xchk_iscan_iter_finish(&xnc->compare_iscan);
904 xchk_iscan_teardown(&xnc->compare_iscan);
915 mutex_lock(&xnc->lock);
916 while ((error = xfarray_iter(xnc->nlinks, &cur, &nl)) == 1) {
922 mutex_unlock(&xnc->lock);
924 error = xchk_nlinks_compare_inum(xnc, ino);
928 if (xchk_should_terminate(xnc->sc, &error))
931 mutex_lock(&xnc->lock);
933 mutex_unlock(&xnc->lock);
943 struct xchk_nlink_ctrs *xnc = priv;
946 xchk_iscan_abort(&xnc->collect_iscan);
948 xfs_dir_hook_del(xnc->sc->mp, &xnc->dhook);
950 xfarray_destroy(xnc->nlinks);
951 xnc->nlinks = NULL;
953 xchk_iscan_teardown(&xnc->collect_iscan);
954 mutex_destroy(&xnc->lock);
955 xnc->sc = NULL;
966 struct xchk_nlink_ctrs *xnc)
975 mutex_init(&xnc->lock);
978 xchk_iscan_start(sc, 30000, 100, &xnc->collect_iscan);
988 sizeof(struct xchk_nlink), &xnc->nlinks);
1001 xfs_dir_hook_setup(&xnc->dhook, xchk_nlinks_live_update);
1002 error = xfs_dir_hook_add(mp, &xnc->dhook);
1011 xchk_nlinks_teardown_scan(xnc);
1020 struct xchk_nlink_ctrs *xnc = sc->buf;
1024 error = xchk_nlinks_setup_scan(sc, xnc);
1029 error = xchk_nlinks_collect(xnc);
1034 if (xchk_iscan_aborted(&xnc->collect_iscan))
1040 error = xchk_nlinks_compare(xnc);
1045 if (xchk_iscan_aborted(&xnc->collect_iscan))