diff options
Diffstat (limited to 'mm/page-writeback.c')
| -rw-r--r-- | mm/page-writeback.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/mm/page-writeback.c b/mm/page-writeback.c index 77a0bc4e261a..1c87430b7a25 100644 --- a/mm/page-writeback.c +++ b/mm/page-writeback.c | |||
| @@ -23,6 +23,7 @@ | |||
| 23 | #include <linux/backing-dev.h> | 23 | #include <linux/backing-dev.h> |
| 24 | #include <linux/blkdev.h> | 24 | #include <linux/blkdev.h> |
| 25 | #include <linux/mpage.h> | 25 | #include <linux/mpage.h> |
| 26 | #include <linux/rmap.h> | ||
| 26 | #include <linux/percpu.h> | 27 | #include <linux/percpu.h> |
| 27 | #include <linux/notifier.h> | 28 | #include <linux/notifier.h> |
| 28 | #include <linux/smp.h> | 29 | #include <linux/smp.h> |
| @@ -550,7 +551,7 @@ int do_writepages(struct address_space *mapping, struct writeback_control *wbc) | |||
| 550 | return 0; | 551 | return 0; |
| 551 | wbc->for_writepages = 1; | 552 | wbc->for_writepages = 1; |
| 552 | if (mapping->a_ops->writepages) | 553 | if (mapping->a_ops->writepages) |
| 553 | ret = mapping->a_ops->writepages(mapping, wbc); | 554 | ret = mapping->a_ops->writepages(mapping, wbc); |
| 554 | else | 555 | else |
| 555 | ret = generic_writepages(mapping, wbc); | 556 | ret = generic_writepages(mapping, wbc); |
| 556 | wbc->for_writepages = 0; | 557 | wbc->for_writepages = 0; |
| @@ -712,9 +713,15 @@ int test_clear_page_dirty(struct page *page) | |||
| 712 | radix_tree_tag_clear(&mapping->page_tree, | 713 | radix_tree_tag_clear(&mapping->page_tree, |
| 713 | page_index(page), | 714 | page_index(page), |
| 714 | PAGECACHE_TAG_DIRTY); | 715 | PAGECACHE_TAG_DIRTY); |
| 715 | if (mapping_cap_account_dirty(mapping)) | ||
| 716 | __dec_zone_page_state(page, NR_FILE_DIRTY); | ||
| 717 | write_unlock_irqrestore(&mapping->tree_lock, flags); | 716 | write_unlock_irqrestore(&mapping->tree_lock, flags); |
| 717 | /* | ||
| 718 | * We can continue to use `mapping' here because the | ||
| 719 | * page is locked, which pins the address_space | ||
| 720 | */ | ||
| 721 | if (mapping_cap_account_dirty(mapping)) { | ||
| 722 | page_mkclean(page); | ||
| 723 | dec_zone_page_state(page, NR_FILE_DIRTY); | ||
| 724 | } | ||
| 718 | return 1; | 725 | return 1; |
| 719 | } | 726 | } |
| 720 | write_unlock_irqrestore(&mapping->tree_lock, flags); | 727 | write_unlock_irqrestore(&mapping->tree_lock, flags); |
| @@ -744,8 +751,10 @@ int clear_page_dirty_for_io(struct page *page) | |||
| 744 | 751 | ||
| 745 | if (mapping) { | 752 | if (mapping) { |
| 746 | if (TestClearPageDirty(page)) { | 753 | if (TestClearPageDirty(page)) { |
| 747 | if (mapping_cap_account_dirty(mapping)) | 754 | if (mapping_cap_account_dirty(mapping)) { |
| 755 | page_mkclean(page); | ||
| 748 | dec_zone_page_state(page, NR_FILE_DIRTY); | 756 | dec_zone_page_state(page, NR_FILE_DIRTY); |
| 757 | } | ||
| 749 | return 1; | 758 | return 1; |
| 750 | } | 759 | } |
| 751 | return 0; | 760 | return 0; |
