Lines Matching refs:tgt_device
431 struct btrfs_device *tgt_device = NULL; in btrfs_dev_replace_start() local
440 src_device, &tgt_device); in btrfs_dev_replace_start()
473 dev_replace->tgtdev = tgt_device; in btrfs_dev_replace_start()
479 rcu_str_deref(tgt_device->name)); in btrfs_dev_replace_start()
497 ret = btrfs_sysfs_add_device_link(tgt_device->fs_devices, tgt_device); in btrfs_dev_replace_start()
534 btrfs_destroy_dev_replace_tgtdev(tgt_device); in btrfs_dev_replace_start()
590 struct btrfs_device *tgt_device; in btrfs_dev_replace_finishing() local
609 tgt_device = dev_replace->tgtdev; in btrfs_dev_replace_finishing()
656 tgt_device); in btrfs_dev_replace_finishing()
662 rcu_str_deref(tgt_device->name), scrub_ret); in btrfs_dev_replace_finishing()
667 if (tgt_device) in btrfs_dev_replace_finishing()
668 btrfs_destroy_dev_replace_tgtdev(tgt_device); in btrfs_dev_replace_finishing()
679 rcu_str_deref(tgt_device->name)); in btrfs_dev_replace_finishing()
680 clear_bit(BTRFS_DEV_STATE_REPLACE_TGT, &tgt_device->dev_state); in btrfs_dev_replace_finishing()
681 tgt_device->devid = src_device->devid; in btrfs_dev_replace_finishing()
683 memcpy(uuid_tmp, tgt_device->uuid, sizeof(uuid_tmp)); in btrfs_dev_replace_finishing()
684 memcpy(tgt_device->uuid, src_device->uuid, sizeof(tgt_device->uuid)); in btrfs_dev_replace_finishing()
686 btrfs_device_set_total_bytes(tgt_device, src_device->total_bytes); in btrfs_dev_replace_finishing()
687 btrfs_device_set_disk_total_bytes(tgt_device, in btrfs_dev_replace_finishing()
689 btrfs_device_set_bytes_used(tgt_device, src_device->bytes_used); in btrfs_dev_replace_finishing()
691 tgt_device->commit_total_bytes = src_device->commit_total_bytes; in btrfs_dev_replace_finishing()
692 tgt_device->commit_bytes_used = src_device->bytes_used; in btrfs_dev_replace_finishing()
694 btrfs_assign_next_active_device(src_device, tgt_device); in btrfs_dev_replace_finishing()
696 list_add(&tgt_device->dev_alloc_list, &fs_info->fs_devices->alloc_list); in btrfs_dev_replace_finishing()
711 atomic_inc(&tgt_device->dev_stats_ccnt); in btrfs_dev_replace_finishing()
815 struct btrfs_device *tgt_device = NULL; in btrfs_dev_replace_cancel() local
835 tgt_device = dev_replace->tgtdev; in btrfs_dev_replace_cancel()
850 btrfs_dev_name(tgt_device)); in btrfs_dev_replace_cancel()
859 tgt_device = dev_replace->tgtdev; in btrfs_dev_replace_cancel()
883 btrfs_dev_name(tgt_device)); in btrfs_dev_replace_cancel()
885 if (tgt_device) in btrfs_dev_replace_cancel()
886 btrfs_destroy_dev_replace_tgtdev(tgt_device); in btrfs_dev_replace_cancel()