lkml.org 
[lkml]   [2018]   [Jun]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v2 8/9] xen/gntdev: Implement dma-buf import functionality
From
Date
On 06/05/2018 01:28 AM, Boris Ostrovsky wrote:
> On 06/01/2018 07:41 AM, Oleksandr Andrushchenko wrote:
>> /* ------------------------------------------------------------------ */
>>
>> +static int
>> +dmabuf_imp_grant_foreign_access(struct page **pages, u32 *refs,
>> + int count, int domid)
>> +{
>> + grant_ref_t priv_gref_head;
>> + int i, ret;
>> +
>> + ret = gnttab_alloc_grant_references(count, &priv_gref_head);
>> + if (ret < 0) {
>> + pr_err("Cannot allocate grant references, ret %d\n", ret);
>> + return ret;
>> + }
>> +
>> + for (i = 0; i < count; i++) {
>> + int cur_ref;
>> +
>> + cur_ref = gnttab_claim_grant_reference(&priv_gref_head);
>> + if (cur_ref < 0) {
>> + ret = cur_ref;
>> + pr_err("Cannot claim grant reference, ret %d\n", ret);
>> + goto out;
>> + }
>> +
>> + gnttab_grant_foreign_access_ref(cur_ref, domid,
>> + xen_page_to_gfn(pages[i]), 0);
>> + refs[i] = cur_ref;
>> + }
>> +
>> + ret = 0;
> return 0?
My bad, thank you
>> +
>> +out:
>> + gnttab_free_grant_references(priv_gref_head);
>> + return ret;
>> +}
>> +

\
 
 \ /
  Last update: 2018-06-06 14:39    [W:0.646 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site