Skip to content

Commit

Permalink
[SCSI] iscsi update: setup pool before using
Browse files Browse the repository at this point in the history
>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>
  • Loading branch information
Mike Christie authored and Unknown committed Feb 4, 2006
1 parent 5b940ad commit 142e301
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions drivers/scsi/scsi_transport_iscsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -530,20 +530,19 @@ 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) {
kfree(zp);
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;
}

Expand Down

0 comments on commit 142e301

Please sign in to comment.