diff options
-rw-r--r-- | fs/xfs/linux-2.6/xfs_aops.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/fs/xfs/linux-2.6/xfs_aops.c b/fs/xfs/linux-2.6/xfs_aops.c index 9ea33ea6a225..52707b5ddcb8 100644 --- a/fs/xfs/linux-2.6/xfs_aops.c +++ b/fs/xfs/linux-2.6/xfs_aops.c | |||
@@ -722,8 +722,17 @@ xfs_convert_page( | |||
722 | SetPageUptodate(page); | 722 | SetPageUptodate(page); |
723 | 723 | ||
724 | if (startio) { | 724 | if (startio) { |
725 | if (count) | 725 | if (count) { |
726 | wbc->nr_to_write--; | 726 | struct backing_dev_info *bdi; |
727 | |||
728 | bdi = inode->i_mapping->backing_dev_info; | ||
729 | if (bdi_write_congested(bdi)) { | ||
730 | wbc->encountered_congestion = 1; | ||
731 | done = 1; | ||
732 | } else if (--wbc->nr_to_write <= 0) { | ||
733 | done = 1; | ||
734 | } | ||
735 | } | ||
727 | xfs_start_page_writeback(page, wbc, !page_dirty, count); | 736 | xfs_start_page_writeback(page, wbc, !page_dirty, count); |
728 | } | 737 | } |
729 | 738 | ||
@@ -812,7 +821,7 @@ xfs_page_state_convert( | |||
812 | int all_bh = unmapped; | 821 | int all_bh = unmapped; |
813 | 822 | ||
814 | /* wait for other IO threads? */ | 823 | /* wait for other IO threads? */ |
815 | if (startio && wbc->sync_mode != WB_SYNC_NONE) | 824 | if (startio && (wbc->sync_mode == WB_SYNC_NONE && wbc->nonblocking)) |
816 | trylock_flag |= BMAPI_TRYLOCK; | 825 | trylock_flag |= BMAPI_TRYLOCK; |
817 | 826 | ||
818 | /* Is this page beyond the end of the file? */ | 827 | /* Is this page beyond the end of the file? */ |