X-Git-Url: http://pilppa.org/gitweb/?a=blobdiff_plain;f=mm%2Fswap.c;h=687686a61f7cb81cc75cd65a636ade65eb00d08d;hb=8ce7a9c159c8c4eb480f0a65c6af753dbf9a1a70;hp=8fd095c4ae51b00b314e732ac9ea5547a5cd26b2;hpb=ca78f6baca863afe2e6a244a0fe94b3a70211d46;p=linux-2.6-omap-h63xx.git diff --git a/mm/swap.c b/mm/swap.c index 8fd095c4ae5..687686a61f7 100644 --- a/mm/swap.c +++ b/mm/swap.c @@ -54,6 +54,26 @@ void put_page(struct page *page) } EXPORT_SYMBOL(put_page); +/** + * put_pages_list(): release a list of pages + * + * Release a list of pages which are strung together on page.lru. Currently + * used by read_cache_pages() and related error recovery code. + * + * @pages: list of pages threaded on page->lru + */ +void put_pages_list(struct list_head *pages) +{ + while (!list_empty(pages)) { + struct page *victim; + + victim = list_entry(pages->prev, struct page, lru); + list_del(&victim->lru); + page_cache_release(victim); + } +} +EXPORT_SYMBOL(put_pages_list); + /* * Writeback is about to end against a page which has been marked for immediate * reclaim. If it still appears to be reclaimable, move it to the tail of the