aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/disk-io.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/btrfs/disk-io.c')
-rw-r--r--fs/btrfs/disk-io.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 7f5c6e3e9992..e572cf478a5d 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -2378,17 +2378,14 @@ void btrfs_btree_balance_dirty(struct btrfs_root *root, unsigned long nr)
2378 * looks as though older kernels can get into trouble with 2378 * looks as though older kernels can get into trouble with
2379 * this code, they end up stuck in balance_dirty_pages forever 2379 * this code, they end up stuck in balance_dirty_pages forever
2380 */ 2380 */
2381 struct extent_io_tree *tree;
2382 u64 num_dirty; 2381 u64 num_dirty;
2383 u64 start = 0;
2384 unsigned long thresh = 32 * 1024 * 1024; 2382 unsigned long thresh = 32 * 1024 * 1024;
2385 tree = &BTRFS_I(root->fs_info->btree_inode)->io_tree;
2386 2383
2387 if (current->flags & PF_MEMALLOC) 2384 if (current->flags & PF_MEMALLOC)
2388 return; 2385 return;
2389 2386
2390 num_dirty = count_range_bits(tree, &start, (u64)-1, 2387 num_dirty = root->fs_info->dirty_metadata_bytes;
2391 thresh, EXTENT_DIRTY); 2388
2392 if (num_dirty > thresh) { 2389 if (num_dirty > thresh) {
2393 balance_dirty_pages_ratelimited_nr( 2390 balance_dirty_pages_ratelimited_nr(
2394 root->fs_info->btree_inode->i_mapping, 1); 2391 root->fs_info->btree_inode->i_mapping, 1);