Skip to content

Commit

Permalink
mm: export various functions for the benefit of DAX
Browse files Browse the repository at this point in the history
To use the huge zero page in DAX, we need these functions exported.

Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
Cc: Hillf Danton <dhillf@gmail.com>
Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
Cc: Theodore Ts'o <tytso@mit.edu>
Cc: Jan Kara <jack@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Matthew Wilcox authored and Linus Torvalds committed Sep 8, 2015
1 parent b96375f commit fc43704
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
10 changes: 10 additions & 0 deletions include/linux/huge_mm.h
Original file line number Diff line number Diff line change
Expand Up @@ -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; })
Expand Down
7 changes: 1 addition & 6 deletions mm/huge_memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,12 +173,7 @@ static int start_stop_khugepaged(void)
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:
Expand Down

0 comments on commit fc43704

Please sign in to comment.