Skip to contentSkip to conversation

iscsi update: setup pool before using

PATCH New Mike Christie 1 participant 1 message Feb 2, 2006

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

PATCH 3/9 iscsi update: setup pool before using

Quoted 1 line

From [email protected]:

Ensure that pool data is setup prior to calling mempool_create as it will call the the alloc function during create.

drivers/scsi/scsi_transport_iscsi.c +6 -7
index 79ca29e..448fd78 100644
@@ -530,6 +530,12 @@ mempool_zone_init(unsigned max, unsigned
 	if (!zp)
 		return NULL;
 
+	zp->size = size;
+	zp->hiwat = hiwat;
+	INIT_LIST_HEAD(&zp->freequeue);
+	spin_lock_init(&zp->freelock);
+	atomic_set(&zp->allocated, 0);
+
 	zp->pool = mempool_create(max, mempool_zone_alloc_skb,
 				  mempool_zone_free_skb, zp);
 	if (!zp->pool) {
@@ -537,13 +543,6 @@ mempool_zone_init(unsigned max, unsigned
 		return NULL;
 	}
 
-	zp->size = size;
-	zp->hiwat = hiwat;
-
-	INIT_LIST_HEAD(&zp->freequeue);
-	spin_lock_init(&zp->freelock);
-	atomic_set(&zp->allocated, 0);
-
 	return zp;
 }