From dac322ff6f5e4de4080869cba69943da8ccdf1af Mon Sep 17 00:00:00 2001 From: Steven Whitehouse Date: Mon, 10 Jul 2006 15:47:01 -0400 Subject: [PATCH] --- yaml --- r: 38743 b: refs/heads/master c: ffeb874b2b893aea7d10b0b088e06a7b1ded2a3e h: refs/heads/master i: 38741: 2bd8bf5a376e94c251a859062d0c63df6d8e5a6b 38739: 00e94493d06de69c8701608502a60606b54f3f4d 38735: 2821f0b69e52defe4ff63c2064c99bfc51d4992f v: v3 --- [refs] | 2 +- trunk/fs/gfs2/ops_address.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/[refs] b/[refs] index 5912e1fdd030..0ae7971a634f 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: dc3e130a08996e2b56381365a5ac7bb1ce2a9f47 +refs/heads/master: ffeb874b2b893aea7d10b0b088e06a7b1ded2a3e diff --git a/trunk/fs/gfs2/ops_address.c b/trunk/fs/gfs2/ops_address.c index 27ce30148e69..2c4ec5cf21ff 100644 --- a/trunk/fs/gfs2/ops_address.c +++ b/trunk/fs/gfs2/ops_address.c @@ -249,8 +249,6 @@ static int gfs2_readpage(struct file *file, struct page *page) goto out; } -#define list_to_page(head) (list_entry((head)->prev, struct page, lru)) - /** * gfs2_readpages - Read a bunch of pages at once * @@ -290,7 +288,8 @@ static int gfs2_readpages(struct file *file, struct address_space *mapping, struct pagevec lru_pvec; pagevec_init(&lru_pvec, 0); for (page_idx = 0; page_idx < nr_pages; page_idx++) { - struct page *page = list_to_page(pages); + struct page *page = list_entry(pages->prev, struct page, lru); + prefetchw(&page->flags); list_del(&page->lru); if (!add_to_page_cache(page, mapping, page->index, GFP_KERNEL)) { @@ -298,8 +297,9 @@ static int gfs2_readpages(struct file *file, struct address_space *mapping, unlock_page(page); if (!pagevec_add(&lru_pvec, page)) __pagevec_lru_add(&lru_pvec); + } else { + page_cache_release(page); } - page_cache_release(page); } pagevec_lru_add(&lru_pvec); ret = 0; @@ -321,7 +321,7 @@ static int gfs2_readpages(struct file *file, struct address_space *mapping, out_unlock: /* unlock all pages, we can't do any I/O right now */ for (page_idx = 0; page_idx < nr_pages; page_idx++) { - struct page *page = list_to_page(pages); + struct page *page = list_entry(pages->prev, struct page, lru); list_del(&page->lru); unlock_page(page); page_cache_release(page);