Commit bfce281c authored by Al Viro's avatar Al Viro

kill mm argument of vm_munmap()

it's always current->mm
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 9f3a4afb
...@@ -1468,7 +1468,7 @@ pfm_remove_smpl_mapping(void *vaddr, unsigned long size) ...@@ -1468,7 +1468,7 @@ pfm_remove_smpl_mapping(void *vaddr, unsigned long size)
/* /*
* does the actual unmapping * does the actual unmapping
*/ */
r = vm_munmap(current->mm, (unsigned long)vaddr, size); r = vm_munmap((unsigned long)vaddr, size);
if (r !=0) { if (r !=0) {
printk(KERN_ERR "perfmon: [%d] unable to unmap sampling buffer @%p size=%lu\n", task_pid_nr(task), vaddr, size); printk(KERN_ERR "perfmon: [%d] unable to unmap sampling buffer @%p size=%lu\n", task_pid_nr(task), vaddr, size);
......
...@@ -569,7 +569,7 @@ SYSCALL_DEFINE2(64_munmap, unsigned long, addr, size_t, len) ...@@ -569,7 +569,7 @@ SYSCALL_DEFINE2(64_munmap, unsigned long, addr, size_t, len)
if (invalid_64bit_range(addr, len)) if (invalid_64bit_range(addr, len))
return -EINVAL; return -EINVAL;
return vm_munmap(current->mm, addr, len); return vm_munmap(addr, len);
} }
extern unsigned long do_mremap(unsigned long addr, extern unsigned long do_mremap(unsigned long addr,
......
...@@ -6364,7 +6364,7 @@ void kvm_arch_commit_memory_region(struct kvm *kvm, ...@@ -6364,7 +6364,7 @@ void kvm_arch_commit_memory_region(struct kvm *kvm,
if (!user_alloc && !old.user_alloc && old.rmap && !npages) { if (!user_alloc && !old.user_alloc && old.rmap && !npages) {
int ret; int ret;
ret = vm_munmap(current->mm, old.userspace_addr, ret = vm_munmap(old.userspace_addr,
old.npages * PAGE_SIZE); old.npages * PAGE_SIZE);
if (ret < 0) if (ret < 0)
printk(KERN_WARNING printk(KERN_WARNING
......
...@@ -158,8 +158,7 @@ static int i810_unmap_buffer(struct drm_buf *buf) ...@@ -158,8 +158,7 @@ static int i810_unmap_buffer(struct drm_buf *buf)
if (buf_priv->currently_mapped != I810_BUF_MAPPED) if (buf_priv->currently_mapped != I810_BUF_MAPPED)
return -EINVAL; return -EINVAL;
retcode = vm_munmap(current->mm, retcode = vm_munmap((unsigned long)buf_priv->virtual,
(unsigned long)buf_priv->virtual,
(size_t) buf->total); (size_t) buf->total);
buf_priv->currently_mapped = I810_BUF_UNMAPPED; buf_priv->currently_mapped = I810_BUF_UNMAPPED;
......
...@@ -94,7 +94,7 @@ static void aio_free_ring(struct kioctx *ctx) ...@@ -94,7 +94,7 @@ static void aio_free_ring(struct kioctx *ctx)
if (info->mmap_size) { if (info->mmap_size) {
BUG_ON(ctx->mm != current->mm); 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) if (info->ring_pages && info->ring_pages != info->internal_pages)
......
...@@ -1403,7 +1403,7 @@ extern int do_munmap(struct mm_struct *, unsigned long, size_t); ...@@ -1403,7 +1403,7 @@ extern int do_munmap(struct mm_struct *, unsigned long, size_t);
/* These take the mm semaphore themselves */ /* These take the mm semaphore themselves */
extern unsigned long vm_brk(unsigned long, unsigned long); 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, extern unsigned long vm_mmap(struct file *, unsigned long,
unsigned long, unsigned long, unsigned long, unsigned long,
unsigned long, unsigned long); unsigned long, unsigned long);
......
...@@ -2134,9 +2134,10 @@ int do_munmap(struct mm_struct *mm, unsigned long start, size_t len) ...@@ -2134,9 +2134,10 @@ int do_munmap(struct mm_struct *mm, unsigned long start, size_t len)
} }
EXPORT_SYMBOL(do_munmap); 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; int ret;
struct mm_struct *mm = current->mm;
down_write(&mm->mmap_sem); down_write(&mm->mmap_sem);
ret = do_munmap(mm, start, len); ret = do_munmap(mm, start, len);
...@@ -2148,7 +2149,7 @@ EXPORT_SYMBOL(vm_munmap); ...@@ -2148,7 +2149,7 @@ EXPORT_SYMBOL(vm_munmap);
SYSCALL_DEFINE2(munmap, unsigned long, addr, size_t, len) SYSCALL_DEFINE2(munmap, unsigned long, addr, size_t, len)
{ {
profile_munmap(addr); 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) static inline void verify_mm_writelocked(struct mm_struct *mm)
......
...@@ -1734,8 +1734,9 @@ int do_munmap(struct mm_struct *mm, unsigned long start, size_t len) ...@@ -1734,8 +1734,9 @@ int do_munmap(struct mm_struct *mm, unsigned long start, size_t len)
} }
EXPORT_SYMBOL(do_munmap); 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; int ret;
down_write(&mm->mmap_sem); down_write(&mm->mmap_sem);
...@@ -1747,7 +1748,7 @@ EXPORT_SYMBOL(vm_munmap); ...@@ -1747,7 +1748,7 @@ EXPORT_SYMBOL(vm_munmap);
SYSCALL_DEFINE2(munmap, unsigned long, addr, size_t, len) SYSCALL_DEFINE2(munmap, unsigned long, addr, size_t, len)
{ {
return vm_munmap(current->mm, addr, len); return vm_munmap(addr, len);
} }
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment