Skip to content

Commit

Permalink
[PATCH] Cleanup read_pages()
Browse files Browse the repository at this point in the history
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.

Signed-off-by: OGAWA Hirofumi <[email protected]>
Cc: Steven French <[email protected]>
Cc: Miklos Szeredi <[email protected]>
Cc: Steven Whitehouse <[email protected]>
Cc: Trond Myklebust <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
OGAWAHirofumi authored and Linus Torvalds committed Nov 3, 2006
1 parent 5d861d9 commit 029e332
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions mm/readahead.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,8 @@ static int read_pages(struct address_space *mapping, struct file *filp,

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;
}

Expand Down

0 comments on commit 029e332

Please sign in to comment.