diff options
Diffstat (limited to 'mm/swap_state.c')
-rw-r--r-- | mm/swap_state.c | 35 |
1 files changed, 1 insertions, 34 deletions
diff --git a/mm/swap_state.c b/mm/swap_state.c index c75eda2c9cc5..65b81c92738f 100644 --- a/mm/swap_state.c +++ b/mm/swap_state.c | |||
@@ -67,8 +67,7 @@ void show_swap_cache_info(void) | |||
67 | * add_to_swap_cache resembles add_to_page_cache on swapper_space, | 67 | * add_to_swap_cache resembles add_to_page_cache on swapper_space, |
68 | * but sets SwapCache flag and private instead of mapping and index. | 68 | * but sets SwapCache flag and private instead of mapping and index. |
69 | */ | 69 | */ |
70 | static int add_to_swap_cache(struct page *page, swp_entry_t entry, | 70 | int add_to_swap_cache(struct page *page, swp_entry_t entry, gfp_t gfp_mask) |
71 | gfp_t gfp_mask) | ||
72 | { | 71 | { |
73 | int error; | 72 | int error; |
74 | 73 | ||
@@ -183,38 +182,6 @@ void delete_from_swap_cache(struct page *page) | |||
183 | page_cache_release(page); | 182 | page_cache_release(page); |
184 | } | 183 | } |
185 | 184 | ||
186 | /* | ||
187 | * Strange swizzling function only for use by shmem_writepage | ||
188 | */ | ||
189 | int move_to_swap_cache(struct page *page, swp_entry_t entry) | ||
190 | { | ||
191 | int err = add_to_swap_cache(page, entry, GFP_ATOMIC); | ||
192 | if (!err) { | ||
193 | remove_from_page_cache(page); | ||
194 | page_cache_release(page); /* pagecache ref */ | ||
195 | if (!swap_duplicate(entry)) | ||
196 | BUG(); | ||
197 | SetPageDirty(page); | ||
198 | } | ||
199 | return err; | ||
200 | } | ||
201 | |||
202 | /* | ||
203 | * Strange swizzling function for shmem_getpage (and shmem_unuse) | ||
204 | */ | ||
205 | int move_from_swap_cache(struct page *page, unsigned long index, | ||
206 | struct address_space *mapping) | ||
207 | { | ||
208 | int err = add_to_page_cache(page, mapping, index, GFP_ATOMIC); | ||
209 | if (!err) { | ||
210 | delete_from_swap_cache(page); | ||
211 | /* shift page from clean_pages to dirty_pages list */ | ||
212 | ClearPageDirty(page); | ||
213 | set_page_dirty(page); | ||
214 | } | ||
215 | return err; | ||
216 | } | ||
217 | |||
218 | /* | 185 | /* |
219 | * If we are the only user, then try to free up the swap cache. | 186 | * If we are the only user, then try to free up the swap cache. |
220 | * | 187 | * |