Lines Matching refs:tgt_device

594 	struct btrfs_device *tgt_device = NULL;  in btrfs_dev_replace_start()  local
623 src_device, &tgt_device); in btrfs_dev_replace_start()
648 dev_replace->tgtdev = tgt_device; in btrfs_dev_replace_start()
654 btrfs_dev_name(tgt_device)); in btrfs_dev_replace_start()
672 ret = btrfs_sysfs_add_device(tgt_device); in btrfs_dev_replace_start()
711 btrfs_destroy_dev_replace_tgtdev(tgt_device); in btrfs_dev_replace_start()
863 struct btrfs_device *tgt_device; in btrfs_dev_replace_finishing() local
882 tgt_device = dev_replace->tgtdev; in btrfs_dev_replace_finishing()
938 scrub_ret = btrfs_set_target_alloc_state(src_device, tgt_device); in btrfs_dev_replace_finishing()
943 tgt_device); in btrfs_dev_replace_finishing()
950 btrfs_dev_name(tgt_device), scrub_ret); in btrfs_dev_replace_finishing()
956 if (tgt_device) in btrfs_dev_replace_finishing()
957 btrfs_destroy_dev_replace_tgtdev(tgt_device); in btrfs_dev_replace_finishing()
968 btrfs_dev_name(tgt_device)); in btrfs_dev_replace_finishing()
969 clear_bit(BTRFS_DEV_STATE_REPLACE_TGT, &tgt_device->dev_state); in btrfs_dev_replace_finishing()
970 tgt_device->devid = src_device->devid; in btrfs_dev_replace_finishing()
972 memcpy(uuid_tmp, tgt_device->uuid, sizeof(uuid_tmp)); in btrfs_dev_replace_finishing()
973 memcpy(tgt_device->uuid, src_device->uuid, sizeof(tgt_device->uuid)); in btrfs_dev_replace_finishing()
975 btrfs_device_set_total_bytes(tgt_device, src_device->total_bytes); in btrfs_dev_replace_finishing()
976 btrfs_device_set_disk_total_bytes(tgt_device, in btrfs_dev_replace_finishing()
978 btrfs_device_set_bytes_used(tgt_device, src_device->bytes_used); in btrfs_dev_replace_finishing()
979 tgt_device->commit_bytes_used = src_device->bytes_used; in btrfs_dev_replace_finishing()
981 btrfs_assign_next_active_device(src_device, tgt_device); in btrfs_dev_replace_finishing()
983 list_add(&tgt_device->dev_alloc_list, &fs_devices->alloc_list); in btrfs_dev_replace_finishing()
998 atomic_inc(&tgt_device->dev_stats_ccnt); in btrfs_dev_replace_finishing()
1012 btrfs_sysfs_update_devid(tgt_device); in btrfs_dev_replace_finishing()
1080 struct btrfs_device *tgt_device = NULL; in btrfs_dev_replace_cancel() local
1100 tgt_device = dev_replace->tgtdev; in btrfs_dev_replace_cancel()
1115 btrfs_dev_name(tgt_device)); in btrfs_dev_replace_cancel()
1124 tgt_device = dev_replace->tgtdev; in btrfs_dev_replace_cancel()
1149 btrfs_dev_name(tgt_device)); in btrfs_dev_replace_cancel()
1151 if (tgt_device) in btrfs_dev_replace_cancel()
1152 btrfs_destroy_dev_replace_tgtdev(tgt_device); in btrfs_dev_replace_cancel()