diff options
Diffstat (limited to 'mm/mmap.c')
-rw-r--r-- | mm/mmap.c | 16 |
1 files changed, 14 insertions, 2 deletions
@@ -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 | ||
243 | static unsigned long do_brk(unsigned long addr, unsigned long len); | ||
244 | |||
243 | SYSCALL_DEFINE1(brk, unsigned long, brk) | 245 | SYSCALL_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 | */ |
2139 | unsigned long do_brk(unsigned long addr, unsigned long len) | 2141 | static 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 | ||
2235 | EXPORT_SYMBOL(do_brk); | 2237 | unsigned 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 | } | ||
2247 | EXPORT_SYMBOL(vm_brk); | ||
2236 | 2248 | ||
2237 | /* Release all mmaps. */ | 2249 | /* Release all mmaps. */ |
2238 | void exit_mmap(struct mm_struct *mm) | 2250 | void exit_mmap(struct mm_struct *mm) |