summaryrefslogtreecommitdiffstats
path: root/mm/mmap.c
diff options
context:
space:
mode:
authorAl Viro2012-02-13 04:58:52 +0100
committerJames Morris2012-02-14 00:45:42 +0100
commit4040153087478993cbf0809f444400a3c808074c (patch)
tree2dc7af85b0cf930f1656553bd38410b8c16601a6 /mm/mmap.c
parentmm: collapse security_vm_enough_memory() variants into a single function (diff)
downloadkernel-qcow2-linux-4040153087478993cbf0809f444400a3c808074c.tar.gz
kernel-qcow2-linux-4040153087478993cbf0809f444400a3c808074c.tar.xz
kernel-qcow2-linux-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 db05495d6d0a..694a8625ab0d 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).
*/