__vm_flags_mod(vma, set, clear);
}
-static inline bool __vma_flag_atomic_valid(struct vm_area_struct *vma,
- vma_flag_t bit)
+static inline bool __vma_atomic_valid_flag(struct vm_area_struct *vma, vma_flag_t bit)
{
const vm_flags_t mask = BIT((__force int)bit);
* Set VMA flag atomically. Requires only VMA/mmap read lock. Only specific
* valid flags are allowed to do this.
*/
-static inline void vma_flag_set_atomic(struct vm_area_struct *vma,
- vma_flag_t bit)
+static inline void vma_set_atomic_flag(struct vm_area_struct *vma, vma_flag_t bit)
{
unsigned long *bitmap = vma->flags.__vma_flags;
vma_assert_stabilised(vma);
- if (__vma_flag_atomic_valid(vma, bit))
+ if (__vma_atomic_valid_flag(vma, bit))
set_bit((__force int)bit, bitmap);
}
* This is necessarily racey, so callers must ensure that serialisation is
* achieved through some other means, or that races are permissible.
*/
-static inline bool vma_flag_test_atomic(struct vm_area_struct *vma,
- vma_flag_t bit)
+static inline bool vma_test_atomic_flag(struct vm_area_struct *vma, vma_flag_t bit)
{
- if (__vma_flag_atomic_valid(vma, bit))
+ if (__vma_atomic_valid_flag(vma, bit))
return test_bit((__force int)bit, &vma->vm_flags);
return false;
* obtained on guard region installation after the flag is set, so this
* check being performed under this lock excludes races.
*/
- if (vma_flag_test_atomic(vma, VMA_MAYBE_GUARD_BIT))
+ if (vma_test_atomic_flag(vma, VMA_MAYBE_GUARD_BIT))
return false;
return true;
* acquire an mmap/VMA write lock to read it. All remaining readers may
* or may not see the flag set, but we don't care.
*/
- vma_flag_set_atomic(vma, VMA_MAYBE_GUARD_BIT);
+ vma_set_atomic_flag(vma, VMA_MAYBE_GUARD_BIT);
/*
* If anonymous and we are establishing page tables the VMA ought to