Lines Matching refs:gnt_list_entry

313 	struct grant *gnt_list_entry, *n;  in fill_grant_buffer()  local
317 gnt_list_entry = kzalloc(sizeof(struct grant), GFP_NOIO); in fill_grant_buffer()
318 if (!gnt_list_entry) in fill_grant_buffer()
324 kfree(gnt_list_entry); in fill_grant_buffer()
327 gnt_list_entry->page = granted_page; in fill_grant_buffer()
330 gnt_list_entry->gref = INVALID_GRANT_REF; in fill_grant_buffer()
331 list_add(&gnt_list_entry->node, &rinfo->grants); in fill_grant_buffer()
338 list_for_each_entry_safe(gnt_list_entry, n, in fill_grant_buffer()
340 list_del(&gnt_list_entry->node); in fill_grant_buffer()
342 __free_page(gnt_list_entry->page); in fill_grant_buffer()
343 kfree(gnt_list_entry); in fill_grant_buffer()
352 struct grant *gnt_list_entry; in get_free_grant() local
355 gnt_list_entry = list_first_entry(&rinfo->grants, struct grant, in get_free_grant()
357 list_del(&gnt_list_entry->node); in get_free_grant()
359 if (gnt_list_entry->gref != INVALID_GRANT_REF) in get_free_grant()
362 return gnt_list_entry; in get_free_grant()
365 static inline void grant_foreign_access(const struct grant *gnt_list_entry, in grant_foreign_access() argument
368 gnttab_page_grant_foreign_access_ref_one(gnt_list_entry->gref, in grant_foreign_access()
370 gnt_list_entry->page, in grant_foreign_access()
378 struct grant *gnt_list_entry = get_free_grant(rinfo); in get_grant() local
381 if (gnt_list_entry->gref != INVALID_GRANT_REF) in get_grant()
382 return gnt_list_entry; in get_grant()
385 gnt_list_entry->gref = gnttab_claim_grant_reference(gref_head); in get_grant()
386 BUG_ON(gnt_list_entry->gref == -ENOSPC); in get_grant()
388 grant_foreign_access(gnt_list_entry, info); in get_grant()
391 gnttab_grant_foreign_access_ref(gnt_list_entry->gref, in get_grant()
396 return gnt_list_entry; in get_grant()
402 struct grant *gnt_list_entry = get_free_grant(rinfo); in get_indirect_grant() local
405 if (gnt_list_entry->gref != INVALID_GRANT_REF) in get_indirect_grant()
406 return gnt_list_entry; in get_indirect_grant()
409 gnt_list_entry->gref = gnttab_claim_grant_reference(gref_head); in get_indirect_grant()
410 BUG_ON(gnt_list_entry->gref == -ENOSPC); in get_indirect_grant()
419 gnt_list_entry->page = indirect_page; in get_indirect_grant()
421 grant_foreign_access(gnt_list_entry, info); in get_indirect_grant()
423 return gnt_list_entry; in get_indirect_grant()
599 struct grant *gnt_list_entry; in blkif_setup_rw_req_grant() local
629 gnt_list_entry = get_indirect_grant(&setup->gref_head, rinfo); in blkif_setup_rw_req_grant()
630 shadow->indirect_grants[n] = gnt_list_entry; in blkif_setup_rw_req_grant()
631 setup->segments = kmap_atomic(gnt_list_entry->page); in blkif_setup_rw_req_grant()
632 ring_req->u.indirect.indirect_grefs[n] = gnt_list_entry->gref; in blkif_setup_rw_req_grant()
635 gnt_list_entry = get_grant(&setup->gref_head, gfn, rinfo); in blkif_setup_rw_req_grant()
636 ref = gnt_list_entry->gref; in blkif_setup_rw_req_grant()
641 shadow->grants_used[setup->grant_idx] = gnt_list_entry; in blkif_setup_rw_req_grant()
646 shared_data = kmap_atomic(gnt_list_entry->page); in blkif_setup_rw_req_grant()
2531 struct grant *gnt_list_entry, *tmp; in purge_persistent_grants() local
2541 list_for_each_entry_safe(gnt_list_entry, tmp, &rinfo->grants, in purge_persistent_grants()
2543 if (gnt_list_entry->gref == INVALID_GRANT_REF || in purge_persistent_grants()
2544 !gnttab_try_end_foreign_access(gnt_list_entry->gref)) in purge_persistent_grants()
2547 list_del(&gnt_list_entry->node); in purge_persistent_grants()
2549 gnt_list_entry->gref = INVALID_GRANT_REF; in purge_persistent_grants()
2550 list_add_tail(&gnt_list_entry->node, &grants); in purge_persistent_grants()