diff options
Diffstat (limited to 'drivers/xen')
-rw-r--r-- | drivers/xen/gntalloc.c | 9 | ||||
-rw-r--r-- | drivers/xen/gntdev-dmabuf.c | 2 | ||||
-rw-r--r-- | drivers/xen/grant-table.c | 8 | ||||
-rw-r--r-- | drivers/xen/pvcalls-front.c | 6 | ||||
-rw-r--r-- | drivers/xen/xen-front-pgdir-shbuf.c | 2 | ||||
-rw-r--r-- | drivers/xen/xenbus/xenbus_client.c | 2 |
6 files changed, 13 insertions, 16 deletions
diff --git a/drivers/xen/gntalloc.c b/drivers/xen/gntalloc.c index 55acb32842a3..a15729beb9d1 100644 --- a/drivers/xen/gntalloc.c +++ b/drivers/xen/gntalloc.c @@ -175,8 +175,6 @@ undo: static void __del_gref(struct gntalloc_gref *gref) { - unsigned long addr; - if (gref->notify.flags & UNMAP_NOTIFY_CLEAR_BYTE) { uint8_t *tmp = kmap_local_page(gref->page); tmp[gref->notify.pgoff] = 0; @@ -190,10 +188,9 @@ static void __del_gref(struct gntalloc_gref *gref) gref->notify.flags = 0; if (gref->gref_id) { - if (gref->page) { - addr = (unsigned long)page_to_virt(gref->page); - gnttab_end_foreign_access(gref->gref_id, addr); - } else + if (gref->page) + gnttab_end_foreign_access(gref->gref_id, gref->page); + else gnttab_free_grant_reference(gref->gref_id); } diff --git a/drivers/xen/gntdev-dmabuf.c b/drivers/xen/gntdev-dmabuf.c index 91073b4e4a20..940e5e9e8a54 100644 --- a/drivers/xen/gntdev-dmabuf.c +++ b/drivers/xen/gntdev-dmabuf.c @@ -524,7 +524,7 @@ static void dmabuf_imp_end_foreign_access(u32 *refs, int count) for (i = 0; i < count; i++) if (refs[i] != INVALID_GRANT_REF) - gnttab_end_foreign_access(refs[i], 0UL); + gnttab_end_foreign_access(refs[i], NULL); } static void dmabuf_imp_free_storage(struct gntdev_dmabuf *gntdev_dmabuf) diff --git a/drivers/xen/grant-table.c b/drivers/xen/grant-table.c index 1a1aec0a88a1..1b9b28bc3228 100644 --- a/drivers/xen/grant-table.c +++ b/drivers/xen/grant-table.c @@ -430,13 +430,13 @@ int gnttab_try_end_foreign_access(grant_ref_t ref) } EXPORT_SYMBOL_GPL(gnttab_try_end_foreign_access); -void gnttab_end_foreign_access(grant_ref_t ref, unsigned long page) +void gnttab_end_foreign_access(grant_ref_t ref, struct page *page) { if (gnttab_try_end_foreign_access(ref)) { - if (page != 0) - put_page(virt_to_page(page)); + if (page) + put_page(page); } else - gnttab_add_deferred(ref, page ? virt_to_page(page) : NULL); + gnttab_add_deferred(ref, page); } EXPORT_SYMBOL_GPL(gnttab_end_foreign_access); diff --git a/drivers/xen/pvcalls-front.c b/drivers/xen/pvcalls-front.c index e254ed19488f..1826e8e67125 100644 --- a/drivers/xen/pvcalls-front.c +++ b/drivers/xen/pvcalls-front.c @@ -238,8 +238,8 @@ static void pvcalls_front_free_map(struct pvcalls_bedata *bedata, spin_unlock(&bedata->socket_lock); for (i = 0; i < (1 << PVCALLS_RING_ORDER); i++) - gnttab_end_foreign_access(map->active.ring->ref[i], 0); - gnttab_end_foreign_access(map->active.ref, 0); + gnttab_end_foreign_access(map->active.ring->ref[i], NULL); + gnttab_end_foreign_access(map->active.ref, NULL); free_page((unsigned long)map->active.ring); kfree(map); @@ -1117,7 +1117,7 @@ static int pvcalls_front_remove(struct xenbus_device *dev) } } if (bedata->ref != -1) - gnttab_end_foreign_access(bedata->ref, 0); + gnttab_end_foreign_access(bedata->ref, NULL); kfree(bedata->ring.sring); kfree(bedata); xenbus_switch_state(dev, XenbusStateClosed); diff --git a/drivers/xen/xen-front-pgdir-shbuf.c b/drivers/xen/xen-front-pgdir-shbuf.c index b6433761d42c..bef8d72a6ca6 100644 --- a/drivers/xen/xen-front-pgdir-shbuf.c +++ b/drivers/xen/xen-front-pgdir-shbuf.c @@ -135,7 +135,7 @@ void xen_front_pgdir_shbuf_free(struct xen_front_pgdir_shbuf *buf) for (i = 0; i < buf->num_grefs; i++) if (buf->grefs[i] != INVALID_GRANT_REF) - gnttab_end_foreign_access(buf->grefs[i], 0UL); + gnttab_end_foreign_access(buf->grefs[i], NULL); } kfree(buf->grefs); kfree(buf->directory); diff --git a/drivers/xen/xenbus/xenbus_client.c b/drivers/xen/xenbus/xenbus_client.c index d6fdd2d209d3..d5f3f763717e 100644 --- a/drivers/xen/xenbus/xenbus_client.c +++ b/drivers/xen/xenbus/xenbus_client.c @@ -439,7 +439,7 @@ void xenbus_teardown_ring(void **vaddr, unsigned int nr_pages, for (i = 0; i < nr_pages; i++) { if (grefs[i] != INVALID_GRANT_REF) { - gnttab_end_foreign_access(grefs[i], 0); + gnttab_end_foreign_access(grefs[i], NULL); grefs[i] = INVALID_GRANT_REF; } } |