Lines Matching full:rr
169 struct xrep_refc *rr, in xrep_refc_stash() argument
180 struct xfs_scrub *sc = rr->sc; in xrep_refc_stash()
188 error = xrep_refc_check_ext(rr->sc, &irec); in xrep_refc_stash()
194 return xfarray_append(rr->refcount_records, &irec); in xrep_refc_stash()
200 struct xrep_refc *rr, in xrep_refc_stash_cow() argument
204 return xrep_refc_stash(rr, XFS_REFC_DOMAIN_COW, agbno, len, 1); in xrep_refc_stash_cow()
235 struct xrep_refc *rr, in xrep_refc_walk_rmaps() argument
239 struct xfs_btree_cur *cur = rr->sc->sa.rmap_cur; in xrep_refc_walk_rmaps()
253 if (xchk_should_terminate(rr->sc, &error)) in xrep_refc_walk_rmaps()
271 error = xrep_refc_stash_cow(rr, rmap->rm_startblock, in xrep_refc_walk_rmaps()
277 rr->btblocks += rmap->rm_blockcount; in xrep_refc_walk_rmaps()
278 error = xagb_bitmap_set(&rr->old_refcountbt_blocks, in xrep_refc_walk_rmaps()
329 struct xrep_refc *rr) in xrep_refc_sort_records() argument
337 error = xfarray_sort(rr->refcount_records, xrep_refc_extent_cmp, in xrep_refc_sort_records()
342 foreach_xfarray_idx(rr->refcount_records, cur) { in xrep_refc_sort_records()
343 if (xchk_should_terminate(rr->sc, &error)) in xrep_refc_sort_records()
346 error = xfarray_load(rr->refcount_records, cur, &irec); in xrep_refc_sort_records()
375 struct xrep_refc *rr, in xrep_refc_push_rmaps_at() argument
381 struct xfs_scrub *sc = rr->sc; in xrep_refc_push_rmaps_at()
386 error = rcbag_add(rcstack, rr->sc->tp, rmap); in xrep_refc_push_rmaps_at()
390 error = xrep_refc_walk_rmaps(rr, rmap, have); in xrep_refc_push_rmaps_at()
409 struct xrep_refc *rr) in xrep_refc_find_refcounts() argument
411 struct xfs_scrub *sc = rr->sc; in xrep_refc_find_refcounts()
441 error = xrep_refc_walk_rmaps(rr, &rmap, &have); in xrep_refc_find_refcounts()
447 error = xrep_refc_push_rmaps_at(rr, rcstack, sbno, &rmap, in xrep_refc_find_refcounts()
468 error = xrep_refc_walk_rmaps(rr, &rmap, &have); in xrep_refc_find_refcounts()
472 error = xrep_refc_push_rmaps_at(rr, rcstack, in xrep_refc_find_refcounts()
482 error = xrep_refc_stash(rr, in xrep_refc_find_refcounts()
526 struct xrep_refc *rr = priv; in xrep_refc_get_records() local
532 error = xfarray_load(rr->refcount_records, rr->array_cur++, in xrep_refc_get_records()
551 struct xrep_refc *rr = priv; in xrep_refc_claim_block() local
553 return xrep_newbt_claim_block(cur, &rr->new_btree, ptr); in xrep_refc_claim_block()
559 struct xrep_refc *rr) in xrep_refc_reset_counters() argument
561 struct xfs_scrub *sc = rr->sc; in xrep_refc_reset_counters()
588 struct xrep_refc *rr) in xrep_refc_build_new_tree() argument
590 struct xfs_scrub *sc = rr->sc; in xrep_refc_build_new_tree()
595 error = xrep_refc_sort_records(rr); in xrep_refc_build_new_tree()
605 xrep_newbt_init_ag(&rr->new_btree, sc, &XFS_RMAP_OINFO_REFC, in xrep_refc_build_new_tree()
608 rr->new_btree.bload.get_records = xrep_refc_get_records; in xrep_refc_build_new_tree()
609 rr->new_btree.bload.claim_block = xrep_refc_claim_block; in xrep_refc_build_new_tree()
613 xfs_btree_stage_afakeroot(refc_cur, &rr->new_btree.afake); in xrep_refc_build_new_tree()
615 &rr->new_btree.bload, in xrep_refc_build_new_tree()
616 xfarray_length(rr->refcount_records)); in xrep_refc_build_new_tree()
625 error = xrep_newbt_alloc_blocks(&rr->new_btree, in xrep_refc_build_new_tree()
626 rr->new_btree.bload.nr_blocks); in xrep_refc_build_new_tree()
636 pag->pagf_repair_refcount_level = rr->new_btree.bload.btree_height; in xrep_refc_build_new_tree()
639 rr->array_cur = XFARRAY_CURSOR_INIT; in xrep_refc_build_new_tree()
640 error = xfs_btree_bload(refc_cur, &rr->new_btree.bload, rr); in xrep_refc_build_new_tree()
652 error = xrep_refc_reset_counters(rr); in xrep_refc_build_new_tree()
657 error = xrep_newbt_commit(&rr->new_btree); in xrep_refc_build_new_tree()
668 xrep_newbt_cancel(&rr->new_btree); in xrep_refc_build_new_tree()
678 struct xrep_refc *rr) in xrep_refc_remove_old_tree() argument
680 struct xfs_scrub *sc = rr->sc; in xrep_refc_remove_old_tree()
685 error = xrep_reap_agblocks(sc, &rr->old_refcountbt_blocks, in xrep_refc_remove_old_tree()
705 struct xrep_refc *rr; in xrep_refcountbt() local
714 rr = kzalloc(sizeof(struct xrep_refc), XCHK_GFP_FLAGS); in xrep_refcountbt()
715 if (!rr) in xrep_refcountbt()
717 rr->sc = sc; in xrep_refcountbt()
723 &rr->refcount_records); in xrep_refcountbt()
729 xagb_bitmap_init(&rr->old_refcountbt_blocks); in xrep_refcountbt()
730 error = xrep_refc_find_refcounts(rr); in xrep_refcountbt()
735 error = xrep_refc_build_new_tree(rr); in xrep_refcountbt()
740 error = xrep_refc_remove_old_tree(rr); in xrep_refcountbt()
745 xagb_bitmap_destroy(&rr->old_refcountbt_blocks); in xrep_refcountbt()
746 xfarray_destroy(rr->refcount_records); in xrep_refcountbt()
748 kfree(rr); in xrep_refcountbt()