summaryrefslogtreecommitdiff
path: root/mm/swap.c
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2006-08-31 15:45:48 +1000
committerPaul Mackerras <paulus@samba.org>2006-08-31 15:45:48 +1000
commitaa43f77939c97bf9d3580c6a5e71a5a40290e451 (patch)
tree095c0b8b3da4b6554a3f8ef4b39240a5d9216d4d /mm/swap.c
parent2818c5dec5e28d65d52afbb7695bbbafe6377ee5 (diff)
parent4c15343167b5febe7bb0ba96aad5bef42ae94d3b (diff)
downloadlinux-3.10-aa43f77939c97bf9d3580c6a5e71a5a40290e451.tar.gz
linux-3.10-aa43f77939c97bf9d3580c6a5e71a5a40290e451.tar.bz2
linux-3.10-aa43f77939c97bf9d3580c6a5e71a5a40290e451.zip
Merge branch 'merge'
Diffstat (limited to 'mm/swap.c')
-rw-r--r--mm/swap.c20
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