kill mm argument of vm_munmap()
authorAl Viro <viro@zeniv.linux.org.uk>
Sat, 21 Apr 2012 01:57:04 +0000 (21:57 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Sat, 21 Apr 2012 05:58:20 +0000 (01:58 -0400)
it's always current->mm

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
arch/ia64/kernel/perfmon.c
arch/sparc/kernel/sys_sparc_64.c
arch/x86/kvm/x86.c
drivers/gpu/drm/i810/i810_dma.c
fs/aio.c
include/linux/mm.h
mm/mmap.c
mm/nommu.c

index 899c0fa5b49829fa87315de6a64c831b21560f87..f00ba025375d5696d0070bfe640b6f26f554eebd 100644 (file)
@@ -1468,7 +1468,7 @@ pfm_remove_smpl_mapping(void *vaddr, unsigned long size)
        /*
         * does the actual unmapping
         */
-       r = vm_munmap(current->mm, (unsigned long)vaddr, size);
+       r = vm_munmap((unsigned long)vaddr, size);
 
        if (r !=0) {
                printk(KERN_ERR "perfmon: [%d] unable to unmap sampling buffer @%p size=%lu\n", task_pid_nr(task), vaddr, size);
index 022e57aadf5d5826ef4aed10d8c5c7da2e9031b9..3ee51f189a55297b0babeb1f54d0b40af97de6f8 100644 (file)
@@ -569,7 +569,7 @@ SYSCALL_DEFINE2(64_munmap, unsigned long, addr, size_t, len)
        if (invalid_64bit_range(addr, len))
                return -EINVAL;
 
-       return vm_munmap(current->mm, addr, len);
+       return vm_munmap(addr, len);
 }
 
 extern unsigned long do_mremap(unsigned long addr,
index 1457be305fb1dd77bf7c62a5cf22bddb543470cb..91a5e989abcfe86f60df7bcb2a2919e25f87df6a 100644 (file)
@@ -6364,7 +6364,7 @@ void kvm_arch_commit_memory_region(struct kvm *kvm,
        if (!user_alloc && !old.user_alloc && old.rmap && !npages) {
                int ret;
 
-               ret = vm_munmap(current->mm, old.userspace_addr,
+               ret = vm_munmap(old.userspace_addr,
                                old.npages * PAGE_SIZE);
                if (ret < 0)
                        printk(KERN_WARNING
index a4ba453b3d273b72126f6827cda13065cea69da4..f920fb5e42b63846e3d8b7b782b492e547e18eef 100644 (file)
@@ -158,8 +158,7 @@ static int i810_unmap_buffer(struct drm_buf *buf)
        if (buf_priv->currently_mapped != I810_BUF_MAPPED)
                return -EINVAL;
 
-       retcode = vm_munmap(current->mm,
-                           (unsigned long)buf_priv->virtual,
+       retcode = vm_munmap((unsigned long)buf_priv->virtual,
                            (size_t) buf->total);
 
        buf_priv->currently_mapped = I810_BUF_UNMAPPED;
index 976e33d9741303d0d1643ddaf865918ebeca27c9..67a6db3e1b6f83677009d2323c54dccd38dea63d 100644 (file)
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -94,7 +94,7 @@ static void aio_free_ring(struct kioctx *ctx)
 
        if (info->mmap_size) {
                BUG_ON(ctx->mm != current->mm);
-               vm_munmap(ctx->mm, info->mmap_base, info->mmap_size);
+               vm_munmap(info->mmap_base, info->mmap_size);
        }
 
        if (info->ring_pages && info->ring_pages != info->internal_pages)
index 86a692c3b2383938f14cf104341bd83d0a8ad0e4..74aa71bea1e4ff6bf0bd7a43dfdff37c870438ee 100644 (file)
@@ -1403,7 +1403,7 @@ extern int do_munmap(struct mm_struct *, unsigned long, size_t);
 
 /* These take the mm semaphore themselves */
 extern unsigned long vm_brk(unsigned long, unsigned long);
-extern int vm_munmap(struct mm_struct *, unsigned long, size_t);
+extern int vm_munmap(unsigned long, size_t);
 extern unsigned long vm_mmap(struct file *, unsigned long,
         unsigned long, unsigned long,
         unsigned long, unsigned long);
index b38b47ef1f776339670aa911cf65bfba22a6e7a5..848ef52d96031f5061bc86582aa0120ccd0394e8 100644 (file)
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -2134,9 +2134,10 @@ int do_munmap(struct mm_struct *mm, unsigned long start, size_t len)
 }
 EXPORT_SYMBOL(do_munmap);
 
-int vm_munmap(struct mm_struct *mm, unsigned long start, size_t len)
+int vm_munmap(unsigned long start, size_t len)
 {
        int ret;
+       struct mm_struct *mm = current->mm;
 
        down_write(&mm->mmap_sem);
        ret = do_munmap(mm, start, len);
@@ -2148,7 +2149,7 @@ EXPORT_SYMBOL(vm_munmap);
 SYSCALL_DEFINE2(munmap, unsigned long, addr, size_t, len)
 {
        profile_munmap(addr);
-       return vm_munmap(current->mm, addr, len);
+       return vm_munmap(addr, len);
 }
 
 static inline void verify_mm_writelocked(struct mm_struct *mm)
index dd00383be2d9f2f20e3997cf2fdef56e3f0f79cf..bb8f4f004a82ce57abb0653a9a8ed72d533f5c45 100644 (file)
@@ -1734,8 +1734,9 @@ erase_whole_vma:
 }
 EXPORT_SYMBOL(do_munmap);
 
-int vm_munmap(struct mm_struct *mm, unsigned long addr, size_t len)
+int vm_munmap(unsigned long addr, size_t len)
 {
+       struct mm_struct *mm = current->mm;
        int ret;
 
        down_write(&mm->mmap_sem);
@@ -1747,7 +1748,7 @@ EXPORT_SYMBOL(vm_munmap);
 
 SYSCALL_DEFINE2(munmap, unsigned long, addr, size_t, len)
 {
-       return vm_munmap(current->mm, addr, len);
+       return vm_munmap(addr, len);
 }
 
 /*