]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
hugetlb-ensure-hugepage-access-is-denied-if-hugepages-are-not-supported-fix-fix
authorAndrew Morton <akpm@linux-foundation.org>
Thu, 24 Apr 2014 22:55:25 +0000 (08:55 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 24 Apr 2014 22:55:25 +0000 (08:55 +1000)
fix build when HPAGE_SHIFT is undefined

Reported-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Nishanth Aravamudan <nacc@linux.vnet.ibm.com>
Cc: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
include/linux/hugetlb.h

index b0f0a1cc5e88431ea392c1d17f0bfa5a7bbf9058..b65166de1d9d1f754f787aa1f58444e9d3da4ff0 100644 (file)
@@ -412,6 +412,16 @@ static inline spinlock_t *huge_pte_lockptr(struct hstate *h,
        return &mm->page_table_lock;
 }
 
+static inline bool hugepages_supported(void)
+{
+       /*
+        * Some platform decide whether they support huge pages at boot
+        * time. On these, such as powerpc, HPAGE_SHIFT is set to 0 when
+        * there is no such support
+        */
+       return HPAGE_SHIFT != 0;
+}
+
 #else  /* CONFIG_HUGETLB_PAGE */
 struct hstate {};
 #define alloc_huge_page_node(h, nid) NULL
@@ -460,14 +470,4 @@ static inline spinlock_t *huge_pte_lock(struct hstate *h,
        return ptl;
 }
 
-static inline bool hugepages_supported(void)
-{
-       /*
-        * Some platform decide whether they support huge pages at boot
-        * time. On these, such as powerpc, HPAGE_SHIFT is set to 0 when
-        * there is no such support
-        */
-       return HPAGE_SHIFT != 0;
-}
-
 #endif /* _LINUX_HUGETLB_H */