Lines Matching refs:tgt_device

609 	struct btrfs_device *tgt_device = NULL;  in btrfs_dev_replace_start()  local
638 src_device, &tgt_device); in btrfs_dev_replace_start()
662 dev_replace->tgtdev = tgt_device; in btrfs_dev_replace_start()
668 btrfs_dev_name(tgt_device)); in btrfs_dev_replace_start()
686 ret = btrfs_sysfs_add_device(tgt_device); in btrfs_dev_replace_start()
725 btrfs_destroy_dev_replace_tgtdev(tgt_device); in btrfs_dev_replace_start()
840 struct btrfs_device *tgt_device; in btrfs_dev_replace_finishing() local
859 tgt_device = dev_replace->tgtdev; in btrfs_dev_replace_finishing()
915 scrub_ret = btrfs_set_target_alloc_state(src_device, tgt_device); in btrfs_dev_replace_finishing()
920 tgt_device); in btrfs_dev_replace_finishing()
927 btrfs_dev_name(tgt_device), scrub_ret); in btrfs_dev_replace_finishing()
933 if (tgt_device) in btrfs_dev_replace_finishing()
934 btrfs_destroy_dev_replace_tgtdev(tgt_device); in btrfs_dev_replace_finishing()
945 btrfs_dev_name(tgt_device)); in btrfs_dev_replace_finishing()
946 clear_bit(BTRFS_DEV_STATE_REPLACE_TGT, &tgt_device->dev_state); in btrfs_dev_replace_finishing()
947 tgt_device->devid = src_device->devid; in btrfs_dev_replace_finishing()
949 memcpy(uuid_tmp, tgt_device->uuid, sizeof(uuid_tmp)); in btrfs_dev_replace_finishing()
950 memcpy(tgt_device->uuid, src_device->uuid, sizeof(tgt_device->uuid)); in btrfs_dev_replace_finishing()
952 btrfs_device_set_total_bytes(tgt_device, src_device->total_bytes); in btrfs_dev_replace_finishing()
953 btrfs_device_set_disk_total_bytes(tgt_device, in btrfs_dev_replace_finishing()
955 btrfs_device_set_bytes_used(tgt_device, src_device->bytes_used); in btrfs_dev_replace_finishing()
956 tgt_device->commit_bytes_used = src_device->bytes_used; in btrfs_dev_replace_finishing()
958 btrfs_assign_next_active_device(src_device, tgt_device); in btrfs_dev_replace_finishing()
960 list_add(&tgt_device->dev_alloc_list, &fs_devices->alloc_list); in btrfs_dev_replace_finishing()
974 atomic_inc(&tgt_device->dev_stats_ccnt); in btrfs_dev_replace_finishing()
988 btrfs_sysfs_update_devid(tgt_device); in btrfs_dev_replace_finishing()
1057 struct btrfs_device *tgt_device = NULL; in btrfs_dev_replace_cancel() local
1077 tgt_device = dev_replace->tgtdev; in btrfs_dev_replace_cancel()
1092 btrfs_dev_name(tgt_device)); in btrfs_dev_replace_cancel()
1101 tgt_device = dev_replace->tgtdev; in btrfs_dev_replace_cancel()
1126 btrfs_dev_name(tgt_device)); in btrfs_dev_replace_cancel()
1128 if (tgt_device) in btrfs_dev_replace_cancel()
1129 btrfs_destroy_dev_replace_tgtdev(tgt_device); in btrfs_dev_replace_cancel()