summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/extent-tree.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2007-08-08 20:17:12 -0400
committerDavid Woodhouse <dwmw2@hera.kernel.org>2007-08-08 20:17:12 -0400
commit409eb95d7f6632d5af32b795244ce68a29e49319 (patch)
treed652da6d5c5055a5f090e3327e512d752d430279 /fs/btrfs/extent-tree.c
parent26b8003f10569a9155b7539ef5a7379ee0c6b050 (diff)
downloadlinux-stable-409eb95d7f6632d5af32b795244ce68a29e49319.tar.gz
linux-stable-409eb95d7f6632d5af32b795244ce68a29e49319.tar.bz2
linux-stable-409eb95d7f6632d5af32b795244ce68a29e49319.zip
Btrfs: Further reduce the concurrency penalty of defrag and drop_snapshot
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/extent-tree.c')
-rw-r--r--fs/btrfs/extent-tree.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index ba50bd7b9a78..120c448f58f8 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -1312,7 +1312,10 @@ static void reada_walk_down(struct btrfs_root *root,
BUG_ON(ret);
if (refs != 1)
continue;
+ mutex_unlock(&root->fs_info->fs_mutex);
ret = readahead_tree_block(root, blocknr);
+ cond_resched();
+ mutex_lock(&root->fs_info->fs_mutex);
if (ret)
break;
}
@@ -1445,7 +1448,6 @@ int btrfs_drop_snapshot(struct btrfs_trans_handle *trans, struct btrfs_root
struct btrfs_path *path;
int i;
int orig_level;
- int num_walks = 0;
struct btrfs_root_item *root_item = &root->root_item;
path = btrfs_alloc_path();
@@ -1486,12 +1488,9 @@ int btrfs_drop_snapshot(struct btrfs_trans_handle *trans, struct btrfs_root
break;
if (wret < 0)
ret = wret;
- num_walks++;
- if (num_walks > 2) {
- ret = -EAGAIN;
- get_bh(root->node);
- break;
- }
+ ret = -EAGAIN;
+ get_bh(root->node);
+ break;
}
for (i = 0; i <= orig_level; i++) {
if (path->nodes[i]) {