mm: switch vma_merge(), split_vma(), and __split_vma to vma iterator
[linux-2.6-microblaze.git] / mm / nommu.c
index 9ddeb92..9a16673 100644 (file)
@@ -1297,18 +1297,20 @@ SYSCALL_DEFINE1(old_mmap, struct mmap_arg_struct __user *, arg)
  * split a vma into two pieces at address 'addr', a new vma is allocated either
  * for the first part or the tail.
  */
-int vmi_split_vma(struct vma_iterator *vmi, struct mm_struct *mm,
-                 struct vm_area_struct *vma, unsigned long addr, int new_below)
+int split_vma(struct vma_iterator *vmi, struct vm_area_struct *vma,
+             unsigned long addr, int new_below)
 {
        struct vm_area_struct *new;
        struct vm_region *region;
        unsigned long npages;
+       struct mm_struct *mm;
 
        /* we're only permitted to split anonymous regions (these should have
         * only a single usage on the region) */
        if (vma->vm_file)
                return -ENOMEM;
 
+       mm = vma->vm_mm;
        if (mm->map_count >= sysctl_max_map_count)
                return -ENOMEM;
 
@@ -1465,7 +1467,7 @@ int do_munmap(struct mm_struct *mm, unsigned long start, size_t len, struct list
                if (end != vma->vm_end && offset_in_page(end))
                        return -EINVAL;
                if (start != vma->vm_start && end != vma->vm_end) {
-                       ret = vmi_split_vma(&vmi, mm, vma, start, 1);
+                       ret = split_vma(&vmi, vma, start, 1);
                        if (ret < 0)
                                return ret;
                }