aboutsummaryrefslogtreecommitdiffstats
path: root/mm/mmap.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/mmap.c')
-rw-r--r--mm/mmap.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/mm/mmap.c b/mm/mmap.c
index a7bf6a31c9f6..df51891c8646 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -240,6 +240,8 @@ static struct vm_area_struct *remove_vma(struct vm_area_struct *vma)
240 return next; 240 return next;
241} 241}
242 242
243static unsigned long do_brk(unsigned long addr, unsigned long len);
244
243SYSCALL_DEFINE1(brk, unsigned long, brk) 245SYSCALL_DEFINE1(brk, unsigned long, brk)
244{ 246{
245 unsigned long rlim, retval; 247 unsigned long rlim, retval;
@@ -2136,7 +2138,7 @@ static inline void verify_mm_writelocked(struct mm_struct *mm)
2136 * anonymous maps. eventually we may be able to do some 2138 * anonymous maps. eventually we may be able to do some
2137 * brk-specific accounting here. 2139 * brk-specific accounting here.
2138 */ 2140 */
2139unsigned long do_brk(unsigned long addr, unsigned long len) 2141static unsigned long do_brk(unsigned long addr, unsigned long len)
2140{ 2142{
2141 struct mm_struct * mm = current->mm; 2143 struct mm_struct * mm = current->mm;
2142 struct vm_area_struct * vma, * prev; 2144 struct vm_area_struct * vma, * prev;
@@ -2232,7 +2234,17 @@ out:
2232 return addr; 2234 return addr;
2233} 2235}
2234 2236
2235EXPORT_SYMBOL(do_brk); 2237unsigned long vm_brk(unsigned long addr, unsigned long len)
2238{
2239 struct mm_struct *mm = current->mm;
2240 unsigned long ret;
2241
2242 down_write(&mm->mmap_sem);
2243 ret = do_brk(addr, len);
2244 up_write(&mm->mmap_sem);
2245 return ret;
2246}
2247EXPORT_SYMBOL(vm_brk);
2236 2248
2237/* Release all mmaps. */ 2249/* Release all mmaps. */
2238void exit_mmap(struct mm_struct *mm) 2250void exit_mmap(struct mm_struct *mm)