diff options
author | Ralf Baechle <ralf@linux-mips.org> | 1999-10-09 00:00:47 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 1999-10-09 00:00:47 +0000 |
commit | d6434e1042f3b0a6dfe1b1f615af369486f9b1fa (patch) | |
tree | e2be02f33984c48ec019c654051d27964e42c441 /mm/swap_state.c | |
parent | 609d1e803baf519487233b765eb487f9ec227a18 (diff) |
Merge with 2.3.19.
Diffstat (limited to 'mm/swap_state.c')
-rw-r--r-- | mm/swap_state.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/mm/swap_state.c b/mm/swap_state.c index 2aa17d3a4..5cfc686dd 100644 --- a/mm/swap_state.c +++ b/mm/swap_state.c @@ -214,8 +214,6 @@ static inline void remove_from_swap_cache(struct page *page) page_address(page), page_count(page)); #endif PageClearSwapCache(page); - if (inode->i_op->flushpage) - inode->i_op->flushpage(inode, page, 0); remove_inode_page(page); } @@ -239,6 +237,15 @@ void __delete_from_swap_cache(struct page *page) swap_free (entry); } +static void delete_from_swap_cache_nolock(struct page *page) +{ + if (!swapper_inode.i_op->flushpage || + swapper_inode.i_op->flushpage(&swapper_inode, page, 0)) + lru_cache_del(page); + + __delete_from_swap_cache(page); +} + /* * This must be called only on pages that have * been verified to be in the swap cache. @@ -247,7 +254,7 @@ void delete_from_swap_cache(struct page *page) { lock_page(page); - __delete_from_swap_cache(page); + delete_from_swap_cache_nolock(page); UnlockPage(page); page_cache_release(page); @@ -267,13 +274,13 @@ void free_page_and_swap_cache(unsigned long addr) */ lock_page(page); if (PageSwapCache(page) && !is_page_shared(page)) { - long entry = page->offset; - remove_from_swap_cache(page); - swap_free(entry); + delete_from_swap_cache_nolock(page); page_cache_release(page); } UnlockPage(page); + clear_bit(PG_swap_entry, &page->flags); + __free_page(page); } |