mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-02-28 19:06:51 +01:00
In order to update all mmap_prepare users to utilising the new VMA flags type vma_flags_t and associated helper functions, we start by updating hugetlbfs which has a lot of additional logic that requires updating to make this change. This is laying the groundwork for eliminating the vm_flags_t from struct vm_area_desc and using vma_flags_t only, which further lays the ground for removing the deprecated vm_flags_t type altogether. No functional changes intended. Link: https://lkml.kernel.org/r/9226bec80c9aa3447cc2b83354f733841dba8a50.1769097829.git.lorenzo.stoakes@oracle.com Signed-off-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com> Reviewed-by: Liam R. Howlett <Liam.Howlett@oracle.com> Cc: Baolin Wang <baolin.wang@linux.alibaba.com> Cc: Barry Song <baohua@kernel.org> Cc: David Hildenbrand <david@kernel.org> Cc: Dev Jain <dev.jain@arm.com> Cc: Jason Gunthorpe <jgg@nvidia.com> Cc: Suren Baghdasaryan <surenb@google.com> Cc: Vlastimil Babka <vbabka@suse.cz> Cc: Zi Yan <ziy@nvidia.com> Cc: Damien Le Moal <dlemoal@kernel.org> Cc: "Darrick J. Wong" <djwong@kernel.org> Cc: Jarkko Sakkinen <jarkko@kernel.org> Cc: Yury Norov <ynorov@nvidia.com> Cc: Chris Mason <clm@fb.com> Cc: Pedro Falcato <pfalcato@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
39 lines
677 B
C
39 lines
677 B
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#ifndef _LINUX_HUGETLB_INLINE_H
|
|
#define _LINUX_HUGETLB_INLINE_H
|
|
|
|
#include <linux/mm.h>
|
|
|
|
#ifdef CONFIG_HUGETLB_PAGE
|
|
|
|
static inline bool is_vm_hugetlb_flags(vm_flags_t vm_flags)
|
|
{
|
|
return !!(vm_flags & VM_HUGETLB);
|
|
}
|
|
|
|
static inline bool is_vma_hugetlb_flags(const vma_flags_t *flags)
|
|
{
|
|
return vma_flags_test(flags, VMA_HUGETLB_BIT);
|
|
}
|
|
|
|
#else
|
|
|
|
static inline bool is_vm_hugetlb_flags(vm_flags_t vm_flags)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
static inline bool is_vma_hugetlb_flags(const vma_flags_t *flags)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
#endif
|
|
|
|
static inline bool is_vm_hugetlb_page(struct vm_area_struct *vma)
|
|
{
|
|
return is_vm_hugetlb_flags(vma->vm_flags);
|
|
}
|
|
|
|
#endif
|