diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-04-20 16:20:01 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-04-20 17:29:13 -0700 |
commit | a46ef99d80817a167477ed1c8b4d90ee0c2e726f (patch) | |
tree | 3d8c980c627e8b9c009dbf63628a9be8b8d1069f /arch/x86 | |
parent | e4eb1ff61b323d6141614e5458a1f53c7046ff8e (diff) | |
download | op-kernel-dev-a46ef99d80817a167477ed1c8b4d90ee0c2e726f.zip op-kernel-dev-a46ef99d80817a167477ed1c8b4d90ee0c2e726f.tar.gz |
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/x86')
-rw-r--r-- | arch/x86/kvm/x86.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 4044ce0..8beb9ce 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -6366,10 +6366,8 @@ void kvm_arch_commit_memory_region(struct kvm *kvm, if (!user_alloc && !old.user_alloc && old.rmap && !npages) { int ret; - down_write(¤t->mm->mmap_sem); - ret = do_munmap(current->mm, old.userspace_addr, + ret = vm_munmap(current->mm, old.userspace_addr, old.npages * PAGE_SIZE); - up_write(¤t->mm->mmap_sem); if (ret < 0) printk(KERN_WARNING "kvm_vm_ioctl_set_memory_region: " |