summaryrefslogtreecommitdiff
path: root/mm/mmap.c
diff options
context:
space:
mode:
authorAl Viro <viro@ftp.linux.org.uk>2012-02-13 03:58:52 +0000
committerJames Morris <jmorris@namei.org>2012-02-14 10:45:42 +1100
commit4040153087478993cbf0809f444400a3c808074c (patch)
tree2dc7af85b0cf930f1656553bd38410b8c16601a6 /mm/mmap.c
parent191c542442fdf53cc3c496c00be13367fd9cd42d (diff)
downloadlinux-3.10-4040153087478993cbf0809f444400a3c808074c.tar.gz
linux-3.10-4040153087478993cbf0809f444400a3c808074c.tar.bz2
linux-3.10-4040153087478993cbf0809f444400a3c808074c.zip
security: trim security.h
Trim security.h Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: James Morris <jmorris@namei.org>
Diffstat (limited to 'mm/mmap.c')
-rw-r--r--mm/mmap.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/mm/mmap.c b/mm/mmap.c
index db05495d6d0..694a8625ab0 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -936,6 +936,19 @@ void vm_stat_account(struct mm_struct *mm, unsigned long flags,
#endif /* CONFIG_PROC_FS */
/*
+ * If a hint addr is less than mmap_min_addr change hint to be as
+ * low as possible but still greater than mmap_min_addr
+ */
+static inline unsigned long round_hint_to_min(unsigned long hint)
+{
+ hint &= PAGE_MASK;
+ if (((void *)hint != NULL) &&
+ (hint < mmap_min_addr))
+ return PAGE_ALIGN(mmap_min_addr);
+ return hint;
+}
+
+/*
* The caller must hold down_write(&current->mm->mmap_sem).
*/