aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/inode-map.c
diff options
context:
space:
mode:
authorChris Mason <clm@fb.com>2015-04-06 15:46:08 -0400
committerChris Mason <clm@fb.com>2015-04-10 17:07:22 -0400
commit1bbc621ef28462456131c035eaeb5567a1a2a2fe (patch)
treed2c9e87e9cef8884a440bc9b6a5bf6574eff9fc7 /fs/btrfs/inode-map.c
parent2b108268006e06d57ec9810f4ccf5d99d7e5b598 (diff)
Btrfs: allow block group cache writeout outside critical section in commit
We loop through all of the dirty block groups during commit and write the free space cache. In order to make sure the cache is currect, we do this while no other writers are allowed in the commit. If a large number of block groups are dirty, this can introduce long stalls during the final stages of the commit, which can block new procs trying to change the filesystem. This commit changes the block group cache writeout to take appropriate locks and allow it to run earlier in the commit. We'll still have to redo some of the block groups, but it means we can get most of the work out of the way without blocking the entire FS. Signed-off-by: Chris Mason <clm@fb.com>
Diffstat (limited to 'fs/btrfs/inode-map.c')
-rw-r--r--fs/btrfs/inode-map.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/btrfs/inode-map.c b/fs/btrfs/inode-map.c
index 74faea3a516e..f6a596d5a637 100644
--- a/fs/btrfs/inode-map.c
+++ b/fs/btrfs/inode-map.c
@@ -456,7 +456,7 @@ again:
456 } 456 }
457 457
458 if (i_size_read(inode) > 0) { 458 if (i_size_read(inode) > 0) {
459 ret = btrfs_truncate_free_space_cache(root, trans, inode); 459 ret = btrfs_truncate_free_space_cache(root, trans, NULL, inode);
460 if (ret) { 460 if (ret) {
461 if (ret != -ENOSPC) 461 if (ret != -ENOSPC)
462 btrfs_abort_transaction(trans, root, ret); 462 btrfs_abort_transaction(trans, root, ret);