summaryrefslogtreecommitdiff
path: root/fs/btrfs/disk-io.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2007-11-27 11:16:35 -0500
committerChris Mason <chris.mason@oracle.com>2008-09-25 11:03:58 -0400
commitca6646264b7dab662d84435441164bb2a8e8885a (patch)
tree166c8be6d3b941fac96bceaea1db8d4616d7442c /fs/btrfs/disk-io.c
parent448d640b668dae3928591e83f2bf4ca9f4c06e52 (diff)
downloadlwn-ca6646264b7dab662d84435441164bb2a8e8885a.tar.gz
lwn-ca6646264b7dab662d84435441164bb2a8e8885a.zip
Btrfs: Add efficient dirty accounting to the extent_map tree
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/disk-io.c')
-rw-r--r--fs/btrfs/disk-io.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index de0552532d23..eef4ab56b9ca 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -210,7 +210,7 @@ static int btree_writepages(struct address_space *mapping,
{
struct extent_map_tree *tree;
tree = &BTRFS_I(mapping->host)->extent_tree;
- if (wbc->sync_mode == WB_SYNC_NONE && current_is_pdflush()) {
+ if (wbc->sync_mode == WB_SYNC_NONE) {
u64 num_dirty;
u64 start = 0;
unsigned long thresh = 96 * 1024 * 1024;
@@ -218,6 +218,11 @@ static int btree_writepages(struct address_space *mapping,
if (wbc->for_kupdate)
return 0;
+ if (current_is_pdflush()) {
+ thresh = 96 * 1024 * 1024;
+ } else {
+ thresh = 8 * 1024 * 1024;
+ }
num_dirty = count_range_bits(tree, &start, thresh, EXTENT_DIRTY);
if (num_dirty < thresh) {
return 0;