mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-27 12:57:53 +00:00
mmap: convert vma_link() vma iterator
Avoid using the maple tree interface directly. Link: https://lkml.kernel.org/r/20230120162650.984577-11-Liam.Howlett@oracle.com Signed-off-by: Liam R. Howlett <Liam.Howlett@oracle.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
parent
3b9dbd5e91
commit
79e4f2caa4
1 changed files with 3 additions and 3 deletions
|
@ -487,10 +487,10 @@ static inline void vma_mas_szero(struct ma_state *mas, unsigned long start,
|
||||||
|
|
||||||
static int vma_link(struct mm_struct *mm, struct vm_area_struct *vma)
|
static int vma_link(struct mm_struct *mm, struct vm_area_struct *vma)
|
||||||
{
|
{
|
||||||
MA_STATE(mas, &mm->mm_mt, 0, 0);
|
VMA_ITERATOR(vmi, mm, 0);
|
||||||
struct address_space *mapping = NULL;
|
struct address_space *mapping = NULL;
|
||||||
|
|
||||||
if (mas_preallocate(&mas, GFP_KERNEL))
|
if (vma_iter_prealloc(&vmi))
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
if (vma->vm_file) {
|
if (vma->vm_file) {
|
||||||
|
@ -498,7 +498,7 @@ static int vma_link(struct mm_struct *mm, struct vm_area_struct *vma)
|
||||||
i_mmap_lock_write(mapping);
|
i_mmap_lock_write(mapping);
|
||||||
}
|
}
|
||||||
|
|
||||||
vma_mas_store(vma, &mas);
|
vma_iter_store(&vmi, vma);
|
||||||
|
|
||||||
if (mapping) {
|
if (mapping) {
|
||||||
__vma_link_file(vma, mapping);
|
__vma_link_file(vma, mapping);
|
||||||
|
|
Loading…
Reference in a new issue