diff options
author | Swen Schillig <swen@vnet.ibm.com> | 2009-08-18 09:43:24 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2009-09-05 09:49:35 -0400 |
commit | ea945ff84c2ce1089edb7914ffdd998c24c25903 (patch) | |
tree | e4d47ff2b8ae9c71a6da87b8d1651c355016e9f1 /drivers/s390/scsi | |
parent | 6f53a2d2ecaefa3ffff8864f51a3ae38737e1152 (diff) |
[SCSI] zfcp: resolve false usage of dd_data in fc_rport
The fc_rport structure reserves a reference where a LLD can put
information required in a situation where the fc transport class is
triggering LLD callbacks. The zfcp driver was using this variable
directly which is discouraged. This patch solves this issue by making
this reference unnecessary. In addition the dev_loss_tmo callback is
removed, it is not required: zfcp does not access the fc_rport after
calling fc_remote_port_delete.
Signed-off-by: Swen Schillig <swen@vnet.ibm.com>
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/s390/scsi')
-rw-r--r-- | drivers/s390/scsi/zfcp_aux.c | 4 | ||||
-rw-r--r-- | drivers/s390/scsi/zfcp_fc.c | 2 | ||||
-rw-r--r-- | drivers/s390/scsi/zfcp_scsi.c | 22 |
3 files changed, 5 insertions, 23 deletions
diff --git a/drivers/s390/scsi/zfcp_aux.c b/drivers/s390/scsi/zfcp_aux.c index 23b85a03e26..ed9a8a1517c 100644 --- a/drivers/s390/scsi/zfcp_aux.c +++ b/drivers/s390/scsi/zfcp_aux.c | |||
@@ -709,10 +709,6 @@ void zfcp_port_dequeue(struct zfcp_port *port) | |||
709 | write_lock_irq(&zfcp_data.config_lock); | 709 | write_lock_irq(&zfcp_data.config_lock); |
710 | list_del(&port->list); | 710 | list_del(&port->list); |
711 | write_unlock_irq(&zfcp_data.config_lock); | 711 | write_unlock_irq(&zfcp_data.config_lock); |
712 | if (port->rport) { | ||
713 | port->rport->dd_data = NULL; | ||
714 | port->rport = NULL; | ||
715 | } | ||
716 | wait_event(port->remove_wq, atomic_read(&port->refcount) == 0); | 712 | wait_event(port->remove_wq, atomic_read(&port->refcount) == 0); |
717 | cancel_work_sync(&port->rport_work); /* usually not necessary */ | 713 | cancel_work_sync(&port->rport_work); /* usually not necessary */ |
718 | zfcp_adapter_put(port->adapter); | 714 | zfcp_adapter_put(port->adapter); |
diff --git a/drivers/s390/scsi/zfcp_fc.c b/drivers/s390/scsi/zfcp_fc.c index 7433da900fa..5c1f12247e4 100644 --- a/drivers/s390/scsi/zfcp_fc.c +++ b/drivers/s390/scsi/zfcp_fc.c | |||
@@ -752,7 +752,7 @@ int zfcp_fc_execute_els_fc_job(struct fc_bsg_job *job) | |||
752 | els_fc_job->els.adapter = adapter; | 752 | els_fc_job->els.adapter = adapter; |
753 | if (rport) { | 753 | if (rport) { |
754 | read_lock_irq(&zfcp_data.config_lock); | 754 | read_lock_irq(&zfcp_data.config_lock); |
755 | port = rport->dd_data; | 755 | port = zfcp_get_port_by_wwpn(adapter, rport->port_name); |
756 | if (port) | 756 | if (port) |
757 | els_fc_job->els.d_id = port->d_id; | 757 | els_fc_job->els.d_id = port->d_id; |
758 | read_unlock_irq(&zfcp_data.config_lock); | 758 | read_unlock_irq(&zfcp_data.config_lock); |
diff --git a/drivers/s390/scsi/zfcp_scsi.c b/drivers/s390/scsi/zfcp_scsi.c index b6177ad2d5b..3ff726afafc 100644 --- a/drivers/s390/scsi/zfcp_scsi.c +++ b/drivers/s390/scsi/zfcp_scsi.c | |||
@@ -491,21 +491,6 @@ static void zfcp_set_rport_dev_loss_tmo(struct fc_rport *rport, u32 timeout) | |||
491 | } | 491 | } |
492 | 492 | ||
493 | /** | 493 | /** |
494 | * zfcp_scsi_dev_loss_tmo_callbk - Free any reference to rport | ||
495 | * @rport: The rport that is about to be deleted. | ||
496 | */ | ||
497 | static void zfcp_scsi_dev_loss_tmo_callbk(struct fc_rport *rport) | ||
498 | { | ||
499 | struct zfcp_port *port; | ||
500 | |||
501 | write_lock_irq(&zfcp_data.config_lock); | ||
502 | port = rport->dd_data; | ||
503 | if (port) | ||
504 | port->rport = NULL; | ||
505 | write_unlock_irq(&zfcp_data.config_lock); | ||
506 | } | ||
507 | |||
508 | /** | ||
509 | * zfcp_scsi_terminate_rport_io - Terminate all I/O on a rport | 494 | * zfcp_scsi_terminate_rport_io - Terminate all I/O on a rport |
510 | * @rport: The FC rport where to teminate I/O | 495 | * @rport: The FC rport where to teminate I/O |
511 | * | 496 | * |
@@ -516,9 +501,12 @@ static void zfcp_scsi_dev_loss_tmo_callbk(struct fc_rport *rport) | |||
516 | static void zfcp_scsi_terminate_rport_io(struct fc_rport *rport) | 501 | static void zfcp_scsi_terminate_rport_io(struct fc_rport *rport) |
517 | { | 502 | { |
518 | struct zfcp_port *port; | 503 | struct zfcp_port *port; |
504 | struct Scsi_Host *shost = rport_to_shost(rport); | ||
505 | struct zfcp_adapter *adapter = | ||
506 | (struct zfcp_adapter *)shost->hostdata[0]; | ||
519 | 507 | ||
520 | write_lock_irq(&zfcp_data.config_lock); | 508 | write_lock_irq(&zfcp_data.config_lock); |
521 | port = rport->dd_data; | 509 | port = zfcp_get_port_by_wwpn(adapter, rport->port_name); |
522 | if (port) | 510 | if (port) |
523 | zfcp_port_get(port); | 511 | zfcp_port_get(port); |
524 | write_unlock_irq(&zfcp_data.config_lock); | 512 | write_unlock_irq(&zfcp_data.config_lock); |
@@ -550,7 +538,6 @@ static void zfcp_scsi_rport_register(struct zfcp_port *port) | |||
550 | return; | 538 | return; |
551 | } | 539 | } |
552 | 540 | ||
553 | rport->dd_data = port; | ||
554 | rport->maxframe_size = port->maxframe_size; | 541 | rport->maxframe_size = port->maxframe_size; |
555 | rport->supported_classes = port->supported_classes; | 542 | rport->supported_classes = port->supported_classes; |
556 | port->rport = rport; | 543 | port->rport = rport; |
@@ -663,7 +650,6 @@ struct fc_function_template zfcp_transport_functions = { | |||
663 | .reset_fc_host_stats = zfcp_reset_fc_host_stats, | 650 | .reset_fc_host_stats = zfcp_reset_fc_host_stats, |
664 | .set_rport_dev_loss_tmo = zfcp_set_rport_dev_loss_tmo, | 651 | .set_rport_dev_loss_tmo = zfcp_set_rport_dev_loss_tmo, |
665 | .get_host_port_state = zfcp_get_host_port_state, | 652 | .get_host_port_state = zfcp_get_host_port_state, |
666 | .dev_loss_tmo_callbk = zfcp_scsi_dev_loss_tmo_callbk, | ||
667 | .terminate_rport_io = zfcp_scsi_terminate_rport_io, | 653 | .terminate_rport_io = zfcp_scsi_terminate_rport_io, |
668 | .show_host_port_state = 1, | 654 | .show_host_port_state = 1, |
669 | .bsg_request = zfcp_execute_fc_job, | 655 | .bsg_request = zfcp_execute_fc_job, |