]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
Btrfs: fix multi-device code to use raid policies set by mkfs
authorChris Mason <chris.mason@oracle.com>
Tue, 30 Sep 2008 23:24:06 +0000 (19:24 -0400)
committerChris Mason <chris.mason@oracle.com>
Tue, 30 Sep 2008 23:36:34 +0000 (19:36 -0400)
When reading in block groups, a global mask of the available raid policies
should be adjusted based on the types of block groups found on disk.  This
global mask is then used to decide which raid policy to use for new
block groups.

The recent allocator changes dropped the call that updated the global
mask, making all the block groups allocated at run time single striped
onto a single drive.

This also fixes the async worker threads to set any thread that uses
the requeue mechanism as busy.  This allows us to avoid blocking
on get_request_wait for the async bio submission threads.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
fs/btrfs/async-thread.c
fs/btrfs/extent-tree.c

index 04fb9702d14c999493c345dc976c73f3bb812a2a..d82efd722a481d174c9787834ab1427098cb3165 100644 (file)
@@ -302,8 +302,20 @@ int btrfs_requeue_work(struct btrfs_work *work)
        spin_lock_irqsave(&worker->lock, flags);
        atomic_inc(&worker->num_pending);
        list_add_tail(&work->list, &worker->pending);
-       check_busy_worker(worker);
+
+       /* by definition we're busy, take ourselves off the idle
+        * list
+        */
+       if (worker->idle) {
+               spin_lock_irqsave(&worker->workers->lock, flags);
+               worker->idle = 0;
+               list_move_tail(&worker->worker_list,
+                              &worker->workers->worker_list);
+               spin_unlock_irqrestore(&worker->workers->lock, flags);
+       }
+
        spin_unlock_irqrestore(&worker->lock, flags);
+
 out:
        return 0;
 }
index 64e14ddf62326c4e52c84204b221e87996e88539..677d5e774fad74c203e0b0a6d1c857948756f45d 100644 (file)
@@ -5145,6 +5145,8 @@ int btrfs_read_block_groups(struct btrfs_root *root)
 
                ret = btrfs_add_block_group_cache(root->fs_info, cache);
                BUG_ON(ret);
+
+               set_avail_alloc_bits(root->fs_info, cache->flags);
        }
        ret = 0;
 error: