提交 47b87b79 编写于 作者: H Heiko Carstens 提交者: James Bottomley

[SCSI] zfcp: allocate gid_pn_data objects from gid_pn_cache

allocate gid_pn_data objects from gid_pn_cache.

Allocate gid_pn_data objects from the corresponding cache which ensures
proper alignment.
Signed-off-by: NHeiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: NSwen Schillig <swen@vnet.ibm.com>
Signed-off-by: NJames Bottomley <James.Bottomley@SteelEye.com>
上级 83f6d6d7
...@@ -1503,7 +1503,7 @@ zfcp_gid_pn_buffers_alloc(struct zfcp_gid_pn_data **gid_pn, mempool_t *pool) ...@@ -1503,7 +1503,7 @@ zfcp_gid_pn_buffers_alloc(struct zfcp_gid_pn_data **gid_pn, mempool_t *pool)
data->ct.pool = pool; data->ct.pool = pool;
} }
} else { } else {
data = kmalloc(sizeof(struct zfcp_gid_pn_data), GFP_ATOMIC); data = kmem_cache_alloc(zfcp_data.gid_pn_cache, GFP_ATOMIC);
} }
if (NULL == data) if (NULL == data)
...@@ -1531,7 +1531,7 @@ static void zfcp_gid_pn_buffers_free(struct zfcp_gid_pn_data *gid_pn) ...@@ -1531,7 +1531,7 @@ static void zfcp_gid_pn_buffers_free(struct zfcp_gid_pn_data *gid_pn)
if (gid_pn->ct.pool) if (gid_pn->ct.pool)
mempool_free(gid_pn, gid_pn->ct.pool); mempool_free(gid_pn, gid_pn->ct.pool);
else else
kfree(gid_pn); kmem_cache_free(zfcp_data.gid_pn_cache, gid_pn);
} }
/** /**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册