Commit 259afe2e authored by Christof Schmitt's avatar Christof Schmitt Committed by James Bottomley

[SCSI] zfcp: Move qtcb kmem_cache to zfcp_fsf.c

Move the kmem_cache for allocating the qtcb to zfcp_fsf.c and rename
it accordingly.
Signed-off-by: default avatarChristof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: default avatarSteffen Maier <maier@linux.vnet.ibm.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
parent f9773229
...@@ -122,9 +122,9 @@ static int __init zfcp_module_init(void) ...@@ -122,9 +122,9 @@ static int __init zfcp_module_init(void)
{ {
int retval = -ENOMEM; int retval = -ENOMEM;
zfcp_data.qtcb_cache = zfcp_cache_hw_align("zfcp_qtcb", zfcp_fsf_qtcb_cache = zfcp_cache_hw_align("zfcp_fsf_qtcb",
sizeof(struct fsf_qtcb)); sizeof(struct fsf_qtcb));
if (!zfcp_data.qtcb_cache) if (!zfcp_fsf_qtcb_cache)
goto out_qtcb_cache; goto out_qtcb_cache;
zfcp_fc_req_cache = zfcp_cache_hw_align("zfcp_fc_req", zfcp_fc_req_cache = zfcp_cache_hw_align("zfcp_fc_req",
...@@ -164,7 +164,7 @@ static int __init zfcp_module_init(void) ...@@ -164,7 +164,7 @@ static int __init zfcp_module_init(void)
out_transport: out_transport:
kmem_cache_destroy(zfcp_fc_req_cache); kmem_cache_destroy(zfcp_fc_req_cache);
out_fc_cache: out_fc_cache:
kmem_cache_destroy(zfcp_data.qtcb_cache); kmem_cache_destroy(zfcp_fsf_qtcb_cache);
out_qtcb_cache: out_qtcb_cache:
return retval; return retval;
} }
...@@ -177,7 +177,7 @@ static void __exit zfcp_module_exit(void) ...@@ -177,7 +177,7 @@ static void __exit zfcp_module_exit(void)
misc_deregister(&zfcp_cfdc_misc); misc_deregister(&zfcp_cfdc_misc);
fc_release_transport(zfcp_data.scsi_transport_template); fc_release_transport(zfcp_data.scsi_transport_template);
kmem_cache_destroy(zfcp_fc_req_cache); kmem_cache_destroy(zfcp_fc_req_cache);
kmem_cache_destroy(zfcp_data.qtcb_cache); kmem_cache_destroy(zfcp_fsf_qtcb_cache);
} }
module_exit(zfcp_module_exit); module_exit(zfcp_module_exit);
...@@ -236,7 +236,7 @@ static int zfcp_allocate_low_mem_buffers(struct zfcp_adapter *adapter) ...@@ -236,7 +236,7 @@ static int zfcp_allocate_low_mem_buffers(struct zfcp_adapter *adapter)
return -ENOMEM; return -ENOMEM;
adapter->pool.qtcb_pool = adapter->pool.qtcb_pool =
mempool_create_slab_pool(4, zfcp_data.qtcb_cache); mempool_create_slab_pool(4, zfcp_fsf_qtcb_cache);
if (!adapter->pool.qtcb_pool) if (!adapter->pool.qtcb_pool)
return -ENOMEM; return -ENOMEM;
......
...@@ -317,7 +317,6 @@ struct zfcp_fsf_req { ...@@ -317,7 +317,6 @@ struct zfcp_fsf_req {
struct zfcp_data { struct zfcp_data {
struct scsi_host_template scsi_host_template; struct scsi_host_template scsi_host_template;
struct scsi_transport_template *scsi_transport_template; struct scsi_transport_template *scsi_transport_template;
struct kmem_cache *qtcb_cache;
}; };
#endif /* ZFCP_DEF_H */ #endif /* ZFCP_DEF_H */
...@@ -98,6 +98,7 @@ extern int zfcp_fc_exec_bsg_job(struct fc_bsg_job *); ...@@ -98,6 +98,7 @@ extern int zfcp_fc_exec_bsg_job(struct fc_bsg_job *);
extern int zfcp_fc_timeout_bsg_job(struct fc_bsg_job *); extern int zfcp_fc_timeout_bsg_job(struct fc_bsg_job *);
/* zfcp_fsf.c */ /* zfcp_fsf.c */
extern struct kmem_cache *zfcp_fsf_qtcb_cache;
extern int zfcp_fsf_open_port(struct zfcp_erp_action *); extern int zfcp_fsf_open_port(struct zfcp_erp_action *);
extern int zfcp_fsf_open_wka_port(struct zfcp_fc_wka_port *); extern int zfcp_fsf_open_wka_port(struct zfcp_fc_wka_port *);
extern int zfcp_fsf_close_wka_port(struct zfcp_fc_wka_port *); extern int zfcp_fsf_close_wka_port(struct zfcp_fc_wka_port *);
......
...@@ -18,6 +18,8 @@ ...@@ -18,6 +18,8 @@
#include "zfcp_qdio.h" #include "zfcp_qdio.h"
#include "zfcp_reqlist.h" #include "zfcp_reqlist.h"
struct kmem_cache *zfcp_fsf_qtcb_cache;
static void zfcp_fsf_request_timeout_handler(unsigned long data) static void zfcp_fsf_request_timeout_handler(unsigned long data)
{ {
struct zfcp_adapter *adapter = (struct zfcp_adapter *) data; struct zfcp_adapter *adapter = (struct zfcp_adapter *) data;
...@@ -83,7 +85,7 @@ void zfcp_fsf_req_free(struct zfcp_fsf_req *req) ...@@ -83,7 +85,7 @@ void zfcp_fsf_req_free(struct zfcp_fsf_req *req)
} }
if (likely(req->qtcb)) if (likely(req->qtcb))
kmem_cache_free(zfcp_data.qtcb_cache, req->qtcb); kmem_cache_free(zfcp_fsf_qtcb_cache, req->qtcb);
kfree(req); kfree(req);
} }
...@@ -628,7 +630,7 @@ static struct fsf_qtcb *zfcp_qtcb_alloc(mempool_t *pool) ...@@ -628,7 +630,7 @@ static struct fsf_qtcb *zfcp_qtcb_alloc(mempool_t *pool)
if (likely(pool)) if (likely(pool))
qtcb = mempool_alloc(pool, GFP_ATOMIC); qtcb = mempool_alloc(pool, GFP_ATOMIC);
else else
qtcb = kmem_cache_alloc(zfcp_data.qtcb_cache, GFP_ATOMIC); qtcb = kmem_cache_alloc(zfcp_fsf_qtcb_cache, GFP_ATOMIC);
if (unlikely(!qtcb)) if (unlikely(!qtcb))
return NULL; return NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment