Lines Matching refs:sc
33 struct xfs_scrub *sc) in xchk_setup_ag_rmapbt() argument
35 if (xchk_need_intent_drain(sc)) in xchk_setup_ag_rmapbt()
36 xchk_fsgates_enable(sc, XCHK_FSGATES_DRAIN); in xchk_setup_ag_rmapbt()
38 return xchk_setup_ag_btree(sc, false); in xchk_setup_ag_rmapbt()
71 struct xfs_scrub *sc, in xchk_rmapbt_xref_refc() argument
82 if (!sc->sa.refc_cur || xchk_skip_xref(sc->sm)) in xchk_rmapbt_xref_refc()
91 error = xfs_refcount_find_shared(sc->sa.refc_cur, irec->rm_startblock, in xchk_rmapbt_xref_refc()
93 if (!xchk_should_check_xref(sc, &error, &sc->sa.refc_cur)) in xchk_rmapbt_xref_refc()
96 xchk_btree_xref_set_corrupt(sc, sc->sa.refc_cur, 0); in xchk_rmapbt_xref_refc()
102 struct xfs_scrub *sc, in xchk_rmapbt_xref() argument
108 if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT) in xchk_rmapbt_xref()
111 xchk_xref_is_used_space(sc, agbno, len); in xchk_rmapbt_xref()
113 xchk_xref_is_inode_chunk(sc, agbno, len); in xchk_rmapbt_xref()
115 xchk_xref_is_not_inode_chunk(sc, agbno, len); in xchk_rmapbt_xref()
117 xchk_xref_is_cow_staging(sc, irec->rm_startblock, in xchk_rmapbt_xref()
120 xchk_rmapbt_xref_refc(sc, irec); in xchk_rmapbt_xref()
139 struct xfs_scrub *sc = bs->sc; in xchk_rmapbt_check_unwritten_in_keyflags() local
146 if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_PREEN) in xchk_rmapbt_check_unwritten_in_keyflags()
162 xchk_btree_set_preen(sc, cur, level); in xchk_rmapbt_check_unwritten_in_keyflags()
168 xchk_btree_set_preen(sc, cur, level); in xchk_rmapbt_check_unwritten_in_keyflags()
177 struct xfs_scrub *sc, in xchk_rmapbt_is_shareable() argument
180 if (!xfs_has_reflink(sc->mp)) in xchk_rmapbt_is_shareable()
199 if (bs->sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT) in xchk_rmapbt_check_overlapping()
212 if (!xchk_rmapbt_is_shareable(bs->sc, &cr->overlap_rec) || in xchk_rmapbt_check_overlapping()
213 !xchk_rmapbt_is_shareable(bs->sc, irec)) in xchk_rmapbt_check_overlapping()
214 xchk_btree_set_corrupt(bs->sc, bs->cur, 0); in xchk_rmapbt_check_overlapping()
261 if (bs->sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT) in xchk_rmapbt_check_mergeable()
265 xchk_btree_set_corrupt(bs->sc, bs->cur, 0); in xchk_rmapbt_check_mergeable()
277 struct xfs_scrub *sc = bs->sc; in xchk_rmapbt_mark_bitmap() local
286 if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT) in xchk_rmapbt_mark_bitmap()
325 xchk_btree_xref_set_corrupt(bs->sc, in xchk_rmapbt_mark_bitmap()
326 bs->sc->sa.rmap_cur, 0); in xchk_rmapbt_mark_bitmap()
334 xchk_btree_xref_set_corrupt(bs->sc, bs->sc->sa.rmap_cur, 0); in xchk_rmapbt_mark_bitmap()
352 xchk_btree_set_corrupt(bs->sc, bs->cur, 0); in xchk_rmapbt_rec()
359 xchk_rmapbt_xref(bs->sc, &irec); in xchk_rmapbt_rec()
387 struct xfs_scrub *sc, in xchk_rmapbt_walk_ag_metadata() argument
390 struct xfs_mount *mp = sc->mp; in xchk_rmapbt_walk_ag_metadata()
392 struct xfs_agf *agf = sc->sa.agf_bp->b_addr; in xchk_rmapbt_walk_ag_metadata()
403 if (xfs_ag_contains_log(mp, sc->sa.pag->pag_agno)) { in xchk_rmapbt_walk_ag_metadata()
412 cur = sc->sa.bno_cur; in xchk_rmapbt_walk_ag_metadata()
414 cur = xfs_allocbt_init_cursor(sc->mp, sc->tp, sc->sa.agf_bp, in xchk_rmapbt_walk_ag_metadata()
415 sc->sa.pag, XFS_BTNUM_BNO); in xchk_rmapbt_walk_ag_metadata()
417 if (cur != sc->sa.bno_cur) in xchk_rmapbt_walk_ag_metadata()
422 cur = sc->sa.cnt_cur; in xchk_rmapbt_walk_ag_metadata()
424 cur = xfs_allocbt_init_cursor(sc->mp, sc->tp, sc->sa.agf_bp, in xchk_rmapbt_walk_ag_metadata()
425 sc->sa.pag, XFS_BTNUM_CNT); in xchk_rmapbt_walk_ag_metadata()
427 if (cur != sc->sa.cnt_cur) in xchk_rmapbt_walk_ag_metadata()
432 error = xagb_bitmap_set_btblocks(&cr->ag_owned, sc->sa.rmap_cur); in xchk_rmapbt_walk_ag_metadata()
436 error = xfs_alloc_read_agfl(sc->sa.pag, sc->tp, &agfl_bp); in xchk_rmapbt_walk_ag_metadata()
440 error = xfs_agfl_walk(sc->mp, agf, agfl_bp, xchk_rmapbt_walk_agfl, in xchk_rmapbt_walk_ag_metadata()
442 xfs_trans_brelse(sc->tp, agfl_bp); in xchk_rmapbt_walk_ag_metadata()
447 cur = sc->sa.ino_cur; in xchk_rmapbt_walk_ag_metadata()
449 cur = xfs_inobt_init_cursor(sc->sa.pag, sc->tp, sc->sa.agi_bp, in xchk_rmapbt_walk_ag_metadata()
452 if (cur != sc->sa.ino_cur) in xchk_rmapbt_walk_ag_metadata()
457 if (xfs_has_finobt(sc->mp)) { in xchk_rmapbt_walk_ag_metadata()
458 cur = sc->sa.fino_cur; in xchk_rmapbt_walk_ag_metadata()
460 cur = xfs_inobt_init_cursor(sc->sa.pag, sc->tp, in xchk_rmapbt_walk_ag_metadata()
461 sc->sa.agi_bp, XFS_BTNUM_FINO); in xchk_rmapbt_walk_ag_metadata()
463 if (cur != sc->sa.fino_cur) in xchk_rmapbt_walk_ag_metadata()
470 if (xfs_has_reflink(sc->mp)) { in xchk_rmapbt_walk_ag_metadata()
471 cur = sc->sa.refc_cur; in xchk_rmapbt_walk_ag_metadata()
473 cur = xfs_refcountbt_init_cursor(sc->mp, sc->tp, in xchk_rmapbt_walk_ag_metadata()
474 sc->sa.agf_bp, sc->sa.pag); in xchk_rmapbt_walk_ag_metadata()
476 if (cur != sc->sa.refc_cur) in xchk_rmapbt_walk_ag_metadata()
488 xchk_btree_xref_process_error(sc, sc->sa.rmap_cur, in xchk_rmapbt_walk_ag_metadata()
489 sc->sa.rmap_cur->bc_nlevels - 1, &error); in xchk_rmapbt_walk_ag_metadata()
501 struct xfs_scrub *sc, in xchk_rmapbt_check_bitmaps() argument
504 struct xfs_btree_cur *cur = sc->sa.rmap_cur; in xchk_rmapbt_check_bitmaps()
507 if (sc->sm->sm_flags & (XFS_SCRUB_OFLAG_CORRUPT | in xchk_rmapbt_check_bitmaps()
519 xchk_btree_xref_set_corrupt(sc, cur, level); in xchk_rmapbt_check_bitmaps()
522 xchk_btree_xref_set_corrupt(sc, cur, level); in xchk_rmapbt_check_bitmaps()
525 xchk_btree_xref_set_corrupt(sc, cur, level); in xchk_rmapbt_check_bitmaps()
528 xchk_btree_xref_set_corrupt(sc, cur, level); in xchk_rmapbt_check_bitmaps()
531 xchk_btree_xref_set_corrupt(sc, cur, level); in xchk_rmapbt_check_bitmaps()
537 struct xfs_scrub *sc) in xchk_rmapbt() argument
552 error = xchk_rmapbt_walk_ag_metadata(sc, cr); in xchk_rmapbt()
556 error = xchk_btree(sc, sc->sa.rmap_cur, xchk_rmapbt_rec, in xchk_rmapbt()
561 xchk_rmapbt_check_bitmaps(sc, cr); in xchk_rmapbt()
576 struct xfs_scrub *sc, in xchk_xref_is_only_owned_by() argument
584 if (!sc->sa.rmap_cur || xchk_skip_xref(sc->sm)) in xchk_xref_is_only_owned_by()
587 error = xfs_rmap_count_owners(sc->sa.rmap_cur, bno, len, oinfo, &res); in xchk_xref_is_only_owned_by()
588 if (!xchk_should_check_xref(sc, &error, &sc->sa.rmap_cur)) in xchk_xref_is_only_owned_by()
591 xchk_btree_xref_set_corrupt(sc, sc->sa.rmap_cur, 0); in xchk_xref_is_only_owned_by()
593 xchk_btree_xref_set_corrupt(sc, sc->sa.rmap_cur, 0); in xchk_xref_is_only_owned_by()
595 xchk_btree_xref_set_corrupt(sc, sc->sa.rmap_cur, 0); in xchk_xref_is_only_owned_by()
601 struct xfs_scrub *sc, in xchk_xref_is_not_owned_by() argument
609 if (!sc->sa.rmap_cur || xchk_skip_xref(sc->sm)) in xchk_xref_is_not_owned_by()
612 error = xfs_rmap_count_owners(sc->sa.rmap_cur, bno, len, oinfo, &res); in xchk_xref_is_not_owned_by()
613 if (!xchk_should_check_xref(sc, &error, &sc->sa.rmap_cur)) in xchk_xref_is_not_owned_by()
616 xchk_btree_xref_set_corrupt(sc, sc->sa.rmap_cur, 0); in xchk_xref_is_not_owned_by()
618 xchk_btree_xref_set_corrupt(sc, sc->sa.rmap_cur, 0); in xchk_xref_is_not_owned_by()
624 struct xfs_scrub *sc, in xchk_xref_has_no_owner() argument
631 if (!sc->sa.rmap_cur || xchk_skip_xref(sc->sm)) in xchk_xref_has_no_owner()
634 error = xfs_rmap_has_records(sc->sa.rmap_cur, bno, len, &outcome); in xchk_xref_has_no_owner()
635 if (!xchk_should_check_xref(sc, &error, &sc->sa.rmap_cur)) in xchk_xref_has_no_owner()
638 xchk_btree_xref_set_corrupt(sc, sc->sa.rmap_cur, 0); in xchk_xref_has_no_owner()