Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 173757
b: refs/heads/master
c: ee74462
h: refs/heads/master
i:
  173755: ae7e83c
v: v3
  • Loading branch information
Christof Schmitt authored and James Bottomley committed Dec 4, 2009
1 parent 617192f commit 2596e17
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7c7dc196814b9e1d5cc254dc579a5fa78ae524f7
refs/heads/master: ee744622c65cd66824e8dd1b9509e515c800de14
8 changes: 8 additions & 0 deletions trunk/drivers/s390/scsi/zfcp_aux.c
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,11 @@ static int __init zfcp_module_init(void)
if (!zfcp_data.gid_pn_cache)
goto out_gid_cache;

zfcp_data.adisc_cache = zfcp_cache_hw_align("zfcp_adisc",
sizeof(struct zfcp_fc_els_adisc));
if (!zfcp_data.adisc_cache)
goto out_adisc_cache;

zfcp_data.scsi_transport_template =
fc_attach_transport(&zfcp_transport_functions);
if (!zfcp_data.scsi_transport_template)
Expand Down Expand Up @@ -206,6 +211,8 @@ static int __init zfcp_module_init(void)
out_misc:
fc_release_transport(zfcp_data.scsi_transport_template);
out_transport:
kmem_cache_destroy(zfcp_data.adisc_cache);
out_adisc_cache:
kmem_cache_destroy(zfcp_data.gid_pn_cache);
out_gid_cache:
kmem_cache_destroy(zfcp_data.sr_buffer_cache);
Expand All @@ -224,6 +231,7 @@ static void __exit zfcp_module_exit(void)
ccw_driver_unregister(&zfcp_ccw_driver);
misc_deregister(&zfcp_cfdc_misc);
fc_release_transport(zfcp_data.scsi_transport_template);
kmem_cache_destroy(zfcp_data.adisc_cache);
kmem_cache_destroy(zfcp_data.gid_pn_cache);
kmem_cache_destroy(zfcp_data.sr_buffer_cache);
kmem_cache_destroy(zfcp_data.qtcb_cache);
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/s390/scsi/zfcp_def.h
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,7 @@ struct zfcp_data {
struct kmem_cache *qtcb_cache;
struct kmem_cache *sr_buffer_cache;
struct kmem_cache *gid_pn_cache;
struct kmem_cache *adisc_cache;
};

/********************** ZFCP SPECIFIC DEFINES ********************************/
Expand Down
11 changes: 8 additions & 3 deletions trunk/drivers/s390/scsi/zfcp_fc.c
Original file line number Diff line number Diff line change
Expand Up @@ -389,15 +389,16 @@ static void zfcp_fc_adisc_handler(void *data)
out:
atomic_clear_mask(ZFCP_STATUS_PORT_LINK_TEST, &port->status);
put_device(&port->sysfs_device);
kfree(adisc);
kmem_cache_free(zfcp_data.adisc_cache, adisc);
}

static int zfcp_fc_adisc(struct zfcp_port *port)
{
struct zfcp_fc_els_adisc *adisc;
struct zfcp_adapter *adapter = port->adapter;
int ret;

adisc = kzalloc(sizeof(struct zfcp_fc_els_adisc), GFP_ATOMIC);
adisc = kmem_cache_alloc(zfcp_data.adisc_cache, GFP_ATOMIC);
if (!adisc)
return -ENOMEM;

Expand All @@ -420,7 +421,11 @@ static int zfcp_fc_adisc(struct zfcp_port *port)
hton24(adisc->adisc_req.adisc_port_id,
fc_host_port_id(adapter->scsi_host));

return zfcp_fsf_send_els(adapter, port->d_id, &adisc->els);
ret = zfcp_fsf_send_els(adapter, port->d_id, &adisc->els);
if (ret)
kmem_cache_free(zfcp_data.adisc_cache, adisc);

return ret;
}

void zfcp_fc_link_test_work(struct work_struct *work)
Expand Down

0 comments on commit 2596e17

Please sign in to comment.