summaryrefslogtreecommitdiffstats
path: root/mm/mremap.c
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>1999-01-04 16:03:48 +0000
committerRalf Baechle <ralf@linux-mips.org>1999-01-04 16:03:48 +0000
commit78c388aed2b7184182c08428db1de6c872d815f5 (patch)
tree4b2003b1b4ceb241a17faa995da8dd1004bb8e45 /mm/mremap.c
parenteb7a5bf93aaa4be1d7c6181100ab7639e74d67f7 (diff)
Merge with Linux 2.1.131 and more MIPS goodies.
(Did I mention that CVS is buggy ...)
Diffstat (limited to 'mm/mremap.c')
-rw-r--r--mm/mremap.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/mm/mremap.c b/mm/mremap.c
index cd7a7eb4a..a10870318 100644
--- a/mm/mremap.c
+++ b/mm/mremap.c
@@ -4,21 +4,13 @@
* (C) Copyright 1996 Linus Torvalds
*/
-#include <linux/stat.h>
-#include <linux/sched.h>
-#include <linux/kernel.h>
-#include <linux/mm.h>
-#include <linux/smp.h>
+#include <linux/slab.h>
#include <linux/smp_lock.h>
#include <linux/shm.h>
-#include <linux/errno.h>
#include <linux/mman.h>
-#include <linux/string.h>
-#include <linux/slab.h>
#include <linux/swap.h>
#include <asm/uaccess.h>
-#include <asm/system.h>
#include <asm/pgtable.h>
extern int vm_enough_memory(long pages);
@@ -142,7 +134,6 @@ static inline unsigned long move_vma(struct vm_area_struct * vma,
new_vma->vm_start = new_addr;
new_vma->vm_end = new_addr+new_len;
new_vma->vm_offset = vma->vm_offset + (addr - vma->vm_start);
- new_vma->vm_file = vma->vm_file;
if (new_vma->vm_file)
new_vma->vm_file->f_count++;
if (new_vma->vm_ops && new_vma->vm_ops->open)
@@ -151,6 +142,11 @@ static inline unsigned long move_vma(struct vm_area_struct * vma,
merge_segments(current->mm, new_vma->vm_start, new_vma->vm_end);
do_munmap(addr, old_len);
current->mm->total_vm += new_len >> PAGE_SHIFT;
+ if (new_vma->vm_flags & VM_LOCKED) {
+ current->mm->locked_vm += new_len >> PAGE_SHIFT;
+ make_pages_present(new_vma->vm_start,
+ new_vma->vm_end);
+ }
return new_addr;
}
kmem_cache_free(vm_area_cachep, new_vma);
@@ -224,8 +220,11 @@ asmlinkage unsigned long sys_mremap(unsigned long addr,
int pages = (new_len - old_len) >> PAGE_SHIFT;
vma->vm_end = addr + new_len;
current->mm->total_vm += pages;
- if (vma->vm_flags & VM_LOCKED)
+ if (vma->vm_flags & VM_LOCKED) {
current->mm->locked_vm += pages;
+ make_pages_present(addr + old_len,
+ addr + new_len);
+ }
ret = addr;
goto out;
}