diff options
author | Jeff Garzik <jeff@garzik.org> | 2006-08-19 17:25:47 -0400 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2006-08-19 17:25:47 -0400 |
commit | 49666145de54b5d6d256442bb1bec03ffae1ac76 (patch) | |
tree | b79bcaabffa18847cab31efdf798dc5740e8d73b /mm | |
parent | bcd68373877e74d8ca5039c10dc5d699ba5dc7d0 (diff) | |
parent | 41ace1861a93f12f70ff10026fb1539fea38fcf8 (diff) |
Merge branch 'upstream-fixes' into upstream
Diffstat (limited to 'mm')
-rw-r--r-- | mm/swap.c | 20 |
1 files changed, 20 insertions, 0 deletions
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 |