diff options
Diffstat (limited to 'mm/swap_state.c')
-rw-r--r-- | mm/swap_state.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/mm/swap_state.c b/mm/swap_state.c index e793fdea275d..bcb472769299 100644 --- a/mm/swap_state.c +++ b/mm/swap_state.c | |||
@@ -195,14 +195,14 @@ void delete_from_swap_cache(struct page *page) | |||
195 | * If we are the only user, then try to free up the swap cache. | 195 | * If we are the only user, then try to free up the swap cache. |
196 | * | 196 | * |
197 | * Its ok to check for PageSwapCache without the page lock | 197 | * Its ok to check for PageSwapCache without the page lock |
198 | * here because we are going to recheck again inside | 198 | * here because we are going to recheck again inside |
199 | * exclusive_swap_page() _with_ the lock. | 199 | * try_to_free_swap() _with_ the lock. |
200 | * - Marcelo | 200 | * - Marcelo |
201 | */ | 201 | */ |
202 | static inline void free_swap_cache(struct page *page) | 202 | static inline void free_swap_cache(struct page *page) |
203 | { | 203 | { |
204 | if (PageSwapCache(page) && trylock_page(page)) { | 204 | if (PageSwapCache(page) && !page_mapped(page) && trylock_page(page)) { |
205 | remove_exclusive_swap_page(page); | 205 | try_to_free_swap(page); |
206 | unlock_page(page); | 206 | unlock_page(page); |
207 | } | 207 | } |
208 | } | 208 | } |