This should already work, since Oct 24. Your i2o_block_request_alloc()
should look like this:
static inline struct i2o_block_request *i2o_block_request_alloc(void)
{
struct i2o_block_request *ireq;
ireq = mempool_alloc(i2o_blk_req_pool.pool, GFP_ATOMIC);
if (!ireq)
return ERR_PTR(-ENOMEM);
INIT_LIST_HEAD(&ireq->queue);
sg_init_table(ireq->sg_table, I2O_MAX_PHYS_SEGMENTS);
return ireq;
}
Note that I also don't like your solution, no need to change this to be
a constructor setup and you definitely should not guard sg_init_table()
with CONFIG_DEBUG_SG. It needs to be done always.
--
Jens Axboe
-