From: Matthew Wilcox Date: Tue, 8 Sep 2015 21:58:51 +0000 (-0700) Subject: mm: export various functions for the benefit of DAX X-Git-Tag: v4.14-rc1~4721^2~130 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fc43704437ebe40f642ac53f7ee73661fe74e6b8;p=platform%2Fkernel%2Flinux-rpi.git mm: export various functions for the benefit of DAX To use the huge zero page in DAX, we need these functions exported. Signed-off-by: Matthew Wilcox Cc: Hillf Danton Cc: "Kirill A. Shutemov" Cc: Theodore Ts'o Cc: Jan Kara Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/include/linux/huge_mm.h b/include/linux/huge_mm.h index 1c53c7d..70587ea 100644 --- a/include/linux/huge_mm.h +++ b/include/linux/huge_mm.h @@ -155,6 +155,16 @@ static inline bool is_huge_zero_page(struct page *page) return ACCESS_ONCE(huge_zero_page) == page; } +static inline bool is_huge_zero_pmd(pmd_t pmd) +{ + return is_huge_zero_page(pmd_page(pmd)); +} + +struct page *get_huge_zero_page(void); +bool set_huge_zero_page(pgtable_t pgtable, struct mm_struct *mm, + struct vm_area_struct *vma, unsigned long haddr, + pmd_t *pmd, struct page *zero_page); + #else /* CONFIG_TRANSPARENT_HUGEPAGE */ #define HPAGE_PMD_SHIFT ({ BUILD_BUG(); 0; }) #define HPAGE_PMD_MASK ({ BUILD_BUG(); 0; }) diff --git a/mm/huge_memory.c b/mm/huge_memory.c index 9057241..c426a89 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -173,12 +173,7 @@ fail: static atomic_t huge_zero_refcount; struct page *huge_zero_page __read_mostly; -static inline bool is_huge_zero_pmd(pmd_t pmd) -{ - return is_huge_zero_page(pmd_page(pmd)); -} - -static struct page *get_huge_zero_page(void) +struct page *get_huge_zero_page(void) { struct page *zero_page; retry: