1
0
Fork 0

[SCSI] iscsi update: setup pool before using

>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>
hifive-unleashed-5.1
Mike Christie 2006-02-01 21:06:58 -06:00 committed by
parent 5b940adf5b
commit 142e301fc8
1 changed files with 6 additions and 7 deletions

View 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;
}