]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
mm/internal.h: Convert vma_mas_remove and store to store_prealloc
authorLiam R. Howlett <Liam.Howlett@oracle.com>
Thu, 21 Apr 2022 21:59:15 +0000 (17:59 -0400)
committerLiam R. Howlett <Liam.Howlett@oracle.com>
Thu, 21 Apr 2022 22:35:00 +0000 (18:35 -0400)
Signed-off-by: Liam R. Howlett <Liam.Howlett@oracle.com>
mm/internal.h

index 3066b296d7cb79af8925315a6cb61c822c936c40..5a39dc426f0a12b7201d8aa61c32a3c4bc512815 100644 (file)
@@ -470,30 +470,11 @@ static inline bool is_data_mapping(vm_flags_t flags)
  *
  * 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);
 }
 
 /*
@@ -505,28 +486,11 @@ static inline int vma_mas_store(struct vm_area_struct *vma, struct ma_state *mas
  * 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 */