[PATCH v2 70/70] mm/mmap: Convert __insert_vm_struct to use mas, convert vma_link to use vma_mas_link()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Drop unused vma_store()

Signed-off-by: Liam R. Howlett <Liam.Howlett@xxxxxxxxxx>
---
 mm/mmap.c | 24 ++++++++----------------
 1 file changed, 8 insertions(+), 16 deletions(-)

diff --git a/mm/mmap.c b/mm/mmap.c
index ce8857b9abd89..b4ed8be4899b8 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -514,21 +514,9 @@ static void vma_mas_link(struct mm_struct *mm, struct vm_area_struct *vma,
 
 static void vma_link(struct mm_struct *mm, struct vm_area_struct *vma)
 {
-	struct address_space *mapping = NULL;
+	MA_STATE(mas, &mm->mm_mt, vma->vm_start, vma->vm_end - 1);
 
-	if (vma->vm_file) {
-		mapping = vma->vm_file->f_mapping;
-		i_mmap_lock_write(mapping);
-	}
-
-	vma_mt_store(mm, vma);
-	__vma_link_file(vma);
-
-	if (mapping)
-		i_mmap_unlock_write(mapping);
-
-	mm->map_count++;
-	validate_mm(mm);
+	vma_mas_link(mm, vma, &mas);
 }
 
 /*
@@ -538,9 +526,13 @@ static void vma_link(struct mm_struct *mm, struct vm_area_struct *vma)
 static inline void __insert_vm_struct(struct mm_struct *mm,
 				      struct vm_area_struct *vma)
 {
-	if (find_vma_intersection(mm, vma->vm_start, vma->vm_end))
+	MA_STATE(mas, &mm->mm_mt, vma->vm_start, vma->vm_end - 1);
+
+	if (mas_find(&mas, vma->vm_end - 1))
 		BUG();
-	vma_mt_store(mm, vma);
+
+	mas_set_range(&mas, vma->vm_start, vma->vm_end - 1);
+	vma_mas_store(vma, &mas);
 	mm->map_count++;
 }
 
-- 
2.28.0





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux