Lines Matching refs:tgt_device
458 struct btrfs_device *tgt_device = NULL;
487 src_device, &tgt_device);
507 dev_replace->tgtdev = tgt_device;
513 rcu_str_deref(tgt_device->name));
531 ret = btrfs_sysfs_add_device(tgt_device);
565 btrfs_destroy_dev_replace_tgtdev(tgt_device);
679 struct btrfs_device *tgt_device;
698 tgt_device = dev_replace->tgtdev;
758 scrub_ret = btrfs_set_target_alloc_state(src_device, tgt_device);
763 tgt_device);
770 rcu_str_deref(tgt_device->name), scrub_ret);
777 if (tgt_device)
778 btrfs_destroy_dev_replace_tgtdev(tgt_device);
789 rcu_str_deref(tgt_device->name));
790 clear_bit(BTRFS_DEV_STATE_REPLACE_TGT, &tgt_device->dev_state);
791 tgt_device->devid = src_device->devid;
793 memcpy(uuid_tmp, tgt_device->uuid, sizeof(uuid_tmp));
794 memcpy(tgt_device->uuid, src_device->uuid, sizeof(tgt_device->uuid));
796 btrfs_device_set_total_bytes(tgt_device, src_device->total_bytes);
797 btrfs_device_set_disk_total_bytes(tgt_device,
799 btrfs_device_set_bytes_used(tgt_device, src_device->bytes_used);
800 tgt_device->commit_bytes_used = src_device->bytes_used;
802 btrfs_assign_next_active_device(src_device, tgt_device);
804 list_add(&tgt_device->dev_alloc_list, &fs_info->fs_devices->alloc_list);
818 atomic_inc(&tgt_device->dev_stats_ccnt);
832 btrfs_sysfs_update_devid(tgt_device);
901 struct btrfs_device *tgt_device = NULL;
921 tgt_device = dev_replace->tgtdev;
936 btrfs_dev_name(tgt_device));
945 tgt_device = dev_replace->tgtdev;
970 btrfs_dev_name(tgt_device));
972 if (tgt_device)
973 btrfs_destroy_dev_replace_tgtdev(tgt_device);