1 From 39aa3cb3e8250db9188a6f1e3fb62ffa1a717678 Mon Sep 17 00:00:00 2001
2 From: Stefan Bader <stefan.bader@canonical.com>
3 Date: Tue, 31 Aug 2010 15:52:27 +0200
4 Subject: mm: Move vma_stack_continue into mm.h
6 From: Stefan Bader <stefan.bader@canonical.com>
8 commit 39aa3cb3e8250db9188a6f1e3fb62ffa1a717678 upstream.
10 So it can be used by all that need to check for that.
12 Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
13 Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 fs/proc/task_mmu.c | 3 ++-
18 include/linux/mm.h | 6 ++++++
20 3 files changed, 8 insertions(+), 7 deletions(-)
22 --- a/fs/proc/task_mmu.c
23 +++ b/fs/proc/task_mmu.c
24 @@ -224,7 +224,8 @@ static void show_map_vma(struct seq_file
25 /* We don't show the stack guard page in /proc/maps */
26 start = vma->vm_start;
27 if (vma->vm_flags & VM_GROWSDOWN)
29 + if (!vma_stack_continue(vma->vm_prev, vma->vm_start))
32 seq_printf(m, "%08lx-%08lx %c%c%c%c %08llx %02x:%02x %lu %n",
34 --- a/include/linux/mm.h
35 +++ b/include/linux/mm.h
36 @@ -863,6 +863,12 @@ int set_page_dirty(struct page *page);
37 int set_page_dirty_lock(struct page *page);
38 int clear_page_dirty_for_io(struct page *page);
40 +/* Is the vma a continuation of the stack vma above it? */
41 +static inline int vma_stack_continue(struct vm_area_struct *vma, unsigned long addr)
43 + return vma && (vma->vm_end == addr) && (vma->vm_flags & VM_GROWSDOWN);
46 extern unsigned long move_page_tables(struct vm_area_struct *vma,
47 unsigned long old_addr, struct vm_area_struct *new_vma,
48 unsigned long new_addr, unsigned long len);
51 @@ -135,12 +135,6 @@ void munlock_vma_page(struct page *page)
55 -/* Is the vma a continuation of the stack vma above it? */
56 -static inline int vma_stack_continue(struct vm_area_struct *vma, unsigned long addr)
58 - return vma && (vma->vm_end == addr) && (vma->vm_flags & VM_GROWSDOWN);
61 static inline int stack_guard_page(struct vm_area_struct *vma, unsigned long addr)
63 return (vma->vm_flags & VM_GROWSDOWN) &&