Skip to contentSkip to conversation

zfcp: allocate gid_pn_data objects from gid_pn_cache.

PATCH New Swen Schillig 1 participant 1 message Aug 28, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 2/10 zfcp: allocate gid_pn_data objects from gid_pn_cache.

From: Heiko Carstens <[email protected]>

Allocate gid_pn_data objects from the corresponding cache which ensures proper alignment.

---

 drivers/s390/scsi/zfcp_aux.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/s390/scsi/zfcp_aux.c +2 -2
diff -urpN linux-2.6/drivers/s390/scsi/zfcp_aux.c linux-2.6-patched/drivers/s390/scsi/zfcp_aux.c
@@ -1503,7 +1503,7 @@ zfcp_gid_pn_buffers_alloc(struct zfcp_gi
 			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(str
 	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);
 }
 
 /**