}
}
+/*
+ * vma_mas_store() - Store a VMA in the maple tree.
+ * @vma: The vm_area_struct
+ * @mas: The maple state
+ *
+ * Efficient way to store a VMA in the maple tree when the @mas has already
+ * walked to the correct location.
+ *
+ * Note: the end address is inclusive in the maple tree.
+ */
static inline int vma_mas_store(struct vm_area_struct *vma, struct ma_state *mas)
{
mas->index = vma->vm_start;
return mas_store_gfp(mas, vma, GFP_KERNEL);
}
+/*
+ * vma_mas_remove() - Remove a VMA from the maple tree.
+ * @vma: The vm_area_struct
+ * @mas: The maple state
+ *
+ * Efficient way to remove a VMA from the maple tree when the @mas has already
+ * been established and points to the correct location.
+ * Note: the end address is inclusive in the maple tree.
+ */
static inline int vma_mas_remove(struct vm_area_struct *vma, struct ma_state *mas)
{
mas->index = vma->vm_start;
mas->last = vma->vm_end - 1;
return mas_store_gfp(mas, NULL, GFP_KERNEL);
}
+
/*
- * vma_mt_erase() - erase a VMA entry from the maple tree.
- *
- * @mm: The struct_mm
- * @vma: The vm_area_struct to erase from the maple tree.
- */
-static inline void vma_mt_erase(struct mm_struct *mm, struct vm_area_struct *vma)
-{
- trace_vma_mt_erase(mm, vma);
- mtree_erase(&mm->mm_mt, vma->vm_start);
-}
-/*
- * vma_mt_szero() - Set a given range to zero. Used when modifying a
- * vm_area_struct start or end.
- *
+ * vma_mt_szero() - Clear a given range from the maple tree.
* @mm: The struct_mm
* @start: The start address to zero
* @end: The end address to zero.
+ *
+ * Used when modifying a vm_area_struct start or end and there is no maple state
+ * pointing to the correct location.
+ * Note: the end address is inclusive in the maple tree.
*/
static inline void vma_mt_szero(struct mm_struct *mm, unsigned long start,
unsigned long end)
}
/*
* vma_mt_store() - Store a given vm_area_struct in the maple tree.
- *
* @mm: The struct_mm
* @vma: The vm_area_struct to store in the maple tree.
+ *
+ * Used when there is no maple state pointing to the correct location.
+ * Note: the end address is inclusive in the maple tree.
*/
static inline void vma_mt_store(struct mm_struct *mm, struct vm_area_struct *vma)
{
/* Expanding over the next vma */
if (remove_next) {
- /* Remove from mm linked list - also updates highest_vm_end */
if (file)
__remove_shared_vm_struct(next, file, mapping);
}
max);
tlb_finish_mmu(&tlb, start, end);
}
+
/*
* __split_vma() bypasses sysctl_max_map_count checking. We use this where it
* has already been checked or doesn't make sense to fail.