Skip to contentSkip to conversation

Cleanup read_pages()

PATCH In review OGAWA Hirofumi 1 participant 1 message Oct 30, 2006

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/4 Cleanup read_pages()

Current read_pages() assume ->readpages() frees the passed pages.

This patch free the pages in ->read_pages(), if those were remaining in the pages_list. So, readpages() just can ignore the remaining pages in pages_list.

---

 mm/readahead.c |    2 ++
 1 file changed, 2 insertions(+)
mm/readahead.c renamed from mm/readahead.c~readpages-fixes +2 -0
diff -puN mm/readahead.c~readpages-fixes mm/readahead.c
@@ -167,6 +167,8 @@ static int read_pages(struct address_spa
 
 	if (mapping->a_ops->readpages) {
 		ret = mapping->a_ops->readpages(filp, mapping, pages, nr_pages);
+		/* Clean up the remaining pages */
+		put_pages_list(pages);
 		goto out;
 	}
 

_