lkml.org 
[lkml]   [2022]   [Mar]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 06/16] mm/migration: use helper function vma_lookup() in add_page_for_migration
Date
We could use helper function vma_lookup() to lookup the needed vma to
simplify the code.

Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
---
mm/migrate.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/mm/migrate.c b/mm/migrate.c
index 15cac2dabc93..bc79d7338780 100644
--- a/mm/migrate.c
+++ b/mm/migrate.c
@@ -1613,8 +1613,8 @@ static int add_page_for_migration(struct mm_struct *mm, unsigned long addr,

mmap_read_lock(mm);
err = -EFAULT;
- vma = find_vma(mm, addr);
- if (!vma || addr < vma->vm_start || !vma_migratable(vma))
+ vma = vma_lookup(mm, addr);
+ if (!vma || !vma_migratable(vma))
goto out;

/* FOLL_DUMP to ignore special (like zero) pages */
--
2.23.0
\
 
 \ /
  Last update: 2022-03-04 10:36    [W:0.398 / U:0.148 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site