提交 142e301f 编写于 作者: M Mike Christie 提交者:

[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: NMike Anderson <andmike@us.ibm.com>
Signed-off-by: NMike Christie <michaelc@cs.wisc.edu>
Signed-off-by: NAlex Aizman <itn780@yahoo.com>
Signed-off-by: NDmitry Yusupov <dmitry_yus@yahoo.com>
Signed-off-by: NJames Bottomley <James.Bottomley@SteelEye.com>
上级 5b940adf
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册