]> err.no Git - linux-2.6/commitdiff
[SCSI] iscsi update: setup pool before using
authorMike Christie <michaelc@cs.wisc.edu>
Thu, 2 Feb 2006 03:06:58 +0000 (21:06 -0600)
committer <jejb@mulgrave.il.steeleye.com> <>
Sat, 4 Feb 2006 22:18:27 +0000 (16:18 -0600)
>From andmike@us.ibm.com:

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

Signed-off-by: Mike Anderson <andmike@us.ibm.com>
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: Alex Aizman <itn780@yahoo.com>
Signed-off-by: Dmitry Yusupov <dmitry_yus@yahoo.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
drivers/scsi/scsi_transport_iscsi.c

index 79ca29ee1aee7ab36e265ecf8a18b80f8d0a9ee5..448fd78777f9dfac54e3c15ee2d12f7e4c29c8a8 100644 (file)
@@ -530,6 +530,12 @@ mempool_zone_init(unsigned max, unsigned size, unsigned hiwat)
        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 size, unsigned hiwat)
                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;
 }