xref: /linux/include/linux/hugetlb_inline.h (revision d60ec36cab338dfe2ae40d73e9c8d6c4af70d2b8)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _LINUX_HUGETLB_INLINE_H
3 #define _LINUX_HUGETLB_INLINE_H
4 
5 #include <linux/mm.h>
6 
7 #ifdef CONFIG_HUGETLB_PAGE
8 
is_vma_hugetlb_flags(const vma_flags_t * flags)9 static inline bool is_vma_hugetlb_flags(const vma_flags_t *flags)
10 {
11 	return vma_flags_test(flags, VMA_HUGETLB_BIT);
12 }
13 
14 #else
15 
is_vma_hugetlb_flags(const vma_flags_t * flags)16 static inline bool is_vma_hugetlb_flags(const vma_flags_t *flags)
17 {
18 	return false;
19 }
20 
21 #endif
22 
is_vm_hugetlb_page(const struct vm_area_struct * vma)23 static inline bool is_vm_hugetlb_page(const struct vm_area_struct *vma)
24 {
25 	return is_vma_hugetlb_flags(&vma->flags);
26 }
27 
28 #endif
29