]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - mm/swap_state.c
mm: try_to_free_swap replaces remove_exclusive_swap_page
[net-next-2.6.git] / mm / swap_state.c
index e793fdea275d6f6fb259397c5f4729be81d8d0f1..bcb472769299476ebdcdc31d859046c1a3c6433a 100644 (file)
@@ -195,14 +195,14 @@ void delete_from_swap_cache(struct page *page)
  * If we are the only user, then try to free up the swap cache. 
  * 
  * Its ok to check for PageSwapCache without the page lock
- * here because we are going to recheck again inside 
- * exclusive_swap_page() _with_ the lock. 
+ * here because we are going to recheck again inside
+ * try_to_free_swap() _with_ the lock.
  *                                     - Marcelo
  */
 static inline void free_swap_cache(struct page *page)
 {
-       if (PageSwapCache(page) && trylock_page(page)) {
-               remove_exclusive_swap_page(page);
+       if (PageSwapCache(page) && !page_mapped(page) && trylock_page(page)) {
+               try_to_free_swap(page);
                unlock_page(page);
        }
 }