diff options
Diffstat (limited to 'fs/buffer.c')
-rw-r--r-- | fs/buffer.c | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/fs/buffer.c b/fs/buffer.c index 517860f2d75b..865570fe0d39 100644 --- a/fs/buffer.c +++ b/fs/buffer.c | |||
@@ -724,20 +724,19 @@ int __set_page_dirty_buffers(struct page *page) | |||
724 | } | 724 | } |
725 | spin_unlock(&mapping->private_lock); | 725 | spin_unlock(&mapping->private_lock); |
726 | 726 | ||
727 | if (!TestSetPageDirty(page)) { | 727 | if (TestSetPageDirty(page)) |
728 | write_lock_irq(&mapping->tree_lock); | 728 | return 0; |
729 | if (page->mapping) { /* Race with truncate? */ | 729 | |
730 | if (mapping_cap_account_dirty(mapping)) | 730 | write_lock_irq(&mapping->tree_lock); |
731 | __inc_zone_page_state(page, NR_FILE_DIRTY); | 731 | if (page->mapping) { /* Race with truncate? */ |
732 | radix_tree_tag_set(&mapping->page_tree, | 732 | if (mapping_cap_account_dirty(mapping)) |
733 | page_index(page), | 733 | __inc_zone_page_state(page, NR_FILE_DIRTY); |
734 | PAGECACHE_TAG_DIRTY); | 734 | radix_tree_tag_set(&mapping->page_tree, |
735 | } | 735 | page_index(page), PAGECACHE_TAG_DIRTY); |
736 | write_unlock_irq(&mapping->tree_lock); | ||
737 | __mark_inode_dirty(mapping->host, I_DIRTY_PAGES); | ||
738 | return 1; | ||
739 | } | 736 | } |
740 | return 0; | 737 | write_unlock_irq(&mapping->tree_lock); |
738 | __mark_inode_dirty(mapping->host, I_DIRTY_PAGES); | ||
739 | return 1; | ||
741 | } | 740 | } |
742 | EXPORT_SYMBOL(__set_page_dirty_buffers); | 741 | EXPORT_SYMBOL(__set_page_dirty_buffers); |
743 | 742 | ||