Lines Matching refs:sc
52 struct xfs_scrub *sc;
81 struct xfs_scrub *sc)
83 struct xfs_mount *mp = sc->mp;
91 if (xchk_should_terminate(sc, &error))
98 error = xfs_ialloc_read_agi(pag, sc->tp, &agi_bp);
101 error = xfs_alloc_read_agf(pag, sc->tp, 0, &agf_bp);
132 struct xfs_scrub *sc)
136 error = freeze_super(sc->mp->m_super, FREEZE_HOLDER_KERNEL);
137 trace_xchk_fsfreeze(sc, error);
143 struct xfs_scrub *sc)
148 error = thaw_super(sc->mp->m_super, FREEZE_HOLDER_KERNEL);
149 trace_xchk_fsthaw(sc, error);
163 struct xfs_scrub *sc)
165 struct xchk_fscounters *fsc = sc->buf;
168 if (sc->flags & XCHK_HAVE_FREEZE_PROT) {
169 sc->flags &= ~XCHK_HAVE_FREEZE_PROT;
170 mnt_drop_write_file(sc->file);
174 while ((error = xchk_fsfreeze(sc)) == -EBUSY) {
175 if (xchk_should_terminate(sc, &error))
193 struct xfs_scrub *sc = fsc->sc;
199 error = xchk_fsthaw(sc);
201 xfs_emerg(sc->mp, "still frozen after scrub, err=%d", error);
208 struct xfs_scrub *sc)
217 if (!xfs_has_lazysbcount(sc->mp))
218 xchk_fsgates_enable(sc, XCHK_FSGATES_DRAIN);
220 sc->buf = kzalloc(sizeof(struct xchk_fscounters), XCHK_GFP_FLAGS);
221 if (!sc->buf)
223 sc->buf_cleanup = xchk_fscounters_cleanup;
224 fsc = sc->buf;
225 fsc->sc = sc;
227 xfs_icount_range(sc->mp, &fsc->icount_min, &fsc->icount_max);
230 error = xchk_fscount_warmup(sc);
239 if (sc->flags & XCHK_TRY_HARDER) {
240 error = xchk_fscounters_freeze(sc);
245 return xfs_trans_alloc_empty(sc->mp, &sc->tp);
263 struct xfs_scrub *sc,
270 error = xchk_ag_init_existing(sc, agno, &sc->sa);
274 error = xfs_btree_count_blocks(sc->sa.bno_cur, &blocks);
279 error = xfs_btree_count_blocks(sc->sa.cnt_cur, &blocks);
285 xchk_ag_free(sc, &sc->sa);
297 struct xfs_scrub *sc,
300 struct xfs_mount *mp = sc->mp;
313 if (xchk_should_terminate(sc, &error))
330 if (xfs_has_lazysbcount(sc->mp)) {
333 error = xchk_fscount_btreeblks(sc, fsc, agno);
349 xchk_set_incomplete(sc);
404 xchk_should_terminate(fsc->sc, &error);
411 struct xfs_scrub *sc,
414 struct xfs_mount *mp = sc->mp;
421 xfs_ilock(sc->mp->m_rbmip, XFS_ILOCK_SHARED | XFS_ILOCK_RTBITMAP);
422 error = xfs_rtalloc_query_all(sc->mp, sc->tp,
425 xchk_set_incomplete(sc);
430 xfs_iunlock(sc->mp->m_rbmip, XFS_ILOCK_SHARED | XFS_ILOCK_RTBITMAP);
436 struct xfs_scrub *sc,
466 struct xfs_scrub *sc,
474 trace_xchk_fscounters_within_range(sc->mp, expected, curr_value,
499 struct xfs_scrub *sc)
501 struct xfs_mount *mp = sc->mp;
502 struct xchk_fscounters *fsc = sc->buf;
515 xchk_set_corrupt(sc);
530 xchk_set_corrupt(sc);
536 xchk_set_corrupt(sc);
540 xchk_set_corrupt(sc);
544 xchk_set_corrupt(sc);
551 xchk_set_corrupt(sc);
554 error = xchk_fscount_aggregate_agcounts(sc, fsc);
555 if (!xchk_process_error(sc, 0, XFS_SB_BLOCK(mp), &error))
559 error = xchk_fscount_count_frextents(sc, fsc);
560 if (!xchk_process_error(sc, 0, XFS_SB_BLOCK(mp), &error))
562 if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_INCOMPLETE)
571 if (!xchk_fscount_within_range(sc, icount, &mp->m_icount,
574 xchk_set_corrupt(sc);
579 if (!xchk_fscount_within_range(sc, ifree, &mp->m_ifree, fsc->ifree)) {
581 xchk_set_corrupt(sc);
586 if (!xchk_fscount_within_range(sc, fdblocks, &mp->m_fdblocks,
589 xchk_set_corrupt(sc);
594 if (!xchk_fscount_within_range(sc, frextents, &mp->m_frextents,
597 xchk_set_corrupt(sc);