aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/xen/gntdev.c
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2011-05-20 14:06:24 -0400
committerThomas Gleixner <tglx@linutronix.de>2011-05-20 14:08:05 -0400
commit250f972d85effad5b6e10da4bbd877e6a4b503b6 (patch)
tree007393a6fc6439af7e0121dd99a6f9f9fb8405bc /drivers/xen/gntdev.c
parent7372b0b122af0f6675f3ab65bfd91c8a438e0480 (diff)
parentbbe7b8bef48c567f5ff3f6041c1fb011292e8f12 (diff)
Merge branch 'timers/urgent' into timers/core
Reason: Get upstream fixes and kfree_rcu which is necessary for a follow up patch. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'drivers/xen/gntdev.c')
-rw-r--r--drivers/xen/gntdev.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/drivers/xen/gntdev.c b/drivers/xen/gntdev.c
index b0f9e8fb0052..f914b26cf0c2 100644
--- a/drivers/xen/gntdev.c
+++ b/drivers/xen/gntdev.c
@@ -330,17 +330,26 @@ static int unmap_grant_pages(struct grant_map *map, int offset, int pages)
330 330
331/* ------------------------------------------------------------------ */ 331/* ------------------------------------------------------------------ */
332 332
333static void gntdev_vma_open(struct vm_area_struct *vma)
334{
335 struct grant_map *map = vma->vm_private_data;
336
337 pr_debug("gntdev_vma_open %p\n", vma);
338 atomic_inc(&map->users);
339}
340
333static void gntdev_vma_close(struct vm_area_struct *vma) 341static void gntdev_vma_close(struct vm_area_struct *vma)
334{ 342{
335 struct grant_map *map = vma->vm_private_data; 343 struct grant_map *map = vma->vm_private_data;
336 344
337 pr_debug("close %p\n", vma); 345 pr_debug("gntdev_vma_close %p\n", vma);
338 map->vma = NULL; 346 map->vma = NULL;
339 vma->vm_private_data = NULL; 347 vma->vm_private_data = NULL;
340 gntdev_put_map(map); 348 gntdev_put_map(map);
341} 349}
342 350
343static struct vm_operations_struct gntdev_vmops = { 351static struct vm_operations_struct gntdev_vmops = {
352 .open = gntdev_vma_open,
344 .close = gntdev_vma_close, 353 .close = gntdev_vma_close,
345}; 354};
346 355
@@ -652,7 +661,10 @@ static int gntdev_mmap(struct file *flip, struct vm_area_struct *vma)
652 661
653 vma->vm_ops = &gntdev_vmops; 662 vma->vm_ops = &gntdev_vmops;
654 663
655 vma->vm_flags |= VM_RESERVED|VM_DONTCOPY|VM_DONTEXPAND|VM_PFNMAP; 664 vma->vm_flags |= VM_RESERVED|VM_DONTEXPAND;
665
666 if (use_ptemod)
667 vma->vm_flags |= VM_DONTCOPY|VM_PFNMAP;
656 668
657 vma->vm_private_data = map; 669 vma->vm_private_data = map;
658 670