diff options
Diffstat (limited to 'mm/truncate.c')
-rw-r--r-- | mm/truncate.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/mm/truncate.c b/mm/truncate.c index e83e4b114ef1..1229211104f8 100644 --- a/mm/truncate.c +++ b/mm/truncate.c | |||
@@ -18,6 +18,7 @@ | |||
18 | #include <linux/task_io_accounting_ops.h> | 18 | #include <linux/task_io_accounting_ops.h> |
19 | #include <linux/buffer_head.h> /* grr. try_to_release_page, | 19 | #include <linux/buffer_head.h> /* grr. try_to_release_page, |
20 | do_invalidatepage */ | 20 | do_invalidatepage */ |
21 | #include "internal.h" | ||
21 | 22 | ||
22 | 23 | ||
23 | /** | 24 | /** |
@@ -103,6 +104,7 @@ truncate_complete_page(struct address_space *mapping, struct page *page) | |||
103 | 104 | ||
104 | cancel_dirty_page(page, PAGE_CACHE_SIZE); | 105 | cancel_dirty_page(page, PAGE_CACHE_SIZE); |
105 | 106 | ||
107 | clear_page_mlock(page); | ||
106 | remove_from_page_cache(page); | 108 | remove_from_page_cache(page); |
107 | ClearPageMappedToDisk(page); | 109 | ClearPageMappedToDisk(page); |
108 | page_cache_release(page); /* pagecache ref */ | 110 | page_cache_release(page); /* pagecache ref */ |
@@ -127,6 +129,7 @@ invalidate_complete_page(struct address_space *mapping, struct page *page) | |||
127 | if (PagePrivate(page) && !try_to_release_page(page, 0)) | 129 | if (PagePrivate(page) && !try_to_release_page(page, 0)) |
128 | return 0; | 130 | return 0; |
129 | 131 | ||
132 | clear_page_mlock(page); | ||
130 | ret = remove_mapping(mapping, page); | 133 | ret = remove_mapping(mapping, page); |
131 | 134 | ||
132 | return ret; | 135 | return ret; |
@@ -352,6 +355,7 @@ invalidate_complete_page2(struct address_space *mapping, struct page *page) | |||
352 | if (PageDirty(page)) | 355 | if (PageDirty(page)) |
353 | goto failed; | 356 | goto failed; |
354 | 357 | ||
358 | clear_page_mlock(page); | ||
355 | BUG_ON(PagePrivate(page)); | 359 | BUG_ON(PagePrivate(page)); |
356 | __remove_from_page_cache(page); | 360 | __remove_from_page_cache(page); |
357 | spin_unlock_irq(&mapping->tree_lock); | 361 | spin_unlock_irq(&mapping->tree_lock); |