Skip to content

Commit

Permalink
mm: remove pagevec_swap_free()
Browse files Browse the repository at this point in the history
pagevec_swap_free() is now unused.

Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Rik van Riel <riel@redhat.com>
Acked-by: Hugh Dickins <hugh@veritas.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
KOSAKI Motohiro authored and Linus Torvalds committed Apr 1, 2009
1 parent ad1c354 commit d1d7487
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 24 deletions.
1 change: 0 additions & 1 deletion include/linux/pagevec.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ void __pagevec_release(struct pagevec *pvec);
void __pagevec_free(struct pagevec *pvec);
void ____pagevec_lru_add(struct pagevec *pvec, enum lru_list lru);
void pagevec_strip(struct pagevec *pvec);
void pagevec_swap_free(struct pagevec *pvec);
unsigned pagevec_lookup(struct pagevec *pvec, struct address_space *mapping,
pgoff_t start, unsigned nr_pages);
unsigned pagevec_lookup_tag(struct pagevec *pvec,
Expand Down
23 changes: 0 additions & 23 deletions mm/swap.c
Original file line number Diff line number Diff line change
Expand Up @@ -456,29 +456,6 @@ void pagevec_strip(struct pagevec *pvec)
}
}

/**
* pagevec_swap_free - try to free swap space from the pages in a pagevec
* @pvec: pagevec with swapcache pages to free the swap space of
*
* The caller needs to hold an extra reference to each page and
* not hold the page lock on the pages. This function uses a
* trylock on the page lock so it may not always free the swap
* space associated with a page.
*/
void pagevec_swap_free(struct pagevec *pvec)
{
int i;

for (i = 0; i < pagevec_count(pvec); i++) {
struct page *page = pvec->pages[i];

if (PageSwapCache(page) && trylock_page(page)) {
try_to_free_swap(page);
unlock_page(page);
}
}
}

/**
* pagevec_lookup - gang pagecache lookup
* @pvec: Where the resulting pages are placed
Expand Down

0 comments on commit d1d7487

Please sign in to comment.