diff options
Diffstat (limited to 'mm/swap_state.c')
-rw-r--r-- | mm/swap_state.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/mm/swap_state.c b/mm/swap_state.c index 1416e7e9e02d..19bdf3017a9e 100644 --- a/mm/swap_state.c +++ b/mm/swap_state.c | |||
@@ -162,11 +162,11 @@ int add_to_swap(struct page *page) | |||
162 | return 1; | 162 | return 1; |
163 | case -EEXIST: | 163 | case -EEXIST: |
164 | /* Raced with "speculative" read_swap_cache_async */ | 164 | /* Raced with "speculative" read_swap_cache_async */ |
165 | swap_free(entry); | 165 | swapcache_free(entry, NULL); |
166 | continue; | 166 | continue; |
167 | default: | 167 | default: |
168 | /* -ENOMEM radix-tree allocation failure */ | 168 | /* -ENOMEM radix-tree allocation failure */ |
169 | swap_free(entry); | 169 | swapcache_free(entry, NULL); |
170 | return 0; | 170 | return 0; |
171 | } | 171 | } |
172 | } | 172 | } |
@@ -188,8 +188,7 @@ void delete_from_swap_cache(struct page *page) | |||
188 | __delete_from_swap_cache(page); | 188 | __delete_from_swap_cache(page); |
189 | spin_unlock_irq(&swapper_space.tree_lock); | 189 | spin_unlock_irq(&swapper_space.tree_lock); |
190 | 190 | ||
191 | mem_cgroup_uncharge_swapcache(page, entry); | 191 | swapcache_free(entry, page); |
192 | swap_free(entry); | ||
193 | page_cache_release(page); | 192 | page_cache_release(page); |
194 | } | 193 | } |
195 | 194 | ||
@@ -293,7 +292,7 @@ struct page *read_swap_cache_async(swp_entry_t entry, gfp_t gfp_mask, | |||
293 | /* | 292 | /* |
294 | * Swap entry may have been freed since our caller observed it. | 293 | * Swap entry may have been freed since our caller observed it. |
295 | */ | 294 | */ |
296 | if (!swap_duplicate(entry)) | 295 | if (!swapcache_prepare(entry)) |
297 | break; | 296 | break; |
298 | 297 | ||
299 | /* | 298 | /* |
@@ -317,7 +316,7 @@ struct page *read_swap_cache_async(swp_entry_t entry, gfp_t gfp_mask, | |||
317 | } | 316 | } |
318 | ClearPageSwapBacked(new_page); | 317 | ClearPageSwapBacked(new_page); |
319 | __clear_page_locked(new_page); | 318 | __clear_page_locked(new_page); |
320 | swap_free(entry); | 319 | swapcache_free(entry, NULL); |
321 | } while (err != -ENOMEM); | 320 | } while (err != -ENOMEM); |
322 | 321 | ||
323 | if (new_page) | 322 | if (new_page) |