summaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>2017-07-06 18:38:53 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2017-07-06 19:24:33 -0400
commite22992923f741c951b830121655b58342fce202e (patch)
treed4444fe468ba094df71bb4b44bc40e051cbe8f1a /include/linux
parentfaaa5b62d3f7907e217b179556038f9f8e157ee0 (diff)
mm/hugetlb: move default definition of hugepd_t earlier in the header
This enable to use the hugepd_t type early. No functional change in this patch. Link: http://lkml.kernel.org/r/1494926612-23928-6-git-send-email-aneesh.kumar@linux.vnet.ibm.com Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Cc: Anshuman Khandual <khandual@linux.vnet.ibm.com> Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com> Cc: Michael Ellerman <mpe@ellerman.id.au> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Mike Kravetz <kravetz@us.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/hugetlb.h47
1 files changed, 24 insertions, 23 deletions
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
index 3656ce605dc9..f01427c79947 100644
--- a/include/linux/hugetlb.h
+++ b/include/linux/hugetlb.h
@@ -14,6 +14,30 @@ struct ctl_table;
14struct user_struct; 14struct user_struct;
15struct mmu_gather; 15struct mmu_gather;
16 16
17#ifndef is_hugepd
18/*
19 * Some architectures requires a hugepage directory format that is
20 * required to support multiple hugepage sizes. For example
21 * a4fe3ce76 "powerpc/mm: Allow more flexible layouts for hugepage pagetables"
22 * introduced the same on powerpc. This allows for a more flexible hugepage
23 * pagetable layout.
24 */
25typedef struct { unsigned long pd; } hugepd_t;
26#define is_hugepd(hugepd) (0)
27#define __hugepd(x) ((hugepd_t) { (x) })
28static inline int gup_huge_pd(hugepd_t hugepd, unsigned long addr,
29 unsigned pdshift, unsigned long end,
30 int write, struct page **pages, int *nr)
31{
32 return 0;
33}
34#else
35extern int gup_huge_pd(hugepd_t hugepd, unsigned long addr,
36 unsigned pdshift, unsigned long end,
37 int write, struct page **pages, int *nr);
38#endif
39
40
17#ifdef CONFIG_HUGETLB_PAGE 41#ifdef CONFIG_HUGETLB_PAGE
18 42
19#include <linux/mempolicy.h> 43#include <linux/mempolicy.h>
@@ -222,29 +246,6 @@ static inline int pud_write(pud_t pud)
222} 246}
223#endif 247#endif
224 248
225#ifndef is_hugepd
226/*
227 * Some architectures requires a hugepage directory format that is
228 * required to support multiple hugepage sizes. For example
229 * a4fe3ce76 "powerpc/mm: Allow more flexible layouts for hugepage pagetables"
230 * introduced the same on powerpc. This allows for a more flexible hugepage
231 * pagetable layout.
232 */
233typedef struct { unsigned long pd; } hugepd_t;
234#define is_hugepd(hugepd) (0)
235#define __hugepd(x) ((hugepd_t) { (x) })
236static inline int gup_huge_pd(hugepd_t hugepd, unsigned long addr,
237 unsigned pdshift, unsigned long end,
238 int write, struct page **pages, int *nr)
239{
240 return 0;
241}
242#else
243extern int gup_huge_pd(hugepd_t hugepd, unsigned long addr,
244 unsigned pdshift, unsigned long end,
245 int write, struct page **pages, int *nr);
246#endif
247
248#define HUGETLB_ANON_FILE "anon_hugepage" 249#define HUGETLB_ANON_FILE "anon_hugepage"
249 250
250enum { 251enum {