*
* 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)
-{
-#ifdef CONFIG_DEBUG_VM_MAPLE_TREE
- /* Make sure no VMAs are about to be lost. */
- MA_STATE(test, mas->tree, vma->vm_start, vma->vm_end - 1);
- struct vm_area_struct *vma_mas;
- int count = 0;
-
- mas_for_each(&test, vma_mas, vma->vm_end - 1) {
- /* Rule out vma_expand */
- if ((vma->vm_start != vma_mas->vm_start) &&
- (vma->vm_end != vma_mas->vm_end))
- count++;
- }
-
- /* vma adjust may overwrite a partial entry or remove one */
- BUG_ON(count > 1);
-
- BUG_ON(mas->min > vma->vm_start);
- BUG_ON(mas->index > vma->vm_start);
-#endif
+static inline void vma_mas_store(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, vma, GFP_KERNEL);
+ mas_store_prealloc(mas, vma);
}
/*
* 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)
+static inline void vma_mas_remove(struct vm_area_struct *vma, struct ma_state *mas)
{
- int ret;
-
-#ifdef CONFIG_DEBUG_VM_MAPLE_TREE
- /* Make sure no VMAs are about to be lost. */
- MA_STATE(test, mas->tree, vma->vm_start, vma->vm_end - 1);
- struct vm_area_struct *vma_mas;
- int count = 0;
-
- mas_for_each(&test, vma_mas, vma->vm_end - 1)
- count++;
-
- BUG_ON(count != 1);
-
- BUG_ON(mas->min > vma->vm_start);
- BUG_ON(mas->min > mas->index);
-#endif
mas->index = vma->vm_start;
mas->last = vma->vm_end - 1;
- ret = mas_store_gfp(mas, NULL, GFP_KERNEL);
- return ret;
+ mas_store_prealloc(mas, NULL);
}
/* mm/util.c */