Lines Matching refs:sc
26 struct xfs_scrub *sc) in xchk_setup_ag_refcountbt() argument
28 if (xchk_need_intent_drain(sc)) in xchk_setup_ag_refcountbt()
29 xchk_fsgates_enable(sc, XCHK_FSGATES_DRAIN); in xchk_setup_ag_refcountbt()
30 return xchk_setup_ag_btree(sc, false); in xchk_setup_ag_refcountbt()
77 struct xfs_scrub *sc; member
108 if (xchk_should_terminate(refchk->sc, &error)) in xchk_refcountbt_rmap_check()
116 xchk_btree_xref_set_corrupt(refchk->sc, cur, 0); in xchk_refcountbt_rmap_check()
274 struct xfs_scrub *sc, in xchk_refcountbt_xref_rmap() argument
278 .sc = sc, in xchk_refcountbt_xref_rmap()
290 if (!sc->sa.rmap_cur || xchk_skip_xref(sc->sm)) in xchk_refcountbt_xref_rmap()
300 error = xfs_rmap_query_range(sc->sa.rmap_cur, &low, &high, in xchk_refcountbt_xref_rmap()
302 if (!xchk_should_check_xref(sc, &error, &sc->sa.rmap_cur)) in xchk_refcountbt_xref_rmap()
307 trace_xchk_refcount_incorrect(sc->sa.pag, irec, refchk.seen); in xchk_refcountbt_xref_rmap()
308 xchk_btree_xref_set_corrupt(sc, sc->sa.rmap_cur, 0); in xchk_refcountbt_xref_rmap()
321 struct xfs_scrub *sc, in xchk_refcountbt_xref() argument
324 if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT) in xchk_refcountbt_xref()
327 xchk_xref_is_used_space(sc, irec->rc_startblock, irec->rc_blockcount); in xchk_refcountbt_xref()
328 xchk_xref_is_not_inode_chunk(sc, irec->rc_startblock, in xchk_refcountbt_xref()
330 xchk_refcountbt_xref_rmap(sc, irec); in xchk_refcountbt_xref()
368 struct xfs_scrub *sc, in xchk_refcountbt_xref_gaps() argument
377 if (bno <= rrc->next_unshared_agbno || !sc->sa.rmap_cur || in xchk_refcountbt_xref_gaps()
378 xchk_skip_xref(sc->sm)) in xchk_refcountbt_xref_gaps()
386 error = xfs_rmap_query_range(sc->sa.rmap_cur, &low, &high, in xchk_refcountbt_xref_gaps()
389 xchk_btree_xref_set_corrupt(sc, sc->sa.rmap_cur, 0); in xchk_refcountbt_xref_gaps()
391 xchk_should_check_xref(sc, &error, &sc->sa.rmap_cur); in xchk_refcountbt_xref_gaps()
425 if (bs->sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT) in xchk_refcountbt_check_mergeable()
429 xchk_btree_set_corrupt(bs->sc, bs->cur, 0); in xchk_refcountbt_check_mergeable()
445 xchk_btree_set_corrupt(bs->sc, bs->cur, 0); in xchk_refcountbt_rec()
455 xchk_btree_set_corrupt(bs->sc, bs->cur, 0); in xchk_refcountbt_rec()
459 xchk_refcountbt_xref(bs->sc, &irec); in xchk_refcountbt_rec()
467 xchk_refcountbt_xref_gaps(bs->sc, rrc, irec.rc_startblock); in xchk_refcountbt_rec()
478 struct xfs_scrub *sc, in xchk_refcount_xref_rmap() argument
485 if (!sc->sa.rmap_cur || xchk_skip_xref(sc->sm)) in xchk_refcount_xref_rmap()
489 error = xfs_btree_count_blocks(sc->sa.refc_cur, &refcbt_blocks); in xchk_refcount_xref_rmap()
490 if (!xchk_btree_process_error(sc, sc->sa.refc_cur, 0, &error)) in xchk_refcount_xref_rmap()
492 error = xchk_count_rmap_ownedby_ag(sc, sc->sa.rmap_cur, in xchk_refcount_xref_rmap()
494 if (!xchk_should_check_xref(sc, &error, &sc->sa.rmap_cur)) in xchk_refcount_xref_rmap()
497 xchk_btree_xref_set_corrupt(sc, sc->sa.rmap_cur, 0); in xchk_refcount_xref_rmap()
500 error = xchk_count_rmap_ownedby_ag(sc, sc->sa.rmap_cur, in xchk_refcount_xref_rmap()
502 if (!xchk_should_check_xref(sc, &error, &sc->sa.rmap_cur)) in xchk_refcount_xref_rmap()
505 xchk_btree_xref_set_corrupt(sc, sc->sa.rmap_cur, 0); in xchk_refcount_xref_rmap()
511 struct xfs_scrub *sc) in xchk_refcountbt() argument
520 error = xchk_btree(sc, sc->sa.refc_cur, xchk_refcountbt_rec, in xchk_refcountbt()
529 xchk_refcountbt_xref_gaps(sc, &rrc, sc->mp->m_sb.sb_agblocks); in xchk_refcountbt()
531 xchk_refcount_xref_rmap(sc, rrc.cow_blocks); in xchk_refcountbt()
539 struct xfs_scrub *sc, in xchk_xref_is_cow_staging() argument
547 if (!sc->sa.refc_cur || xchk_skip_xref(sc->sm)) in xchk_xref_is_cow_staging()
551 error = xfs_refcount_lookup_le(sc->sa.refc_cur, XFS_REFC_DOMAIN_COW, in xchk_xref_is_cow_staging()
553 if (!xchk_should_check_xref(sc, &error, &sc->sa.refc_cur)) in xchk_xref_is_cow_staging()
556 xchk_btree_xref_set_corrupt(sc, sc->sa.refc_cur, 0); in xchk_xref_is_cow_staging()
560 error = xfs_refcount_get_rec(sc->sa.refc_cur, &rc, &has_refcount); in xchk_xref_is_cow_staging()
561 if (!xchk_should_check_xref(sc, &error, &sc->sa.refc_cur)) in xchk_xref_is_cow_staging()
564 xchk_btree_xref_set_corrupt(sc, sc->sa.refc_cur, 0); in xchk_xref_is_cow_staging()
570 xchk_btree_xref_set_corrupt(sc, sc->sa.refc_cur, 0); in xchk_xref_is_cow_staging()
574 xchk_btree_xref_set_corrupt(sc, sc->sa.refc_cur, 0); in xchk_xref_is_cow_staging()
583 struct xfs_scrub *sc, in xchk_xref_is_not_shared() argument
590 if (!sc->sa.refc_cur || xchk_skip_xref(sc->sm)) in xchk_xref_is_not_shared()
593 error = xfs_refcount_has_records(sc->sa.refc_cur, in xchk_xref_is_not_shared()
595 if (!xchk_should_check_xref(sc, &error, &sc->sa.refc_cur)) in xchk_xref_is_not_shared()
598 xchk_btree_xref_set_corrupt(sc, sc->sa.refc_cur, 0); in xchk_xref_is_not_shared()
604 struct xfs_scrub *sc, in xchk_xref_is_not_cow_staging() argument
611 if (!sc->sa.refc_cur || xchk_skip_xref(sc->sm)) in xchk_xref_is_not_cow_staging()
614 error = xfs_refcount_has_records(sc->sa.refc_cur, XFS_REFC_DOMAIN_COW, in xchk_xref_is_not_cow_staging()
616 if (!xchk_should_check_xref(sc, &error, &sc->sa.refc_cur)) in xchk_xref_is_not_cow_staging()
619 xchk_btree_xref_set_corrupt(sc, sc->sa.refc_cur, 0); in xchk_xref_is_not_cow_staging()