summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/volumes.h
diff options
context:
space:
mode:
authorIlya Dryomov2013-08-23 12:20:17 +0200
committerChris Mason2013-09-01 14:16:04 +0200
commit12bd2fc0d2f589f9605b8f497eee2e7724f3af24 (patch)
treedf82467f721c91a82db67d6820dadb6815078648 /fs/btrfs/volumes.h
parentBtrfs: find_next_devid: root -> fs_info (diff)
downloadkernel-qcow2-linux-12bd2fc0d2f589f9605b8f497eee2e7724f3af24.tar.gz
kernel-qcow2-linux-12bd2fc0d2f589f9605b8f497eee2e7724f3af24.tar.xz
kernel-qcow2-linux-12bd2fc0d2f589f9605b8f497eee2e7724f3af24.zip
Btrfs: add btrfs_alloc_device and switch to it
Currently btrfs_device is allocated ad-hoc in a few different places, and as a result not all fields are initialized properly. In particular, readahead state is only initialized in device_list_add (at scan time), and not in btrfs_init_new_device (when the new device is added with 'btrfs dev add'). Fix this by adding an allocation helper and switch everybody but __btrfs_close_devices to it. (__btrfs_close_devices is dealt with in a later commit.) Signed-off-by: Ilya Dryomov <idryomov@gmail.com> Signed-off-by: Josef Bacik <jbacik@fusionio.com> Signed-off-by: Chris Mason <chris.mason@fusionio.com>
Diffstat (limited to 'fs/btrfs/volumes.h')
-rw-r--r--fs/btrfs/volumes.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/btrfs/volumes.h b/fs/btrfs/volumes.h
index d98b942c3896..b72f540c8b29 100644
--- a/fs/btrfs/volumes.h
+++ b/fs/btrfs/volumes.h
@@ -305,6 +305,9 @@ void btrfs_close_extra_devices(struct btrfs_fs_info *fs_info,
int btrfs_find_device_missing_or_by_path(struct btrfs_root *root,
char *device_path,
struct btrfs_device **device);
+struct btrfs_device *btrfs_alloc_device(struct btrfs_fs_info *fs_info,
+ const u64 *devid,
+ const u8 *uuid);
int btrfs_rm_device(struct btrfs_root *root, char *device_path);
void btrfs_cleanup_fs_uuids(void);
int btrfs_num_copies(struct btrfs_fs_info *fs_info, u64 logical, u64 len);