summaryrefslogtreecommitdiff
path: root/drivers/xen/gntdev.c
diff options
context:
space:
mode:
authorIan Campbell <ian.campbell@citrix.com>2010-12-08 14:57:40 +0300
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>2011-01-11 22:31:26 +0300
commit9329e7604fe915fd0201633d3c38adae307d56a5 (patch)
treea6ec7dac1ec9c040ca6fcc41d28a45ef24216c42 /drivers/xen/gntdev.c
parent448f2831934381e9d3c4d93e700ba7bbe14612dc (diff)
downloadlinux-9329e7604fe915fd0201633d3c38adae307d56a5.tar.xz
xen: gntdev: move use of GNTMAP_contains_pte next to the map_op
This flag controls the meaning of gnttab_map_grant_ref.host_addr and specifies that the field contains a reference to the pte entry to be used to perform the mapping. Therefore move the use of this flag to the point at which we actually use a reference to the pte instead of something else, splitting up the usage of the flag in this way is confusing and potentially error prone. The other flags are all properties of the mapping itself as opposed to properties of the hypercall arguments and therefore it make sense to continue to pass them round in map->flags. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Cc: Stefano Stabellini <Stefano.Stabellini@eu.citrix.com> Cc: Derek G. Murray <Derek.Murray@cl.cam.ac.uk> Cc: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Diffstat (limited to 'drivers/xen/gntdev.c')
-rw-r--r--drivers/xen/gntdev.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/xen/gntdev.c b/drivers/xen/gntdev.c
index fa6355a97081..888d76307d59 100644
--- a/drivers/xen/gntdev.c
+++ b/drivers/xen/gntdev.c
@@ -211,10 +211,12 @@ static int find_grant_ptes(pte_t *pte, pgtable_t token,
BUG_ON(pgnr >= map->count);
pte_maddr = (u64)pfn_to_mfn(page_to_pfn(token)) << PAGE_SHIFT;
pte_maddr += (unsigned long)pte & ~PAGE_MASK;
- gnttab_set_map_op(&map->map_ops[pgnr], pte_maddr, map->flags,
+ gnttab_set_map_op(&map->map_ops[pgnr], pte_maddr,
+ GNTMAP_contains_pte | map->flags,
map->grants[pgnr].ref,
map->grants[pgnr].domid);
- gnttab_set_unmap_op(&map->unmap_ops[pgnr], pte_maddr, map->flags,
+ gnttab_set_unmap_op(&map->unmap_ops[pgnr], pte_maddr,
+ GNTMAP_contains_pte | map->flags,
0 /* handle */);
return 0;
}
@@ -569,7 +571,7 @@ static int gntdev_mmap(struct file *flip, struct vm_area_struct *vma)
vma->vm_private_data = map;
map->vma = vma;
- map->flags = GNTMAP_host_map | GNTMAP_application_map | GNTMAP_contains_pte;
+ map->flags = GNTMAP_host_map | GNTMAP_application_map;
if (!(vma->vm_flags & VM_WRITE))
map->flags |= GNTMAP_readonly;