diff options
Diffstat (limited to 'mm/util.c')
-rw-r--r-- | mm/util.c | 24 |
1 files changed, 24 insertions, 0 deletions
@@ -6,6 +6,8 @@ | |||
6 | #include <linux/sched.h> | 6 | #include <linux/sched.h> |
7 | #include <asm/uaccess.h> | 7 | #include <asm/uaccess.h> |
8 | 8 | ||
9 | #include "internal.h" | ||
10 | |||
9 | #define CREATE_TRACE_POINTS | 11 | #define CREATE_TRACE_POINTS |
10 | #include <trace/events/kmem.h> | 12 | #include <trace/events/kmem.h> |
11 | 13 | ||
@@ -215,6 +217,28 @@ char *strndup_user(const char __user *s, long n) | |||
215 | } | 217 | } |
216 | EXPORT_SYMBOL(strndup_user); | 218 | EXPORT_SYMBOL(strndup_user); |
217 | 219 | ||
220 | void __vma_link_list(struct mm_struct *mm, struct vm_area_struct *vma, | ||
221 | struct vm_area_struct *prev, struct rb_node *rb_parent) | ||
222 | { | ||
223 | struct vm_area_struct *next; | ||
224 | |||
225 | vma->vm_prev = prev; | ||
226 | if (prev) { | ||
227 | next = prev->vm_next; | ||
228 | prev->vm_next = vma; | ||
229 | } else { | ||
230 | mm->mmap = vma; | ||
231 | if (rb_parent) | ||
232 | next = rb_entry(rb_parent, | ||
233 | struct vm_area_struct, vm_rb); | ||
234 | else | ||
235 | next = NULL; | ||
236 | } | ||
237 | vma->vm_next = next; | ||
238 | if (next) | ||
239 | next->vm_prev = vma; | ||
240 | } | ||
241 | |||
218 | #if defined(CONFIG_MMU) && !defined(HAVE_ARCH_PICK_MMAP_LAYOUT) | 242 | #if defined(CONFIG_MMU) && !defined(HAVE_ARCH_PICK_MMAP_LAYOUT) |
219 | void arch_pick_mmap_layout(struct mm_struct *mm) | 243 | void arch_pick_mmap_layout(struct mm_struct *mm) |
220 | { | 244 | { |