|
19 | 19 | #include <linux/task_io_accounting_ops.h> |
20 | 20 | #include <linux/buffer_head.h> /* grr. try_to_release_page, |
21 | 21 | do_invalidatepage */ |
| 22 | +#include <linux/cleancache.h> |
22 | 23 | #include "internal.h" |
23 | 24 |
|
24 | 25 |
|
@@ -51,6 +52,7 @@ void do_invalidatepage(struct page *page, unsigned long offset) |
51 | 52 | static inline void truncate_partial_page(struct page *page, unsigned partial) |
52 | 53 | { |
53 | 54 | zero_user_segment(page, partial, PAGE_CACHE_SIZE); |
| 55 | + cleancache_flush_page(page->mapping, page); |
54 | 56 | if (page_has_private(page)) |
55 | 57 | do_invalidatepage(page, partial); |
56 | 58 | } |
@@ -214,6 +216,7 @@ void truncate_inode_pages_range(struct address_space *mapping, |
214 | 216 | pgoff_t next; |
215 | 217 | int i; |
216 | 218 |
|
| 219 | + cleancache_flush_inode(mapping); |
217 | 220 | if (mapping->nrpages == 0) |
218 | 221 | return; |
219 | 222 |
|
@@ -291,6 +294,7 @@ void truncate_inode_pages_range(struct address_space *mapping, |
291 | 294 | pagevec_release(&pvec); |
292 | 295 | mem_cgroup_uncharge_end(); |
293 | 296 | } |
| 297 | + cleancache_flush_inode(mapping); |
294 | 298 | } |
295 | 299 | EXPORT_SYMBOL(truncate_inode_pages_range); |
296 | 300 |
|
@@ -440,6 +444,7 @@ int invalidate_inode_pages2_range(struct address_space *mapping, |
440 | 444 | int did_range_unmap = 0; |
441 | 445 | int wrapped = 0; |
442 | 446 |
|
| 447 | + cleancache_flush_inode(mapping); |
443 | 448 | pagevec_init(&pvec, 0); |
444 | 449 | next = start; |
445 | 450 | while (next <= end && !wrapped && |
@@ -498,6 +503,7 @@ int invalidate_inode_pages2_range(struct address_space *mapping, |
498 | 503 | mem_cgroup_uncharge_end(); |
499 | 504 | cond_resched(); |
500 | 505 | } |
| 506 | + cleancache_flush_inode(mapping); |
501 | 507 | return ret; |
502 | 508 | } |
503 | 509 | EXPORT_SYMBOL_GPL(invalidate_inode_pages2_range); |
|
0 commit comments