aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/scsi/zfcp_aux.c
diff options
context:
space:
mode:
authorSwen Schillig <swen@vnet.ibm.com>2009-08-18 09:43:19 -0400
committerJames Bottomley <James.Bottomley@suse.de>2009-09-05 09:49:27 -0400
commit564e1c86c810f9ccfe4300afa402815e3db4886d (patch)
treeecb88038c443d6486e9df352c79b3c78be5454ef /drivers/s390/scsi/zfcp_aux.c
parent42428f747a8a0db9c6de03e105932316defad65d (diff)
[SCSI] zfcp: Move qdio related data out of zfcp_adapter
The zfcp_adapter structure was growing over time to a size of almost one memory page. To reduce the size of the data structure and to seperate different layers, put all qdio related data in the new zfcp_qdio data structure. 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/zfcp_aux.c')
-rw-r--r--drivers/s390/scsi/zfcp_aux.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/drivers/s390/scsi/zfcp_aux.c b/drivers/s390/scsi/zfcp_aux.c
index f785cbc7520d..ed7211ef04eb 100644
--- a/drivers/s390/scsi/zfcp_aux.c
+++ b/drivers/s390/scsi/zfcp_aux.c
@@ -428,7 +428,7 @@ static void zfcp_free_low_mem_buffers(struct zfcp_adapter *adapter)
428int zfcp_status_read_refill(struct zfcp_adapter *adapter) 428int zfcp_status_read_refill(struct zfcp_adapter *adapter)
429{ 429{
430 while (atomic_read(&adapter->stat_miss) > 0) 430 while (atomic_read(&adapter->stat_miss) > 0)
431 if (zfcp_fsf_status_read(adapter)) { 431 if (zfcp_fsf_status_read(adapter->qdio)) {
432 if (atomic_read(&adapter->stat_miss) >= 16) { 432 if (atomic_read(&adapter->stat_miss) >= 16) {
433 zfcp_erp_adapter_reopen(adapter, 0, "axsref1", 433 zfcp_erp_adapter_reopen(adapter, 0, "axsref1",
434 NULL); 434 NULL);
@@ -507,11 +507,16 @@ int zfcp_adapter_enqueue(struct ccw_device *ccw_device)
507 return -ENOMEM; 507 return -ENOMEM;
508 } 508 }
509 509
510 adapter->qdio = kzalloc(sizeof(struct zfcp_qdio), GFP_KERNEL);
511 if (!adapter->qdio)
512 goto qdio_mem_failed;
513
514 adapter->qdio->adapter = adapter;
510 ccw_device->handler = NULL; 515 ccw_device->handler = NULL;
511 adapter->ccw_device = ccw_device; 516 adapter->ccw_device = ccw_device;
512 atomic_set(&adapter->refcount, 0); 517 atomic_set(&adapter->refcount, 0);
513 518
514 if (zfcp_qdio_allocate(adapter)) 519 if (zfcp_qdio_allocate(adapter->qdio, ccw_device))
515 goto qdio_allocate_failed; 520 goto qdio_allocate_failed;
516 521
517 if (zfcp_allocate_low_mem_buffers(adapter)) 522 if (zfcp_allocate_low_mem_buffers(adapter))
@@ -536,8 +541,8 @@ int zfcp_adapter_enqueue(struct ccw_device *ccw_device)
536 541
537 spin_lock_init(&adapter->req_list_lock); 542 spin_lock_init(&adapter->req_list_lock);
538 543
539 spin_lock_init(&adapter->req_q_lock); 544 spin_lock_init(&adapter->qdio->req_q_lock);
540 spin_lock_init(&adapter->qdio_stat_lock); 545 spin_lock_init(&adapter->qdio->stat_lock);
541 546
542 rwlock_init(&adapter->erp_lock); 547 rwlock_init(&adapter->erp_lock);
543 rwlock_init(&adapter->abort_lock); 548 rwlock_init(&adapter->abort_lock);
@@ -574,7 +579,9 @@ debug_register_failed:
574failed_low_mem_buffers: 579failed_low_mem_buffers:
575 zfcp_free_low_mem_buffers(adapter); 580 zfcp_free_low_mem_buffers(adapter);
576qdio_allocate_failed: 581qdio_allocate_failed:
577 zfcp_qdio_free(adapter); 582 zfcp_qdio_free(adapter->qdio);
583 kfree(adapter->qdio);
584qdio_mem_failed:
578 kfree(adapter); 585 kfree(adapter);
579 return -ENOMEM; 586 return -ENOMEM;
580} 587}
@@ -605,12 +612,13 @@ void zfcp_adapter_dequeue(struct zfcp_adapter *adapter)
605 612
606 zfcp_destroy_adapter_work_queue(adapter); 613 zfcp_destroy_adapter_work_queue(adapter);
607 zfcp_adapter_debug_unregister(adapter); 614 zfcp_adapter_debug_unregister(adapter);
608 zfcp_qdio_free(adapter); 615 zfcp_qdio_free(adapter->qdio);
609 zfcp_free_low_mem_buffers(adapter); 616 zfcp_free_low_mem_buffers(adapter);
610 kfree(adapter->req_list); 617 kfree(adapter->req_list);
611 kfree(adapter->fc_stats); 618 kfree(adapter->fc_stats);
612 kfree(adapter->stats_reset_data); 619 kfree(adapter->stats_reset_data);
613 kfree(adapter->gs); 620 kfree(adapter->gs);
621 kfree(adapter->qdio);
614 kfree(adapter); 622 kfree(adapter);
615} 623}
616 624