diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-04-20 19:20:01 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-04-20 20:29:13 -0400 |
commit | a46ef99d80817a167477ed1c8b4d90ee0c2e726f (patch) | |
tree | 3d8c980c627e8b9c009dbf63628a9be8b8d1069f /arch/ia64/kernel | |
parent | e4eb1ff61b323d6141614e5458a1f53c7046ff8e (diff) |
VM: add "vm_munmap()" helper function
Like the vm_brk() function, this is the same as "do_munmap()", except it
does the VM locking for the caller.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/ia64/kernel')
-rw-r--r-- | arch/ia64/kernel/perfmon.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/arch/ia64/kernel/perfmon.c b/arch/ia64/kernel/perfmon.c index 9d0fd7d5bb82..2777310b698b 100644 --- a/arch/ia64/kernel/perfmon.c +++ b/arch/ia64/kernel/perfmon.c | |||
@@ -605,9 +605,9 @@ pfm_unprotect_ctx_ctxsw(pfm_context_t *x, unsigned long f) | |||
605 | } | 605 | } |
606 | 606 | ||
607 | static inline unsigned int | 607 | static inline unsigned int |
608 | pfm_do_munmap(struct mm_struct *mm, unsigned long addr, size_t len, int acct) | 608 | pfm_vm_munmap(struct mm_struct *mm, unsigned long addr, size_t len) |
609 | { | 609 | { |
610 | return do_munmap(mm, addr, len); | 610 | return vm_munmap(mm, addr, len); |
611 | } | 611 | } |
612 | 612 | ||
613 | static inline unsigned long | 613 | static inline unsigned long |
@@ -1473,13 +1473,8 @@ pfm_remove_smpl_mapping(struct task_struct *task, void *vaddr, unsigned long siz | |||
1473 | /* | 1473 | /* |
1474 | * does the actual unmapping | 1474 | * does the actual unmapping |
1475 | */ | 1475 | */ |
1476 | down_write(&task->mm->mmap_sem); | 1476 | r = pfm_vm_munmap(task->mm, (unsigned long)vaddr, size); |
1477 | |||
1478 | DPRINT(("down_write done smpl_vaddr=%p size=%lu\n", vaddr, size)); | ||
1479 | 1477 | ||
1480 | r = pfm_do_munmap(task->mm, (unsigned long)vaddr, size, 0); | ||
1481 | |||
1482 | up_write(&task->mm->mmap_sem); | ||
1483 | if (r !=0) { | 1478 | if (r !=0) { |
1484 | printk(KERN_ERR "perfmon: [%d] unable to unmap sampling buffer @%p size=%lu\n", task_pid_nr(task), vaddr, size); | 1479 | printk(KERN_ERR "perfmon: [%d] unable to unmap sampling buffer @%p size=%lu\n", task_pid_nr(task), vaddr, size); |
1485 | } | 1480 | } |