diff options
-rw-r--r-- | include/linux/hugetlb.h | 1 | ||||
-rw-r--r-- | mm/hugetlb.c | 8 |
2 files changed, 5 insertions, 4 deletions
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index 5f539f985e2a..aa1df49b9a14 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h @@ -126,6 +126,7 @@ int pud_huge(pud_t pud); unsigned long hugetlb_change_protection(struct vm_area_struct *vma, unsigned long address, unsigned long end, pgprot_t newprot); +bool is_hugetlb_entry_migration(pte_t pte); #else /* !CONFIG_HUGETLB_PAGE */ static inline void reset_vma_resv_huge_pages(struct vm_area_struct *vma) diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 040d53ac1f8d..65c84414a6b7 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -3201,17 +3201,17 @@ static void set_huge_ptep_writable(struct vm_area_struct *vma, update_mmu_cache(vma, address, ptep); } -static int is_hugetlb_entry_migration(pte_t pte) +bool is_hugetlb_entry_migration(pte_t pte) { swp_entry_t swp; if (huge_pte_none(pte) || pte_present(pte)) - return 0; + return false; swp = pte_to_swp_entry(pte); if (non_swap_entry(swp) && is_migration_entry(swp)) - return 1; + return true; else - return 0; + return false; } static int is_hugetlb_entry_hwpoisoned(pte_t pte) |