Btrfs: Add efficient dirty accounting to the extent_map tree

Signed-off-by: Chris Mason <chris.mason@oracle.com>
This commit is contained in:
Chris Mason
2007-11-27 11:16:35 -05:00
parent 448d640b66
commit ca6646264b
3 changed files with 36 additions and 4 deletions

View File

@@ -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;