projects
/
linux-2.6-microblaze.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
swapin_readahead: excise NUMA bogosity
[linux-2.6-microblaze.git]
/
mm
/
madvise.c
diff --git
a/mm/madvise.c
b/mm/madvise.c
index
e75096b
..
93ee375
100644
(file)
--- a/
mm/madvise.c
+++ b/
mm/madvise.c
@@
-10,6
+10,7
@@
#include <linux/syscalls.h>
#include <linux/mempolicy.h>
#include <linux/hugetlb.h>
#include <linux/syscalls.h>
#include <linux/mempolicy.h>
#include <linux/hugetlb.h>
+#include <linux/sched.h>
/*
* Any behaviour which results in changes to the vma->vm_flags needs to
/*
* Any behaviour which results in changes to the vma->vm_flags needs to
@@
-286,9
+287,11
@@
asmlinkage long sys_madvise(unsigned long start, size_t len_in, int behavior)
struct vm_area_struct * vma, *prev;
int unmapped_error = 0;
int error = -EINVAL;
struct vm_area_struct * vma, *prev;
int unmapped_error = 0;
int error = -EINVAL;
+ int write;
size_t len;
size_t len;
- if (madvise_need_mmap_write(behavior))
+ write = madvise_need_mmap_write(behavior);
+ if (write)
down_write(¤t->mm->mmap_sem);
else
down_read(¤t->mm->mmap_sem);
down_write(¤t->mm->mmap_sem);
else
down_read(¤t->mm->mmap_sem);
@@
-353,7
+356,7
@@
asmlinkage long sys_madvise(unsigned long start, size_t len_in, int behavior)
vma = find_vma(current->mm, start);
}
out:
vma = find_vma(current->mm, start);
}
out:
- if (
madvise_need_mmap_write(behavior)
)
+ if (
write
)
up_write(¤t->mm->mmap_sem);
else
up_read(¤t->mm->mmap_sem);
up_write(¤t->mm->mmap_sem);
else
up_read(¤t->mm->mmap_sem);