Signed-off-by: Chris Mason <chris.mason@oracle.com>
u64 num_dirty;
u64 start = 0;
unsigned long thresh = 96 * 1024 * 1024;
+
+ if (wbc->for_kupdate)
+ return 0;
+
num_dirty = count_range_bits(tree, &start, thresh, EXTENT_DIRTY);
if (num_dirty < thresh) {
return 0;
num_written += write_bytes;
balance_dirty_pages_ratelimited_nr(inode->i_mapping, num_pages);
- btrfs_btree_balance_dirty(root, 1);
+ if (num_pages < (root->leafsize >> PAGE_CACHE_SHIFT) + 1)
+ btrfs_btree_balance_dirty(root, 1);
cond_resched();
}
mutex_unlock(&inode->i_mutex);