diff options
author | Michal Hocko <mhocko@suse.cz> | 2011-05-24 20:11:44 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-05-25 11:39:12 -0400 |
commit | d05f3169c0fbca16132ec7c2be71685c6de638b5 (patch) | |
tree | 37d82004869fa4e530617883f12cab7538dbd4a6 /include | |
parent | 248ac0e1943ad1796393d281b096184719eb3f97 (diff) |
mm: make expand_downwards() symmetrical with expand_upwards()
Currently we have expand_upwards exported while expand_downwards is
accessible only via expand_stack or expand_stack_downwards.
check_stack_guard_page is a nice example of the asymmetry. It uses
expand_stack for VM_GROWSDOWN while expand_upwards is called for
VM_GROWSUP case.
Let's clean this up by exporting both functions and make those names
consistent. Let's use expand_{upwards,downwards} because expanding
doesn't always involve stack manipulation (an example is
ia64_do_page_fault which uses expand_upwards for registers backing store
expansion). expand_downwards has to be defined for both
CONFIG_STACK_GROWS{UP,DOWN} because get_arg_page calls the downwards
version in the early process initialization phase for growsup
configuration.
Signed-off-by: Michal Hocko <mhocko@suse.cz>
Acked-by: Hugh Dickins <hughd@google.com>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: "Luck, Tony" <tony.luck@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/mm.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/include/linux/mm.h b/include/linux/mm.h index e173cd297d88..d2948af126ca 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -1518,15 +1518,17 @@ unsigned long ra_submit(struct file_ra_state *ra, | |||
1518 | struct address_space *mapping, | 1518 | struct address_space *mapping, |
1519 | struct file *filp); | 1519 | struct file *filp); |
1520 | 1520 | ||
1521 | /* Do stack extension */ | 1521 | /* Generic expand stack which grows the stack according to GROWS{UP,DOWN} */ |
1522 | extern int expand_stack(struct vm_area_struct *vma, unsigned long address); | 1522 | extern int expand_stack(struct vm_area_struct *vma, unsigned long address); |
1523 | |||
1524 | /* CONFIG_STACK_GROWSUP still needs to to grow downwards at some places */ | ||
1525 | extern int expand_downwards(struct vm_area_struct *vma, | ||
1526 | unsigned long address); | ||
1523 | #if VM_GROWSUP | 1527 | #if VM_GROWSUP |
1524 | extern int expand_upwards(struct vm_area_struct *vma, unsigned long address); | 1528 | extern int expand_upwards(struct vm_area_struct *vma, unsigned long address); |
1525 | #else | 1529 | #else |
1526 | #define expand_upwards(vma, address) do { } while (0) | 1530 | #define expand_upwards(vma, address) do { } while (0) |
1527 | #endif | 1531 | #endif |
1528 | extern int expand_stack_downwards(struct vm_area_struct *vma, | ||
1529 | unsigned long address); | ||
1530 | 1532 | ||
1531 | /* Look up the first VMA which satisfies addr < vm_end, NULL if none. */ | 1533 | /* Look up the first VMA which satisfies addr < vm_end, NULL if none. */ |
1532 | extern struct vm_area_struct * find_vma(struct mm_struct * mm, unsigned long addr); | 1534 | extern struct vm_area_struct * find_vma(struct mm_struct * mm, unsigned long addr); |