Commit 027232da authored by Kirill A. Shutemov's avatar Kirill A. Shutemov Committed by Linus Torvalds
Browse files

mm: introduce vma_init()

Not all VMAs allocated with vm_area_alloc().  Some of them allocated on
stack or in data segment.

The new helper can be use to initialize VMA properly regardless where it
was allocated.


Signed-off-by: default avatarKirill A. Shutemov <>
Acked-by: default avatarLinus Torvalds <>
Reviewed-by: default avatarAndrew Morton <>
Cc: Dmitry Vyukov <>
Cc: Oleg Nesterov <>
Cc: Andrea Arcangeli <>
Cc: <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent 31c5bda3
......@@ -452,6 +452,12 @@ struct vm_operations_struct {
unsigned long addr);
static inline void vma_init(struct vm_area_struct *vma, struct mm_struct *mm)
vma->vm_mm = mm;
struct mmu_gather;
struct inode;
......@@ -312,10 +312,8 @@ struct vm_area_struct *vm_area_alloc(struct mm_struct *mm)
struct vm_area_struct *vma = kmem_cache_zalloc(vm_area_cachep, GFP_KERNEL);
if (vma) {
vma->vm_mm = mm;
if (vma)
vma_init(vma, mm);
return vma;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment