[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210112161240.2024684-71-Liam.Howlett@Oracle.com>
Date: Tue, 12 Jan 2021 11:12:40 -0500
From: "Liam R. Howlett" <Liam.Howlett@...cle.com>
To: maple-tree@...ts.infradead.org, linux-mm@...ck.org,
linux-kernel@...r.kernel.org
Cc: Andrew Morton <akpm@...gle.com>, Song Liu <songliubraving@...com>,
Davidlohr Bueso <dave@...olabs.net>,
"Paul E . McKenney" <paulmck@...nel.org>,
Matthew Wilcox <willy@...radead.org>,
Jerome Glisse <jglisse@...hat.com>,
David Rientjes <rientjes@...gle.com>,
Axel Rasmussen <axelrasmussen@...gle.com>,
Suren Baghdasaryan <surenb@...gle.com>,
Vlastimil Babka <vbabka@...e.cz>,
Rik van Riel <riel@...riel.com>,
Peter Zijlstra <peterz@...radead.org>
Subject: [PATCH v2 70/70] mm/mmap: Convert __insert_vm_struct to use mas, convert vma_link to use vma_mas_link()
Drop unused vma_store()
Signed-off-by: Liam R. Howlett <Liam.Howlett@...cle.com>
---
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
Powered by blists - more mailing lists