summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/volumes.c
diff options
context:
space:
mode:
authorArne Jansen2011-05-23 14:30:00 +0200
committerArne Jansen2011-10-02 08:48:30 +0200
commit90519d66abbccc251d14719ac76f191f70826e40 (patch)
tree93cad519db9f4f0c97abd89d405ea1e0fec306a7 /fs/btrfs/volumes.c
parentbtrfs: add READAHEAD extent buffer flag (diff)
downloadkernel-qcow2-linux-90519d66abbccc251d14719ac76f191f70826e40.tar.gz
kernel-qcow2-linux-90519d66abbccc251d14719ac76f191f70826e40.tar.xz
kernel-qcow2-linux-90519d66abbccc251d14719ac76f191f70826e40.zip
btrfs: state information for readahead
Add state information for readahead to btrfs_fs_info and btrfs_device Changes v2: - don't wait in radix_trees - add own set of workers for readahead Reviewed-by: Josef Bacik <josef@redhat.com> Signed-off-by: Arne Jansen <sensille@gmx.net>
Diffstat (limited to 'fs/btrfs/volumes.c')
-rw-r--r--fs/btrfs/volumes.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index f2a4cc79da61..1dccce5bc93d 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -366,6 +366,14 @@ static noinline int device_list_add(const char *path,
}
INIT_LIST_HEAD(&device->dev_alloc_list);
+ /* init readahead state */
+ spin_lock_init(&device->reada_lock);
+ device->reada_curr_zone = NULL;
+ atomic_set(&device->reada_in_flight, 0);
+ device->reada_next = 0;
+ INIT_RADIX_TREE(&device->reada_zones, GFP_NOFS & ~__GFP_WAIT);
+ INIT_RADIX_TREE(&device->reada_extents, GFP_NOFS & ~__GFP_WAIT);
+
mutex_lock(&fs_devices->device_list_mutex);
list_add_rcu(&device->dev_list, &fs_devices->devices);
mutex_unlock(&fs_devices->device_list_mutex);