[SCSI] zfcp: allocate gid_pn_data objects from gid_pn_cache
authorHeiko Carstens <heiko.carstens@de.ibm.com>
Wed, 8 Aug 2007 08:47:10 +0000 (10:47 +0200)
committerJames Bottomley <jejb@mulgrave.localdomain>
Wed, 15 Aug 2007 17:28:29 +0000 (12:28 -0500)
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: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Swen Schillig <swen@vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
drivers/s390/scsi/zfcp_aux.c

index ab5ec1feaf4efc62990fd8f406f29894c866216c..90aa53fc4f3e40cfb4fadee0e7f72e176ec45265 100644 (file)
@@ -1503,7 +1503,7 @@ zfcp_gid_pn_buffers_alloc(struct zfcp_gid_pn_data **gid_pn, mempool_t *pool)
                        data->ct.pool = pool;
                }
        } 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)
@@ -1531,7 +1531,7 @@ static void zfcp_gid_pn_buffers_free(struct zfcp_gid_pn_data *gid_pn)
        if (gid_pn->ct.pool)
                mempool_free(gid_pn, gid_pn->ct.pool);
        else
-               kfree(gid_pn);
+               kmem_cache_free(zfcp_data.gid_pn_cache, gid_pn);
 }
 
 /**