diff options
author | Chris Mason <chris.mason@oracle.com> | 2007-08-08 10:08:58 -0400 |
---|---|---|
committer | David Woodhouse <dwmw2@hera.kernel.org> | 2007-08-08 10:08:58 -0400 |
commit | f4468e94c86c2031f447788c4bfe7dfd2fcdc93a (patch) | |
tree | 984a0751f69524cada1113d5504875a0fb5cec35 /fs/btrfs/transaction.c | |
parent | 37fa704640059d515cb2c7c6eaa5eb82901b95ac (diff) |
Btrfs: Let some locks go during defrag and snapshot dropping
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/transaction.c')
-rw-r--r-- | fs/btrfs/transaction.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c index 338a7199363b..88b0752550b6 100644 --- a/fs/btrfs/transaction.c +++ b/fs/btrfs/transaction.c | |||
@@ -354,6 +354,7 @@ int btrfs_defrag_dirty_roots(struct btrfs_fs_info *info) | |||
354 | mutex_unlock(&info->fs_mutex); | 354 | mutex_unlock(&info->fs_mutex); |
355 | 355 | ||
356 | btrfs_btree_balance_dirty(root); | 356 | btrfs_btree_balance_dirty(root); |
357 | cond_resched(); | ||
357 | 358 | ||
358 | mutex_lock(&info->fs_mutex); | 359 | mutex_lock(&info->fs_mutex); |
359 | trans = btrfs_start_transaction(tree_root, 1); | 360 | trans = btrfs_start_transaction(tree_root, 1); |
@@ -394,6 +395,12 @@ static int drop_dirty_roots(struct btrfs_root *tree_root, | |||
394 | ret = err; | 395 | ret = err; |
395 | ret = btrfs_end_transaction(trans, tree_root); | 396 | ret = btrfs_end_transaction(trans, tree_root); |
396 | BUG_ON(ret); | 397 | BUG_ON(ret); |
398 | mutex_unlock(&tree_root->fs_info->fs_mutex); | ||
399 | |||
400 | btrfs_btree_balance_dirty(tree_root); | ||
401 | schedule(); | ||
402 | |||
403 | mutex_lock(&tree_root->fs_info->fs_mutex); | ||
397 | } | 404 | } |
398 | BUG_ON(ret); | 405 | BUG_ON(ret); |
399 | ret = btrfs_del_root(trans, tree_root, &dirty->root->root_key); | 406 | ret = btrfs_del_root(trans, tree_root, &dirty->root->root_key); |
@@ -406,6 +413,7 @@ static int drop_dirty_roots(struct btrfs_root *tree_root, | |||
406 | kfree(dirty); | 413 | kfree(dirty); |
407 | mutex_unlock(&tree_root->fs_info->fs_mutex); | 414 | mutex_unlock(&tree_root->fs_info->fs_mutex); |
408 | btrfs_btree_balance_dirty(tree_root); | 415 | btrfs_btree_balance_dirty(tree_root); |
416 | schedule(); | ||
409 | } | 417 | } |
410 | return ret; | 418 | return ret; |
411 | } | 419 | } |