Lines Matching refs:resv

89 	enum xfs_ag_resv_type		resv)  in xrep_newbt_init_ag()  argument
95 xnr->resv = resv; in xrep_newbt_init_ag()
147 struct xrep_newbt_resv *resv; in xrep_newbt_add_blocks() local
150 resv = kmalloc(sizeof(struct xrep_newbt_resv), XCHK_GFP_FLAGS); in xrep_newbt_add_blocks()
151 if (!resv) in xrep_newbt_add_blocks()
154 INIT_LIST_HEAD(&resv->list); in xrep_newbt_add_blocks()
155 resv->agbno = XFS_FSB_TO_AGBNO(mp, args->fsbno); in xrep_newbt_add_blocks()
156 resv->len = args->len; in xrep_newbt_add_blocks()
157 resv->used = 0; in xrep_newbt_add_blocks()
158 resv->pag = xfs_perag_hold(pag); in xrep_newbt_add_blocks()
164 XFS_FREE_EXTENT_SKIP_DISCARD, &resv->autoreap); in xrep_newbt_add_blocks()
169 list_add_tail(&resv->list, &xnr->resv_list); in xrep_newbt_add_blocks()
172 xfs_perag_put(resv->pag); in xrep_newbt_add_blocks()
173 kfree(resv); in xrep_newbt_add_blocks()
195 .resv = xnr->resv, in xrep_newbt_add_extent()
237 .resv = xnr->resv, in xrep_newbt_alloc_ag_blocks()
310 .resv = xnr->resv, in xrep_newbt_alloc_file_blocks()
373 struct xrep_newbt_resv *resv, in xrep_newbt_free_extent() argument
377 xfs_agblock_t free_agbno = resv->agbno; in xrep_newbt_free_extent()
378 xfs_extlen_t free_aglen = resv->len; in xrep_newbt_free_extent()
382 if (!btree_committed || resv->used == 0) { in xrep_newbt_free_extent()
388 trace_xrep_newbt_free_blocks(sc->mp, resv->pag->pag_agno, in xrep_newbt_free_extent()
390 xfs_alloc_commit_autoreap(sc->tp, &resv->autoreap); in xrep_newbt_free_extent()
399 xfs_alloc_cancel_autoreap(sc->tp, &resv->autoreap); in xrep_newbt_free_extent()
400 free_agbno += resv->used; in xrep_newbt_free_extent()
401 free_aglen -= resv->used; in xrep_newbt_free_extent()
406 trace_xrep_newbt_free_blocks(sc->mp, resv->pag->pag_agno, free_agbno, in xrep_newbt_free_extent()
409 ASSERT(xnr->resv != XFS_AG_RESV_AGFL); in xrep_newbt_free_extent()
410 ASSERT(xnr->resv != XFS_AG_RESV_IGNORE); in xrep_newbt_free_extent()
416 fsbno = XFS_AGB_TO_FSB(sc->mp, resv->pag->pag_agno, free_agbno); in xrep_newbt_free_extent()
418 xnr->resv, XFS_FREE_EXTENT_SKIP_DISCARD); in xrep_newbt_free_extent()
432 struct xrep_newbt_resv *resv, *n; in xrep_newbt_free() local
443 list_for_each_entry_safe(resv, n, &xnr->resv_list, list) { in xrep_newbt_free()
446 ret = xrep_newbt_free_extent(xnr, resv, btree_committed); in xrep_newbt_free()
447 list_del(&resv->list); in xrep_newbt_free()
448 xfs_perag_put(resv->pag); in xrep_newbt_free()
449 kfree(resv); in xrep_newbt_free()
473 list_for_each_entry_safe(resv, n, &xnr->resv_list, list) { in xrep_newbt_free()
474 xfs_alloc_commit_autoreap(sc->tp, &resv->autoreap); in xrep_newbt_free()
475 list_del(&resv->list); in xrep_newbt_free()
476 xfs_perag_put(resv->pag); in xrep_newbt_free()
477 kfree(resv); in xrep_newbt_free()
518 struct xrep_newbt_resv *resv; in xrep_newbt_claim_block() local
526 resv = list_first_entry(&xnr->resv_list, struct xrep_newbt_resv, list); in xrep_newbt_claim_block()
527 if (resv->used == resv->len) in xrep_newbt_claim_block()
537 agbno = resv->agbno + resv->used; in xrep_newbt_claim_block()
538 resv->used++; in xrep_newbt_claim_block()
541 if (resv->used == resv->len) in xrep_newbt_claim_block()
542 list_move_tail(&resv->list, &xnr->resv_list); in xrep_newbt_claim_block()
544 trace_xrep_newbt_claim_block(mp, resv->pag->pag_agno, agbno, 1, in xrep_newbt_claim_block()
548 ptr->l = cpu_to_be64(XFS_AGB_TO_FSB(mp, resv->pag->pag_agno, in xrep_newbt_claim_block()
562 struct xrep_newbt_resv *resv; in xrep_newbt_unused_blocks() local
565 list_for_each_entry(resv, &xnr->resv_list, list) in xrep_newbt_unused_blocks()
566 unused += resv->len - resv->used; in xrep_newbt_unused_blocks()