diff options
author | Christof Schmitt <christof.schmitt@de.ibm.com> | 2011-02-22 13:54:40 -0500 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2011-02-25 12:01:59 -0500 |
commit | c7b279ae51942c14529bf2806685e9c658f28611 (patch) | |
tree | 76d48640ccd62f7f375180cb9179f03079ac8c0c /drivers/s390/scsi/zfcp_aux.c | |
parent | 7c35e77b96b2f0af8c278c13d484d42dad3c7422 (diff) |
[SCSI] zfcp: Replace kmem_cache for "status read" data
zfcp requires a mempool for the status read data blocks to resubmit
the "status read" requests at any time. Each status read data block
has the size of a page (4096 bytes) and needs to be placed in one
page.
Instead of having a kmem_cache for allocating page sized chunks, use
mempool_create_page_pool to create a mempool returning pages and
remove the zfcp kmem_cache.
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: Steffen Maier <maier@linux.vnet.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.c | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/drivers/s390/scsi/zfcp_aux.c b/drivers/s390/scsi/zfcp_aux.c index 51c666fb67a4..81e185602bb2 100644 --- a/drivers/s390/scsi/zfcp_aux.c +++ b/drivers/s390/scsi/zfcp_aux.c | |||
@@ -132,11 +132,6 @@ static int __init zfcp_module_init(void) | |||
132 | if (!zfcp_data.qtcb_cache) | 132 | if (!zfcp_data.qtcb_cache) |
133 | goto out_qtcb_cache; | 133 | goto out_qtcb_cache; |
134 | 134 | ||
135 | zfcp_data.sr_buffer_cache = zfcp_cache_hw_align("zfcp_sr", | ||
136 | sizeof(struct fsf_status_read_buffer)); | ||
137 | if (!zfcp_data.sr_buffer_cache) | ||
138 | goto out_sr_cache; | ||
139 | |||
140 | zfcp_data.gid_pn_cache = zfcp_cache_hw_align("zfcp_gid", | 135 | zfcp_data.gid_pn_cache = zfcp_cache_hw_align("zfcp_gid", |
141 | sizeof(struct zfcp_fc_gid_pn)); | 136 | sizeof(struct zfcp_fc_gid_pn)); |
142 | if (!zfcp_data.gid_pn_cache) | 137 | if (!zfcp_data.gid_pn_cache) |
@@ -181,8 +176,6 @@ out_transport: | |||
181 | out_adisc_cache: | 176 | out_adisc_cache: |
182 | kmem_cache_destroy(zfcp_data.gid_pn_cache); | 177 | kmem_cache_destroy(zfcp_data.gid_pn_cache); |
183 | out_gid_cache: | 178 | out_gid_cache: |
184 | kmem_cache_destroy(zfcp_data.sr_buffer_cache); | ||
185 | out_sr_cache: | ||
186 | kmem_cache_destroy(zfcp_data.qtcb_cache); | 179 | kmem_cache_destroy(zfcp_data.qtcb_cache); |
187 | out_qtcb_cache: | 180 | out_qtcb_cache: |
188 | kmem_cache_destroy(zfcp_data.gpn_ft_cache); | 181 | kmem_cache_destroy(zfcp_data.gpn_ft_cache); |
@@ -199,7 +192,6 @@ static void __exit zfcp_module_exit(void) | |||
199 | fc_release_transport(zfcp_data.scsi_transport_template); | 192 | fc_release_transport(zfcp_data.scsi_transport_template); |
200 | kmem_cache_destroy(zfcp_data.adisc_cache); | 193 | kmem_cache_destroy(zfcp_data.adisc_cache); |
201 | kmem_cache_destroy(zfcp_data.gid_pn_cache); | 194 | kmem_cache_destroy(zfcp_data.gid_pn_cache); |
202 | kmem_cache_destroy(zfcp_data.sr_buffer_cache); | ||
203 | kmem_cache_destroy(zfcp_data.qtcb_cache); | 195 | kmem_cache_destroy(zfcp_data.qtcb_cache); |
204 | kmem_cache_destroy(zfcp_data.gpn_ft_cache); | 196 | kmem_cache_destroy(zfcp_data.gpn_ft_cache); |
205 | } | 197 | } |
@@ -264,10 +256,10 @@ static int zfcp_allocate_low_mem_buffers(struct zfcp_adapter *adapter) | |||
264 | if (!adapter->pool.qtcb_pool) | 256 | if (!adapter->pool.qtcb_pool) |
265 | return -ENOMEM; | 257 | return -ENOMEM; |
266 | 258 | ||
267 | adapter->pool.status_read_data = | 259 | BUILD_BUG_ON(sizeof(struct fsf_status_read_buffer) > PAGE_SIZE); |
268 | mempool_create_slab_pool(FSF_STATUS_READS_RECOM, | 260 | adapter->pool.sr_data = |
269 | zfcp_data.sr_buffer_cache); | 261 | mempool_create_page_pool(FSF_STATUS_READS_RECOM, 0); |
270 | if (!adapter->pool.status_read_data) | 262 | if (!adapter->pool.sr_data) |
271 | return -ENOMEM; | 263 | return -ENOMEM; |
272 | 264 | ||
273 | adapter->pool.gid_pn = | 265 | adapter->pool.gid_pn = |
@@ -290,8 +282,8 @@ static void zfcp_free_low_mem_buffers(struct zfcp_adapter *adapter) | |||
290 | mempool_destroy(adapter->pool.qtcb_pool); | 282 | mempool_destroy(adapter->pool.qtcb_pool); |
291 | if (adapter->pool.status_read_req) | 283 | if (adapter->pool.status_read_req) |
292 | mempool_destroy(adapter->pool.status_read_req); | 284 | mempool_destroy(adapter->pool.status_read_req); |
293 | if (adapter->pool.status_read_data) | 285 | if (adapter->pool.sr_data) |
294 | mempool_destroy(adapter->pool.status_read_data); | 286 | mempool_destroy(adapter->pool.sr_data); |
295 | if (adapter->pool.gid_pn) | 287 | if (adapter->pool.gid_pn) |
296 | mempool_destroy(adapter->pool.gid_pn); | 288 | mempool_destroy(adapter->pool.gid_pn); |
297 | } | 289 | } |