aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/xen/gntalloc.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/gntalloc.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/gntalloc.c')
-rw-r--r--drivers/xen/gntalloc.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/drivers/xen/gntalloc.c b/drivers/xen/gntalloc.c
index a7ffdfe19fc9..f6832f46aea4 100644
--- a/drivers/xen/gntalloc.c
+++ b/drivers/xen/gntalloc.c
@@ -427,6 +427,17 @@ static long gntalloc_ioctl(struct file *filp, unsigned int cmd,
427 return 0; 427 return 0;
428} 428}
429 429
430static void gntalloc_vma_open(struct vm_area_struct *vma)
431{
432 struct gntalloc_gref *gref = vma->vm_private_data;
433 if (!gref)
434 return;
435
436 spin_lock(&gref_lock);
437 gref->users++;
438 spin_unlock(&gref_lock);
439}
440
430static void gntalloc_vma_close(struct vm_area_struct *vma) 441static void gntalloc_vma_close(struct vm_area_struct *vma)
431{ 442{
432 struct gntalloc_gref *gref = vma->vm_private_data; 443 struct gntalloc_gref *gref = vma->vm_private_data;
@@ -441,6 +452,7 @@ static void gntalloc_vma_close(struct vm_area_struct *vma)
441} 452}
442 453
443static struct vm_operations_struct gntalloc_vmops = { 454static struct vm_operations_struct gntalloc_vmops = {
455 .open = gntalloc_vma_open,
444 .close = gntalloc_vma_close, 456 .close = gntalloc_vma_close,
445}; 457};
446 458
@@ -471,8 +483,6 @@ static int gntalloc_mmap(struct file *filp, struct vm_area_struct *vma)
471 vma->vm_private_data = gref; 483 vma->vm_private_data = gref;
472 484
473 vma->vm_flags |= VM_RESERVED; 485 vma->vm_flags |= VM_RESERVED;
474 vma->vm_flags |= VM_DONTCOPY;
475 vma->vm_flags |= VM_PFNMAP | VM_PFN_AT_MMAP;
476 486
477 vma->vm_ops = &gntalloc_vmops; 487 vma->vm_ops = &gntalloc_vmops;
478 488