diff options
Diffstat (limited to 'mm/truncate.c')
-rw-r--r-- | mm/truncate.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/mm/truncate.c b/mm/truncate.c index c3123b08ff6d..c35c49e54fb6 100644 --- a/mm/truncate.c +++ b/mm/truncate.c | |||
@@ -48,7 +48,7 @@ void do_invalidatepage(struct page *page, unsigned long offset) | |||
48 | 48 | ||
49 | static inline void truncate_partial_page(struct page *page, unsigned partial) | 49 | static inline void truncate_partial_page(struct page *page, unsigned partial) |
50 | { | 50 | { |
51 | zero_user_page(page, partial, PAGE_CACHE_SIZE - partial, KM_USER0); | 51 | zero_user_segment(page, partial, PAGE_CACHE_SIZE); |
52 | if (PagePrivate(page)) | 52 | if (PagePrivate(page)) |
53 | do_invalidatepage(page, partial); | 53 | do_invalidatepage(page, partial); |
54 | } | 54 | } |
@@ -84,7 +84,7 @@ EXPORT_SYMBOL(cancel_dirty_page); | |||
84 | 84 | ||
85 | /* | 85 | /* |
86 | * If truncate cannot remove the fs-private metadata from the page, the page | 86 | * If truncate cannot remove the fs-private metadata from the page, the page |
87 | * becomes anonymous. It will be left on the LRU and may even be mapped into | 87 | * becomes orphaned. It will be left on the LRU and may even be mapped into |
88 | * user pagetables if we're racing with filemap_fault(). | 88 | * user pagetables if we're racing with filemap_fault(). |
89 | * | 89 | * |
90 | * We need to bale out if page->mapping is no longer equal to the original | 90 | * We need to bale out if page->mapping is no longer equal to the original |
@@ -98,11 +98,11 @@ truncate_complete_page(struct address_space *mapping, struct page *page) | |||
98 | if (page->mapping != mapping) | 98 | if (page->mapping != mapping) |
99 | return; | 99 | return; |
100 | 100 | ||
101 | cancel_dirty_page(page, PAGE_CACHE_SIZE); | ||
102 | |||
103 | if (PagePrivate(page)) | 101 | if (PagePrivate(page)) |
104 | do_invalidatepage(page, 0); | 102 | do_invalidatepage(page, 0); |
105 | 103 | ||
104 | cancel_dirty_page(page, PAGE_CACHE_SIZE); | ||
105 | |||
106 | remove_from_page_cache(page); | 106 | remove_from_page_cache(page); |
107 | ClearPageUptodate(page); | 107 | ClearPageUptodate(page); |
108 | ClearPageMappedToDisk(page); | 108 | ClearPageMappedToDisk(page); |