rmap: simplify try_to_unmap_file()
authorHuang Shijie <[email protected]>
Tue, 15 Dec 2009 01:58:51 +0000 (17:58 -0800)
committerLinus Torvalds <[email protected]>
Tue, 15 Dec 2009 16:53:16 +0000 (08:53 -0800)
Just simplify the code when `mlocked' is true.

Signed-off-by: Huang Shijie <[email protected]>
Reviewed-by: KOSAKI Motohiro <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
mm/rmap.c

index 265d529905a7acc84d90becd88b2f9348ab0133b..e032d96fd64e7056def2c761f94db1ff16b2ab06 100644 (file)
--- a/mm/rmap.c
+++ b/mm/rmap.c
@@ -1103,13 +1103,10 @@ static int try_to_unmap_file(struct page *page, enum ttu_flags flags)
                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;