diff options
-rw-r--r-- | fs/fscache/page.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/fs/fscache/page.c b/fs/fscache/page.c index 2f343b4d7a7d..3f7a59bfa7ad 100644 --- a/fs/fscache/page.c +++ b/fs/fscache/page.c | |||
@@ -976,16 +976,12 @@ void __fscache_uncache_all_inode_pages(struct fscache_cookie *cookie, | |||
976 | 976 | ||
977 | pagevec_init(&pvec, 0); | 977 | pagevec_init(&pvec, 0); |
978 | next = 0; | 978 | next = 0; |
979 | while (next <= (loff_t)-1 && | 979 | do { |
980 | pagevec_lookup(&pvec, mapping, next, PAGEVEC_SIZE) | 980 | if (!pagevec_lookup(&pvec, mapping, next, PAGEVEC_SIZE)) |
981 | ) { | 981 | break; |
982 | for (i = 0; i < pagevec_count(&pvec); i++) { | 982 | for (i = 0; i < pagevec_count(&pvec); i++) { |
983 | struct page *page = pvec.pages[i]; | 983 | struct page *page = pvec.pages[i]; |
984 | pgoff_t page_index = page->index; | 984 | next = page->index; |
985 | |||
986 | ASSERTCMP(page_index, >=, next); | ||
987 | next = page_index + 1; | ||
988 | |||
989 | if (PageFsCache(page)) { | 985 | if (PageFsCache(page)) { |
990 | __fscache_wait_on_page_write(cookie, page); | 986 | __fscache_wait_on_page_write(cookie, page); |
991 | __fscache_uncache_page(cookie, page); | 987 | __fscache_uncache_page(cookie, page); |
@@ -993,7 +989,7 @@ void __fscache_uncache_all_inode_pages(struct fscache_cookie *cookie, | |||
993 | } | 989 | } |
994 | pagevec_release(&pvec); | 990 | pagevec_release(&pvec); |
995 | cond_resched(); | 991 | cond_resched(); |
996 | } | 992 | } while (++next); |
997 | 993 | ||
998 | _leave(""); | 994 | _leave(""); |
999 | } | 995 | } |