diff options
Diffstat (limited to 'fs/ext4/inode.c')
-rw-r--r-- | fs/ext4/inode.c | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 2633150e41b9..8d2b582fb141 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c | |||
@@ -1719,7 +1719,7 @@ static void mpage_release_unused_pages(struct mpage_da_data *mpd, | |||
1719 | ext4_es_remove_extent(inode, start, last - start + 1); | 1719 | ext4_es_remove_extent(inode, start, last - start + 1); |
1720 | } | 1720 | } |
1721 | 1721 | ||
1722 | pagevec_init(&pvec, 0); | 1722 | pagevec_init(&pvec); |
1723 | while (index <= end) { | 1723 | while (index <= end) { |
1724 | nr_pages = pagevec_lookup_range(&pvec, mapping, &index, end); | 1724 | nr_pages = pagevec_lookup_range(&pvec, mapping, &index, end); |
1725 | if (nr_pages == 0) | 1725 | if (nr_pages == 0) |
@@ -2345,7 +2345,7 @@ static int mpage_map_and_submit_buffers(struct mpage_da_data *mpd) | |||
2345 | lblk = start << bpp_bits; | 2345 | lblk = start << bpp_bits; |
2346 | pblock = mpd->map.m_pblk; | 2346 | pblock = mpd->map.m_pblk; |
2347 | 2347 | ||
2348 | pagevec_init(&pvec, 0); | 2348 | pagevec_init(&pvec); |
2349 | while (start <= end) { | 2349 | while (start <= end) { |
2350 | nr_pages = pagevec_lookup_range(&pvec, inode->i_mapping, | 2350 | nr_pages = pagevec_lookup_range(&pvec, inode->i_mapping, |
2351 | &start, end); | 2351 | &start, end); |
@@ -2616,12 +2616,12 @@ static int mpage_prepare_extent_to_map(struct mpage_da_data *mpd) | |||
2616 | else | 2616 | else |
2617 | tag = PAGECACHE_TAG_DIRTY; | 2617 | tag = PAGECACHE_TAG_DIRTY; |
2618 | 2618 | ||
2619 | pagevec_init(&pvec, 0); | 2619 | pagevec_init(&pvec); |
2620 | mpd->map.m_len = 0; | 2620 | mpd->map.m_len = 0; |
2621 | mpd->next_page = index; | 2621 | mpd->next_page = index; |
2622 | while (index <= end) { | 2622 | while (index <= end) { |
2623 | nr_pages = pagevec_lookup_tag(&pvec, mapping, &index, tag, | 2623 | nr_pages = pagevec_lookup_range_tag(&pvec, mapping, &index, end, |
2624 | min(end - index, (pgoff_t)PAGEVEC_SIZE-1) + 1); | 2624 | tag); |
2625 | if (nr_pages == 0) | 2625 | if (nr_pages == 0) |
2626 | goto out; | 2626 | goto out; |
2627 | 2627 | ||
@@ -2629,16 +2629,6 @@ static int mpage_prepare_extent_to_map(struct mpage_da_data *mpd) | |||
2629 | struct page *page = pvec.pages[i]; | 2629 | struct page *page = pvec.pages[i]; |
2630 | 2630 | ||
2631 | /* | 2631 | /* |
2632 | * At this point, the page may be truncated or | ||
2633 | * invalidated (changing page->mapping to NULL), or | ||
2634 | * even swizzled back from swapper_space to tmpfs file | ||
2635 | * mapping. However, page->index will not change | ||
2636 | * because we have a reference on the page. | ||
2637 | */ | ||
2638 | if (page->index > end) | ||
2639 | goto out; | ||
2640 | |||
2641 | /* | ||
2642 | * Accumulated enough dirty pages? This doesn't apply | 2632 | * Accumulated enough dirty pages? This doesn't apply |
2643 | * to WB_SYNC_ALL mode. For integrity sync we have to | 2633 | * to WB_SYNC_ALL mode. For integrity sync we have to |
2644 | * keep going because someone may be concurrently | 2634 | * keep going because someone may be concurrently |