diff options
author | Christof Schmitt <christof.schmitt@de.ibm.com> | 2008-10-01 06:42:20 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2008-10-03 13:11:54 -0400 |
commit | 0406289ed57955860a4f8d744a14f4c819260ce4 (patch) | |
tree | be91ef3d51f3108469d74c1fa36d10c914ce4c6d /drivers/s390/scsi/zfcp_aux.c | |
parent | a1b449de5d35b9eec8981c6ea999eea263b19a0b (diff) |
[SCSI] zfcp: Simplify zfcp data structures
Reduce the size of zfcp data structures by removing unused and
redundant members. scsi_lun is only the mangled version of the
fcp_lun. So, remove the redundant field and use the fcp_lun instead.
Since the queue lock and the pci_batch indicator are only used in the
request queue, move them from the common queue struct to the adapter
struct.
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: Swen Schillig <swen@vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/s390/scsi/zfcp_aux.c')
-rw-r--r-- | drivers/s390/scsi/zfcp_aux.c | 34 |
1 files changed, 1 insertions, 33 deletions
diff --git a/drivers/s390/scsi/zfcp_aux.c b/drivers/s390/scsi/zfcp_aux.c index 6397de01b85e..b9984648aca6 100644 --- a/drivers/s390/scsi/zfcp_aux.c +++ b/drivers/s390/scsi/zfcp_aux.c | |||
@@ -169,8 +169,6 @@ static int __init zfcp_module_init(void) | |||
169 | goto out_gid_cache; | 169 | goto out_gid_cache; |
170 | 170 | ||
171 | INIT_LIST_HEAD(&zfcp_data.adapter_list_head); | 171 | INIT_LIST_HEAD(&zfcp_data.adapter_list_head); |
172 | INIT_LIST_HEAD(&zfcp_data.adapter_remove_lh); | ||
173 | |||
174 | sema_init(&zfcp_data.config_sema, 1); | 172 | sema_init(&zfcp_data.config_sema, 1); |
175 | rwlock_init(&zfcp_data.config_lock); | 173 | rwlock_init(&zfcp_data.config_lock); |
176 | 174 | ||
@@ -312,7 +310,6 @@ struct zfcp_unit *zfcp_unit_enqueue(struct zfcp_port *port, u64 fcp_lun) | |||
312 | } | 310 | } |
313 | 311 | ||
314 | zfcp_unit_get(unit); | 312 | zfcp_unit_get(unit); |
315 | unit->scsi_lun = scsilun_to_int((struct scsi_lun *)&unit->fcp_lun); | ||
316 | 313 | ||
317 | write_lock_irq(&zfcp_data.config_lock); | 314 | write_lock_irq(&zfcp_data.config_lock); |
318 | list_add_tail(&unit->list, &port->unit_list_head); | 315 | list_add_tail(&unit->list, &port->unit_list_head); |
@@ -321,7 +318,6 @@ struct zfcp_unit *zfcp_unit_enqueue(struct zfcp_port *port, u64 fcp_lun) | |||
321 | 318 | ||
322 | write_unlock_irq(&zfcp_data.config_lock); | 319 | write_unlock_irq(&zfcp_data.config_lock); |
323 | 320 | ||
324 | port->units++; | ||
325 | zfcp_port_get(port); | 321 | zfcp_port_get(port); |
326 | 322 | ||
327 | return unit; | 323 | return unit; |
@@ -344,7 +340,6 @@ void zfcp_unit_dequeue(struct zfcp_unit *unit) | |||
344 | write_lock_irq(&zfcp_data.config_lock); | 340 | write_lock_irq(&zfcp_data.config_lock); |
345 | list_del(&unit->list); | 341 | list_del(&unit->list); |
346 | write_unlock_irq(&zfcp_data.config_lock); | 342 | write_unlock_irq(&zfcp_data.config_lock); |
347 | unit->port->units--; | ||
348 | zfcp_port_put(unit->port); | 343 | zfcp_port_put(unit->port); |
349 | sysfs_remove_group(&unit->sysfs_device.kobj, &zfcp_sysfs_unit_attrs); | 344 | sysfs_remove_group(&unit->sysfs_device.kobj, &zfcp_sysfs_unit_attrs); |
350 | device_unregister(&unit->sysfs_device); | 345 | device_unregister(&unit->sysfs_device); |
@@ -405,11 +400,6 @@ static void zfcp_free_low_mem_buffers(struct zfcp_adapter *adapter) | |||
405 | mempool_destroy(adapter->pool.data_gid_pn); | 400 | mempool_destroy(adapter->pool.data_gid_pn); |
406 | } | 401 | } |
407 | 402 | ||
408 | static void zfcp_dummy_release(struct device *dev) | ||
409 | { | ||
410 | return; | ||
411 | } | ||
412 | |||
413 | /** | 403 | /** |
414 | * zfcp_status_read_refill - refill the long running status_read_requests | 404 | * zfcp_status_read_refill - refill the long running status_read_requests |
415 | * @adapter: ptr to struct zfcp_adapter for which the buffers should be refilled | 405 | * @adapter: ptr to struct zfcp_adapter for which the buffers should be refilled |
@@ -484,7 +474,6 @@ int zfcp_adapter_enqueue(struct ccw_device *ccw_device) | |||
484 | init_waitqueue_head(&adapter->erp_done_wqh); | 474 | init_waitqueue_head(&adapter->erp_done_wqh); |
485 | 475 | ||
486 | INIT_LIST_HEAD(&adapter->port_list_head); | 476 | INIT_LIST_HEAD(&adapter->port_list_head); |
487 | INIT_LIST_HEAD(&adapter->port_remove_lh); | ||
488 | INIT_LIST_HEAD(&adapter->erp_ready_head); | 477 | INIT_LIST_HEAD(&adapter->erp_ready_head); |
489 | INIT_LIST_HEAD(&adapter->erp_running_head); | 478 | INIT_LIST_HEAD(&adapter->erp_running_head); |
490 | 479 | ||
@@ -494,7 +483,7 @@ int zfcp_adapter_enqueue(struct ccw_device *ccw_device) | |||
494 | spin_lock_init(&adapter->san_dbf_lock); | 483 | spin_lock_init(&adapter->san_dbf_lock); |
495 | spin_lock_init(&adapter->scsi_dbf_lock); | 484 | spin_lock_init(&adapter->scsi_dbf_lock); |
496 | spin_lock_init(&adapter->rec_dbf_lock); | 485 | spin_lock_init(&adapter->rec_dbf_lock); |
497 | spin_lock_init(&adapter->req_q.lock); | 486 | spin_lock_init(&adapter->req_q_lock); |
498 | 487 | ||
499 | rwlock_init(&adapter->erp_lock); | 488 | rwlock_init(&adapter->erp_lock); |
500 | rwlock_init(&adapter->abort_lock); | 489 | rwlock_init(&adapter->abort_lock); |
@@ -513,28 +502,15 @@ int zfcp_adapter_enqueue(struct ccw_device *ccw_device) | |||
513 | &zfcp_sysfs_adapter_attrs)) | 502 | &zfcp_sysfs_adapter_attrs)) |
514 | goto sysfs_failed; | 503 | goto sysfs_failed; |
515 | 504 | ||
516 | adapter->generic_services.parent = &adapter->ccw_device->dev; | ||
517 | adapter->generic_services.release = zfcp_dummy_release; | ||
518 | snprintf(adapter->generic_services.bus_id, BUS_ID_SIZE, | ||
519 | "generic_services"); | ||
520 | |||
521 | if (device_register(&adapter->generic_services)) | ||
522 | goto generic_services_failed; | ||
523 | |||
524 | write_lock_irq(&zfcp_data.config_lock); | 505 | write_lock_irq(&zfcp_data.config_lock); |
525 | atomic_clear_mask(ZFCP_STATUS_COMMON_REMOVE, &adapter->status); | 506 | atomic_clear_mask(ZFCP_STATUS_COMMON_REMOVE, &adapter->status); |
526 | list_add_tail(&adapter->list, &zfcp_data.adapter_list_head); | 507 | list_add_tail(&adapter->list, &zfcp_data.adapter_list_head); |
527 | write_unlock_irq(&zfcp_data.config_lock); | 508 | write_unlock_irq(&zfcp_data.config_lock); |
528 | 509 | ||
529 | zfcp_data.adapters++; | ||
530 | |||
531 | zfcp_fc_nameserver_init(adapter); | 510 | zfcp_fc_nameserver_init(adapter); |
532 | 511 | ||
533 | return 0; | 512 | return 0; |
534 | 513 | ||
535 | generic_services_failed: | ||
536 | sysfs_remove_group(&ccw_device->dev.kobj, | ||
537 | &zfcp_sysfs_adapter_attrs); | ||
538 | sysfs_failed: | 514 | sysfs_failed: |
539 | zfcp_adapter_debug_unregister(adapter); | 515 | zfcp_adapter_debug_unregister(adapter); |
540 | debug_register_failed: | 516 | debug_register_failed: |
@@ -561,7 +537,6 @@ void zfcp_adapter_dequeue(struct zfcp_adapter *adapter) | |||
561 | cancel_work_sync(&adapter->scan_work); | 537 | cancel_work_sync(&adapter->scan_work); |
562 | cancel_work_sync(&adapter->stat_work); | 538 | cancel_work_sync(&adapter->stat_work); |
563 | zfcp_adapter_scsi_unregister(adapter); | 539 | zfcp_adapter_scsi_unregister(adapter); |
564 | device_unregister(&adapter->generic_services); | ||
565 | sysfs_remove_group(&adapter->ccw_device->dev.kobj, | 540 | sysfs_remove_group(&adapter->ccw_device->dev.kobj, |
566 | &zfcp_sysfs_adapter_attrs); | 541 | &zfcp_sysfs_adapter_attrs); |
567 | dev_set_drvdata(&adapter->ccw_device->dev, NULL); | 542 | dev_set_drvdata(&adapter->ccw_device->dev, NULL); |
@@ -579,9 +554,6 @@ void zfcp_adapter_dequeue(struct zfcp_adapter *adapter) | |||
579 | list_del(&adapter->list); | 554 | list_del(&adapter->list); |
580 | write_unlock_irq(&zfcp_data.config_lock); | 555 | write_unlock_irq(&zfcp_data.config_lock); |
581 | 556 | ||
582 | /* decrease number of adapters in list */ | ||
583 | zfcp_data.adapters--; | ||
584 | |||
585 | zfcp_qdio_free(adapter); | 557 | zfcp_qdio_free(adapter); |
586 | 558 | ||
587 | zfcp_free_low_mem_buffers(adapter); | 559 | zfcp_free_low_mem_buffers(adapter); |
@@ -620,9 +592,7 @@ struct zfcp_port *zfcp_port_enqueue(struct zfcp_adapter *adapter, u64 wwpn, | |||
620 | return ERR_PTR(-ENOMEM); | 592 | return ERR_PTR(-ENOMEM); |
621 | 593 | ||
622 | init_waitqueue_head(&port->remove_wq); | 594 | init_waitqueue_head(&port->remove_wq); |
623 | |||
624 | INIT_LIST_HEAD(&port->unit_list_head); | 595 | INIT_LIST_HEAD(&port->unit_list_head); |
625 | INIT_LIST_HEAD(&port->unit_remove_lh); | ||
626 | INIT_WORK(&port->gid_pn_work, zfcp_erp_port_strategy_open_lookup); | 596 | INIT_WORK(&port->gid_pn_work, zfcp_erp_port_strategy_open_lookup); |
627 | 597 | ||
628 | port->adapter = adapter; | 598 | port->adapter = adapter; |
@@ -665,7 +635,6 @@ struct zfcp_port *zfcp_port_enqueue(struct zfcp_adapter *adapter, u64 wwpn, | |||
665 | list_add_tail(&port->list, &adapter->port_list_head); | 635 | list_add_tail(&port->list, &adapter->port_list_head); |
666 | atomic_clear_mask(ZFCP_STATUS_COMMON_REMOVE, &port->status); | 636 | atomic_clear_mask(ZFCP_STATUS_COMMON_REMOVE, &port->status); |
667 | atomic_set_mask(ZFCP_STATUS_COMMON_RUNNING, &port->status); | 637 | atomic_set_mask(ZFCP_STATUS_COMMON_RUNNING, &port->status); |
668 | adapter->ports++; | ||
669 | 638 | ||
670 | write_unlock_irq(&zfcp_data.config_lock); | 639 | write_unlock_irq(&zfcp_data.config_lock); |
671 | 640 | ||
@@ -687,7 +656,6 @@ void zfcp_port_dequeue(struct zfcp_port *port) | |||
687 | wait_event(port->remove_wq, atomic_read(&port->refcount) == 0); | 656 | wait_event(port->remove_wq, atomic_read(&port->refcount) == 0); |
688 | write_lock_irq(&zfcp_data.config_lock); | 657 | write_lock_irq(&zfcp_data.config_lock); |
689 | list_del(&port->list); | 658 | list_del(&port->list); |
690 | port->adapter->ports--; | ||
691 | write_unlock_irq(&zfcp_data.config_lock); | 659 | write_unlock_irq(&zfcp_data.config_lock); |
692 | if (port->rport) | 660 | if (port->rport) |
693 | fc_remote_port_delete(port->rport); | 661 | fc_remote_port_delete(port->rport); |