diff options
Diffstat (limited to 'fs/btrfs/volumes.c')
-rw-r--r-- | fs/btrfs/volumes.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 24940085cdac..440de708f9eb 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c | |||
@@ -5367,7 +5367,6 @@ static struct btrfs_device *add_missing_dev(struct btrfs_root *root, | |||
5367 | return NULL; | 5367 | return NULL; |
5368 | list_add(&device->dev_list, | 5368 | list_add(&device->dev_list, |
5369 | &fs_devices->devices); | 5369 | &fs_devices->devices); |
5370 | device->dev_root = root->fs_info->dev_root; | ||
5371 | device->devid = devid; | 5370 | device->devid = devid; |
5372 | device->work.func = pending_bios_fn; | 5371 | device->work.func = pending_bios_fn; |
5373 | device->fs_devices = fs_devices; | 5372 | device->fs_devices = fs_devices; |
@@ -5593,7 +5592,6 @@ static int read_one_dev(struct btrfs_root *root, | |||
5593 | } | 5592 | } |
5594 | 5593 | ||
5595 | fill_device_from_item(leaf, dev_item, device); | 5594 | fill_device_from_item(leaf, dev_item, device); |
5596 | device->dev_root = root->fs_info->dev_root; | ||
5597 | device->in_fs_metadata = 1; | 5595 | device->in_fs_metadata = 1; |
5598 | if (device->writeable && !device->is_tgtdev_for_dev_replace) { | 5596 | if (device->writeable && !device->is_tgtdev_for_dev_replace) { |
5599 | device->fs_devices->total_rw_bytes += device->total_bytes; | 5597 | device->fs_devices->total_rw_bytes += device->total_bytes; |
@@ -5751,6 +5749,17 @@ error: | |||
5751 | return ret; | 5749 | return ret; |
5752 | } | 5750 | } |
5753 | 5751 | ||
5752 | void btrfs_init_devices_late(struct btrfs_fs_info *fs_info) | ||
5753 | { | ||
5754 | struct btrfs_fs_devices *fs_devices = fs_info->fs_devices; | ||
5755 | struct btrfs_device *device; | ||
5756 | |||
5757 | mutex_lock(&fs_devices->device_list_mutex); | ||
5758 | list_for_each_entry(device, &fs_devices->devices, dev_list) | ||
5759 | device->dev_root = fs_info->dev_root; | ||
5760 | mutex_unlock(&fs_devices->device_list_mutex); | ||
5761 | } | ||
5762 | |||
5754 | static void __btrfs_reset_dev_stats(struct btrfs_device *dev) | 5763 | static void __btrfs_reset_dev_stats(struct btrfs_device *dev) |
5755 | { | 5764 | { |
5756 | int i; | 5765 | int i; |