From: OGAWA Hirofumi Date: Thu, 7 Dec 2006 04:36:46 +0000 (-0800) Subject: [PATCH] read_cache_pages() cleanup X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=38da288b8ba2b07b4e07165027e650b61d7c8ffc;p=openwrt%2Fstaging%2Fblogic.git [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 23cb61a01c6e..a386f2b6b335 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; } }