diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index e46f6b49eb38..1c6f35ba1604 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h @@ -880,10 +880,7 @@ static inline bool hugepage_migration_supported(struct hstate *h) return arch_hugetlb_migration_supported(h); } -static inline bool __vma_private_lock(struct vm_area_struct *vma) -{ - return (!(vma->vm_flags & VM_MAYSHARE)) && vma->vm_private_data; -} +bool __vma_private_lock(struct vm_area_struct *vma); /* * Movability check is different as compared to migration check. diff --git a/mm/hugetlb.c b/mm/hugetlb.c index aa4a68dfb3b9..37288a7f0fa6 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -1189,6 +1189,13 @@ static int is_vma_resv_set(struct vm_area_struct *vma, unsigned long flag) return (get_vma_private_data(vma) & flag) != 0; } +bool __vma_private_lock(struct vm_area_struct *vma) +{ + return !(vma->vm_flags & VM_MAYSHARE) && + get_vma_private_data(vma) & ~HPAGE_RESV_MASK && + is_vma_resv_set(vma, HPAGE_RESV_OWNER); +} + void hugetlb_dup_vma_private(struct vm_area_struct *vma) { VM_BUG_ON_VMA(!is_vm_hugetlb_page(vma), vma);