Skip to contentSkip to conversation

mm/hugetlb: export hugetlb_entry_migration helper

PATCH New [email protected] 1 participant 1 message Jul 6, 2017

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

PATCH 64/108 mm/hugetlb: export hugetlb_entry_migration helper

From: "Aneesh Kumar K.V" <[email protected]>
Subject: mm/hugetlb: export hugetlb_entry_migration helper

We will be using this later from the ppc64 code. Change the return type to bool.

---

 include/linux/hugetlb.h |    1 +
 mm/hugetlb.c            |    8 ++++----
 2 files changed, 5 insertions(+), 4 deletions(-)
include/linux/hugetlb.h renamed from include/linux/hugetlb.h~mm-hugetlb-export-hugetlb_entry_migration-helper +1 -0
diff -puN include/linux/hugetlb.h~mm-hugetlb-export-hugetlb_entry_migration-helper 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)
mm/hugetlb.c renamed from mm/hugetlb.c~mm-hugetlb-export-hugetlb_entry_migration-helper +4 -4
diff -puN mm/hugetlb.c~mm-hugetlb-export-hugetlb_entry_migration-helper mm/hugetlb.c
@@ -3201,17 +3201,17 @@ static void set_huge_ptep_writable(struc
 		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)

_