rmap: simplify try_to_unmap_file()
Just simplify the code when `mlocked' is true.
Signed-off-by: Huang Shijie <shijie8@gmail.com>
Reviewed-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
diff --git a/mm/rmap.c b/mm/rmap.c
index 265d5299..e032d96 100644
--- a/mm/rmap.c
+++ b/mm/rmap.c
@@ -1103,13 +1103,10 @@
if (ret == SWAP_MLOCK) {
mlocked = try_to_mlock_page(page, vma);
if (mlocked)
- break; /* stop if actually mlocked page */
+ goto out; /* stop if actually mlocked page */
}
}
- if (mlocked)
- goto out;
-
if (list_empty(&mapping->i_mmap_nonlinear))
goto out;