From: OGAWA Hirofumi Date: Thu, 7 Dec 2006 04:36:46 +0000 (-0800) Subject: [PATCH] read_cache_pages() cleanup X-Git-Tag: v2.6.20-rc1~145^2^2~190 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=38da288b8ba2b07b4e07165027e650b61d7c8ffc;p=linux-2.6 [PATCH] read_cache_pages() cleanup Use put_pages_list() instead of opencoding it. Signed-off-by: OGAWA Hirofumi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/mm/readahead.c b/mm/readahead.c index 23cb61a01c..a386f2b6b3 100644 --- a/mm/readahead.c +++ b/mm/readahead.c @@ -148,13 +148,7 @@ int read_cache_pages(struct address_space *mapping, struct list_head *pages, if (!pagevec_add(&lru_pvec, page)) __pagevec_lru_add(&lru_pvec); if (ret) { - while (!list_empty(pages)) { - struct page *victim; - - victim = list_to_page(pages); - list_del(&victim->lru); - page_cache_release(victim); - } + put_pages_list(pages); break; } }