summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2008-07-22 20:08:37 +0400
committerChris Mason <chris.mason@oracle.com>2008-09-25 19:04:05 +0400
commite34a5b4f77b8448cf2863ad0cbac35e2c2a86a0a (patch)
tree52c9d89d2cb31d70f021a0db8587566018edb0ff /fs
parent6dddcbeb28b34620ad033f1e8d9f6960bafdd7d2 (diff)
downloadlinux-e34a5b4f77b8448cf2863ad0cbac35e2c2a86a0a.tar.xz
Btrfs: Add some conditional schedules near the alloc_mutex
This helps prevent stalls, especially while the snapshot cleaner is running hard Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/btrfs/extent-tree.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index c51cd11de206..72fa28236e5d 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -937,6 +937,7 @@ int btrfs_inc_ref(struct btrfs_trans_handle *trans, struct btrfs_root *root,
level = btrfs_header_level(buf);
nritems = btrfs_header_nritems(buf);
for (i = 0; i < nritems; i++) {
+ cond_resched();
if (level == 0) {
u64 disk_bytenr;
btrfs_item_key_to_cpu(buf, &key, i);
@@ -2189,6 +2190,7 @@ static int noinline drop_leaf_ref(struct btrfs_trans_handle *trans,
for (i = 0; i < nritems; i++) {
u64 disk_bytenr;
+ cond_resched();
btrfs_item_key_to_cpu(leaf, &key, i);
if (btrfs_key_type(&key) != BTRFS_EXTENT_DATA_KEY)