diff options
author | Chris Mason <chris.mason@oracle.com> | 2008-08-01 13:11:41 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2008-09-25 11:04:06 -0400 |
commit | 18e35e0ab337ec99c7e03e9ae917745a352c0bb1 (patch) | |
tree | b262ecafb28e5a3e533cae2aa46214bf813bdb2b /fs/btrfs/extent-tree.c | |
parent | f87f057b49ee52cf5c627ab27a706e3252767c9f (diff) |
Btrfs: Throttle less often waiting for snapshots to delete
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/extent-tree.c')
-rw-r--r-- | fs/btrfs/extent-tree.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index 58bceeeda9c5..74bcd48a9c43 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c | |||
@@ -2535,6 +2535,10 @@ static int noinline walk_down_tree(struct btrfs_trans_handle *trans, | |||
2535 | root_gen, 0, 0, 1); | 2535 | root_gen, 0, 0, 1); |
2536 | BUG_ON(ret); | 2536 | BUG_ON(ret); |
2537 | mutex_unlock(&root->fs_info->alloc_mutex); | 2537 | mutex_unlock(&root->fs_info->alloc_mutex); |
2538 | |||
2539 | atomic_inc(&root->fs_info->throttle_gen); | ||
2540 | wake_up(&root->fs_info->transaction_throttle); | ||
2541 | |||
2538 | continue; | 2542 | continue; |
2539 | } | 2543 | } |
2540 | /* | 2544 | /* |
@@ -2603,7 +2607,6 @@ out: | |||
2603 | root_owner = btrfs_header_owner(parent); | 2607 | root_owner = btrfs_header_owner(parent); |
2604 | root_gen = btrfs_header_generation(parent); | 2608 | root_gen = btrfs_header_generation(parent); |
2605 | 2609 | ||
2606 | |||
2607 | mutex_lock(&root->fs_info->alloc_mutex); | 2610 | mutex_lock(&root->fs_info->alloc_mutex); |
2608 | ret = __btrfs_free_extent(trans, root, bytenr, blocksize, | 2611 | ret = __btrfs_free_extent(trans, root, bytenr, blocksize, |
2609 | root_owner, root_gen, 0, 0, 1); | 2612 | root_owner, root_gen, 0, 0, 1); |
@@ -2726,7 +2729,6 @@ int btrfs_drop_snapshot(struct btrfs_trans_handle *trans, struct btrfs_root | |||
2726 | } | 2729 | } |
2727 | } | 2730 | } |
2728 | while(1) { | 2731 | while(1) { |
2729 | atomic_inc(&root->fs_info->throttle_gen); | ||
2730 | wret = walk_down_tree(trans, root, path, &level); | 2732 | wret = walk_down_tree(trans, root, path, &level); |
2731 | if (wret > 0) | 2733 | if (wret > 0) |
2732 | break; | 2734 | break; |
@@ -2742,6 +2744,7 @@ int btrfs_drop_snapshot(struct btrfs_trans_handle *trans, struct btrfs_root | |||
2742 | ret = -EAGAIN; | 2744 | ret = -EAGAIN; |
2743 | break; | 2745 | break; |
2744 | } | 2746 | } |
2747 | atomic_inc(&root->fs_info->throttle_gen); | ||
2745 | wake_up(&root->fs_info->transaction_throttle); | 2748 | wake_up(&root->fs_info->transaction_throttle); |
2746 | } | 2749 | } |
2747 | for (i = 0; i <= orig_level; i++) { | 2750 | for (i = 0; i <= orig_level; i++) { |