]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - include/linux/mm.h
sis190: scheduling while atomic error
[linux-2.6-omap-h63xx.git] / include / linux / mm.h
index 520238cbae5d10424ead32f6c9b03472c790decf..1b7b95c67acaf5df2fd9cb860599931119ddc029 100644 (file)
@@ -12,6 +12,7 @@
 #include <linux/prio_tree.h>
 #include <linux/debug_locks.h>
 #include <linux/mm_types.h>
+#include <linux/security.h>
 
 struct mempolicy;
 struct anon_vma;
@@ -512,6 +513,21 @@ static inline void set_page_links(struct page *page, enum zone_type zone,
        set_page_section(page, pfn_to_section_nr(pfn));
 }
 
+/*
+ * 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)
+{
+#ifdef CONFIG_SECURITY
+       hint &= PAGE_MASK;
+       if (((void *)hint != NULL) &&
+           (hint < mmap_min_addr))
+               return PAGE_ALIGN(mmap_min_addr);
+#endif
+       return hint;
+}
+
 /*
  * Some inline functions in vmstat.h depend on page_zone()
  */