]> git.hungrycats.org Git - linux/commitdiff
[PATCH] rmap page refcounting simplification
authorAndrew Morton <akpm@osdl.org>
Mon, 19 Jan 2004 02:43:28 +0000 (18:43 -0800)
committerLinus Torvalds <torvalds@home.osdl.org>
Mon, 19 Jan 2004 02:43:28 +0000 (18:43 -0800)
From: Martin Schwidefsky <schwidefsky@de.ibm.com>

Ok, its just the revert of the page_cache_release delta.

mm/rmap.c

index 14fab5522a5a4504774068747ba3cd492d29443d..a383b7d051147803e749260699c2a8d0e5bf7a13 100644 (file)
--- a/mm/rmap.c
+++ b/mm/rmap.c
@@ -361,6 +361,7 @@ static int try_to_unmap_one(struct page * page, pte_addr_t paddr)
                set_page_dirty(page);
 
        mm->rss--;
+       page_cache_release(page);
        ret = SWAP_SUCCESS;
 
 out_unlock:
@@ -401,7 +402,6 @@ int try_to_unmap(struct page * page)
                if (ret == SWAP_SUCCESS) {
                        if (page_test_and_clear_dirty(page))
                                set_page_dirty(page);
-                       page_cache_release(page);
                        page->pte.direct = 0;
                        ClearPageDirect(page);
                }
@@ -441,7 +441,6 @@ int try_to_unmap(struct page * page)
                                if (page->pte.direct == 0 &&
                                    page_test_and_clear_dirty(page))
                                        set_page_dirty(page);
-                               page_cache_release(page);
                                break;
                        case SWAP_AGAIN:
                                /* Skip this pte, remembering status. */