@@ -830,6 +830,7 @@ int sas_target_alloc(struct scsi_target *starget)
kref_get(&found_dev->kref);
starget->hostdata = found_dev;
+ found_dev->starget = starget;
return 0;
}
@@ -919,6 +920,7 @@ void sas_target_destroy(struct scsi_target *starget)
return;
starget->hostdata = NULL;
+ found_dev->starget = NULL;
sas_put_device(found_dev);
}
@@ -175,6 +175,7 @@ struct domain_device {
struct domain_device *parent;
struct list_head siblings; /* devices on the same level */
+ struct scsi_target *starget; /* Corresponding SCSI target device */
struct asd_sas_port *port; /* shortcut to root of the tree */
struct sas_phy *phy;
Add a pointer to the SCSI target which corresponds to the domain device. Signed-off-by: Hannes Reinecke <hare@suse.de> --- drivers/scsi/libsas/sas_scsi_host.c | 2 ++ include/scsi/libsas.h | 1 + 2 files changed, 3 insertions(+)