diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2000-01-27 01:05:20 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2000-01-27 01:05:20 +0000 |
commit | 546db14ee74118296f425f3b91634fb767d67290 (patch) | |
tree | 22b613a3da8d4bf663eec5e155af01b87fdf9094 /mm/mlock.c | |
parent | 1e25e41c4f5474e14452094492dbc169b800e4c8 (diff) |
Merge with Linux 2.3.23. The new bootmem stuff has broken various
platforms. At this time I've only verified that IP22 support compiles
and IP27 actually works.
Diffstat (limited to 'mm/mlock.c')
-rw-r--r-- | mm/mlock.c | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/mm/mlock.c b/mm/mlock.c index be5e07cbf..9709d1a04 100644 --- a/mm/mlock.c +++ b/mm/mlock.c @@ -13,7 +13,9 @@ static inline int mlock_fixup_all(struct vm_area_struct * vma, int newflags) { + vmlist_modify_lock(vma->vm_mm); vma->vm_flags = newflags; + vmlist_modify_unlock(vma->vm_mm); return 0; } @@ -26,15 +28,17 @@ static inline int mlock_fixup_start(struct vm_area_struct * vma, if (!n) return -EAGAIN; *n = *vma; - vma->vm_start = end; n->vm_end = end; - vma->vm_offset += vma->vm_start - n->vm_start; n->vm_flags = newflags; if (n->vm_file) get_file(n->vm_file); if (n->vm_ops && n->vm_ops->open) n->vm_ops->open(n); + vmlist_modify_lock(vma->vm_mm); + vma->vm_offset += end - vma->vm_start; + vma->vm_start = end; insert_vm_struct(current->mm, n); + vmlist_modify_unlock(vma->vm_mm); return 0; } @@ -47,7 +51,6 @@ static inline int mlock_fixup_end(struct vm_area_struct * vma, if (!n) return -EAGAIN; *n = *vma; - vma->vm_end = start; n->vm_start = start; n->vm_offset += n->vm_start - vma->vm_start; n->vm_flags = newflags; @@ -55,7 +58,10 @@ static inline int mlock_fixup_end(struct vm_area_struct * vma, get_file(n->vm_file); if (n->vm_ops && n->vm_ops->open) n->vm_ops->open(n); + vmlist_modify_lock(vma->vm_mm); + vma->vm_end = start; insert_vm_struct(current->mm, n); + vmlist_modify_unlock(vma->vm_mm); return 0; } @@ -75,10 +81,7 @@ static inline int mlock_fixup_middle(struct vm_area_struct * vma, *left = *vma; *right = *vma; left->vm_end = start; - vma->vm_start = start; - vma->vm_end = end; right->vm_start = end; - vma->vm_offset += vma->vm_start - left->vm_start; right->vm_offset += right->vm_start - left->vm_start; vma->vm_flags = newflags; if (vma->vm_file) @@ -88,8 +91,14 @@ static inline int mlock_fixup_middle(struct vm_area_struct * vma, vma->vm_ops->open(left); vma->vm_ops->open(right); } + vmlist_modify_lock(vma->vm_mm); + vma->vm_offset += start - vma->vm_start; + vma->vm_start = start; + vma->vm_end = end; + vma->vm_flags = newflags; insert_vm_struct(current->mm, left); insert_vm_struct(current->mm, right); + vmlist_modify_unlock(vma->vm_mm); return 0; } @@ -168,7 +177,9 @@ static int do_mlock(unsigned long start, size_t len, int on) break; } } + vmlist_modify_lock(current->mm); merge_segments(current->mm, start, end); + vmlist_modify_unlock(current->mm); return error; } @@ -240,7 +251,9 @@ static int do_mlockall(int flags) if (error) break; } + vmlist_modify_lock(current->mm); merge_segments(current->mm, 0, TASK_SIZE); + vmlist_modify_unlock(current->mm); return error; } |