aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
Diffstat (limited to 'fs')
-rw-r--r--fs/btrfs/disk-io.c4
-rw-r--r--fs/btrfs/file.c3
2 files changed, 6 insertions, 1 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 8a74f9027d65..de0552532d23 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -214,6 +214,10 @@ static int btree_writepages(struct address_space *mapping,
214 u64 num_dirty; 214 u64 num_dirty;
215 u64 start = 0; 215 u64 start = 0;
216 unsigned long thresh = 96 * 1024 * 1024; 216 unsigned long thresh = 96 * 1024 * 1024;
217
218 if (wbc->for_kupdate)
219 return 0;
220
217 num_dirty = count_range_bits(tree, &start, thresh, EXTENT_DIRTY); 221 num_dirty = count_range_bits(tree, &start, thresh, EXTENT_DIRTY);
218 if (num_dirty < thresh) { 222 if (num_dirty < thresh) {
219 return 0; 223 return 0;
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c
index 9dd2c5c23b56..ba624ae16e61 100644
--- a/fs/btrfs/file.c
+++ b/fs/btrfs/file.c
@@ -767,7 +767,8 @@ static ssize_t btrfs_file_write(struct file *file, const char __user *buf,
767 num_written += write_bytes; 767 num_written += write_bytes;
768 768
769 balance_dirty_pages_ratelimited_nr(inode->i_mapping, num_pages); 769 balance_dirty_pages_ratelimited_nr(inode->i_mapping, num_pages);
770 btrfs_btree_balance_dirty(root, 1); 770 if (num_pages < (root->leafsize >> PAGE_CACHE_SHIFT) + 1)
771 btrfs_btree_balance_dirty(root, 1);
771 cond_resched(); 772 cond_resched();
772 } 773 }
773 mutex_unlock(&inode->i_mutex); 774 mutex_unlock(&inode->i_mutex);