diff options
author | Chris Mason <chris.mason@oracle.com> | 2007-11-26 19:34:41 -0500 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2008-09-25 11:03:58 -0400 |
commit | 793955bca66c99defdffc857ae6eb7e8431d6bbe (patch) | |
tree | 2f8376247033fced7289038b8d82e10a6cc55f22 /fs/btrfs/disk-io.c | |
parent | 015a739c7c238768fbfa4eea8ea2ebc1a35e7bb1 (diff) |
Btrfs: Limit btree writeback to prevent seeks
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/disk-io.c')
-rw-r--r-- | fs/btrfs/disk-io.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 3e16cca72b49..28e9ef8a3253 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c | |||
@@ -210,6 +210,15 @@ static int btree_writepages(struct address_space *mapping, | |||
210 | { | 210 | { |
211 | struct extent_map_tree *tree; | 211 | struct extent_map_tree *tree; |
212 | tree = &BTRFS_I(mapping->host)->extent_tree; | 212 | tree = &BTRFS_I(mapping->host)->extent_tree; |
213 | if (wbc->sync_mode == WB_SYNC_NONE) { | ||
214 | u64 num_dirty; | ||
215 | u64 start = 0; | ||
216 | unsigned long thresh = 96 * 1024 * 1024; | ||
217 | num_dirty = count_range_bits(tree, &start, thresh, EXTENT_DIRTY); | ||
218 | if (num_dirty < thresh) { | ||
219 | return 0; | ||
220 | } | ||
221 | } | ||
213 | return extent_writepages(tree, mapping, btree_get_extent, wbc); | 222 | return extent_writepages(tree, mapping, btree_get_extent, wbc); |
214 | } | 223 | } |
215 | 224 | ||