mm/hugetlb: export hugetlb_entry_migration helper
authorAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Thu, 6 Jul 2017 22:38:47 +0000 (15:38 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 6 Jul 2017 23:24:33 +0000 (16:24 -0700)
We will be using this later from the ppc64 code.  Change the return type
to bool.

Link: http://lkml.kernel.org/r/1494926612-23928-4-git-send-email-aneesh.kumar@linux.vnet.ibm.com
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Reviewed-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Cc: Anshuman Khandual <khandual@linux.vnet.ibm.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>
include/linux/hugetlb.h
mm/hugetlb.c

index 5f539f985e2af2cad4dcbee274b88752607006b9..aa1df49b9a1432c263bc99f826c81aadf3905528 100644 (file)
@@ -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)
index 040d53ac1f8de0c281a31b9225dfc13078b2bb33..65c84414a6b760e505104429ef5f3d9a7fc8b58d 100644 (file)
@@ -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)