Btrfs: add btrfs_alloc_device and switch to it
authorIlya Dryomov <idryomov@gmail.com>
Fri, 23 Aug 2013 10:20:17 +0000 (13:20 +0300)
committerChris Mason <chris.mason@fusionio.com>
Sun, 1 Sep 2013 12:16:04 +0000 (08:16 -0400)
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>

No differences found