diff options
Diffstat (limited to 'mm/swap.c')
| -rw-r--r-- | mm/swap.c | 27 |
1 files changed, 2 insertions, 25 deletions
| @@ -448,8 +448,8 @@ void pagevec_strip(struct pagevec *pvec) | |||
| 448 | for (i = 0; i < pagevec_count(pvec); i++) { | 448 | for (i = 0; i < pagevec_count(pvec); i++) { |
| 449 | struct page *page = pvec->pages[i]; | 449 | struct page *page = pvec->pages[i]; |
| 450 | 450 | ||
| 451 | if (PagePrivate(page) && trylock_page(page)) { | 451 | if (page_has_private(page) && trylock_page(page)) { |
| 452 | if (PagePrivate(page)) | 452 | if (page_has_private(page)) |
| 453 | try_to_release_page(page, 0); | 453 | try_to_release_page(page, 0); |
| 454 | unlock_page(page); | 454 | unlock_page(page); |
| 455 | } | 455 | } |
| @@ -457,29 +457,6 @@ void pagevec_strip(struct pagevec *pvec) | |||
| 457 | } | 457 | } |
| 458 | 458 | ||
| 459 | /** | 459 | /** |
| 460 | * pagevec_swap_free - try to free swap space from the pages in a pagevec | ||
| 461 | * @pvec: pagevec with swapcache pages to free the swap space of | ||
| 462 | * | ||
| 463 | * The caller needs to hold an extra reference to each page and | ||
| 464 | * not hold the page lock on the pages. This function uses a | ||
| 465 | * trylock on the page lock so it may not always free the swap | ||
| 466 | * space associated with a page. | ||
| 467 | */ | ||
| 468 | void pagevec_swap_free(struct pagevec *pvec) | ||
| 469 | { | ||
| 470 | int i; | ||
| 471 | |||
| 472 | for (i = 0; i < pagevec_count(pvec); i++) { | ||
| 473 | struct page *page = pvec->pages[i]; | ||
| 474 | |||
| 475 | if (PageSwapCache(page) && trylock_page(page)) { | ||
| 476 | try_to_free_swap(page); | ||
| 477 | unlock_page(page); | ||
| 478 | } | ||
| 479 | } | ||
| 480 | } | ||
| 481 | |||
| 482 | /** | ||
| 483 | * pagevec_lookup - gang pagecache lookup | 460 | * pagevec_lookup - gang pagecache lookup |
| 484 | * @pvec: Where the resulting pages are placed | 461 | * @pvec: Where the resulting pages are placed |
| 485 | * @mapping: The address_space to search | 462 | * @mapping: The address_space to search |
