driver core: platform: Initialize dma_parms for platform devices
[linux-2.6-microblaze.git] / mm / mremap.c
index a7e282e..c881abe 100644 (file)
@@ -413,9 +413,20 @@ static unsigned long move_vma(struct vm_area_struct *vma,
                        /* Always put back VM_ACCOUNT since we won't unmap */
                        vma->vm_flags |= VM_ACCOUNT;
 
-                       vm_acct_memory(vma_pages(new_vma));
+                       vm_acct_memory(new_len >> PAGE_SHIFT);
                }
 
+               /*
+                * VMAs can actually be merged back together in copy_vma
+                * calling merge_vma. This can happen with anonymous vmas
+                * which have not yet been faulted, so if we were to consider
+                * this VMA split we'll end up adding VM_ACCOUNT on the
+                * next VMA, which is completely unrelated if this VMA
+                * was re-merged.
+                */
+               if (split && new_vma == vma)
+                       split = 0;
+
                /* We always clear VM_LOCKED[ONFAULT] on the old vma */
                vma->vm_flags &= VM_LOCKED_CLEAR_MASK;