diff options
author | Arne Jansen <sensille@gmx.net> | 2011-05-23 08:30:00 -0400 |
---|---|---|
committer | Arne Jansen <sensille@gmx.net> | 2011-10-02 02:48:30 -0400 |
commit | 90519d66abbccc251d14719ac76f191f70826e40 (patch) | |
tree | 93cad519db9f4f0c97abd89d405ea1e0fec306a7 /fs/btrfs/volumes.c | |
parent | ab0fff03055d2d1b01a7581badeba18db9c4f55c (diff) |
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.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index f2a4cc79da6..1dccce5bc93 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c | |||
@@ -366,6 +366,14 @@ static noinline int device_list_add(const char *path, | |||
366 | } | 366 | } |
367 | INIT_LIST_HEAD(&device->dev_alloc_list); | 367 | INIT_LIST_HEAD(&device->dev_alloc_list); |
368 | 368 | ||
369 | /* init readahead state */ | ||
370 | spin_lock_init(&device->reada_lock); | ||
371 | device->reada_curr_zone = NULL; | ||
372 | atomic_set(&device->reada_in_flight, 0); | ||
373 | device->reada_next = 0; | ||
374 | INIT_RADIX_TREE(&device->reada_zones, GFP_NOFS & ~__GFP_WAIT); | ||
375 | INIT_RADIX_TREE(&device->reada_extents, GFP_NOFS & ~__GFP_WAIT); | ||
376 | |||
369 | mutex_lock(&fs_devices->device_list_mutex); | 377 | mutex_lock(&fs_devices->device_list_mutex); |
370 | list_add_rcu(&device->dev_list, &fs_devices->devices); | 378 | list_add_rcu(&device->dev_list, &fs_devices->devices); |
371 | mutex_unlock(&fs_devices->device_list_mutex); | 379 | mutex_unlock(&fs_devices->device_list_mutex); |