/* Returns 0 on failure or 1 on success.  */
static int i2o_block_sglist_alloc(struct i2o_controller *c, struct i2o_block_request *ireq, u32 **mptr)
/* Returns 0 on failure or 1 on success.  */
static int i2o_block_sglist_alloc(struct i2o_controller *c, struct i2o_block_request *ireq, u32 **mptr)
{
	int nents;
	enum dma_data_direction direction;
	ireq->dev = &c->pdev->dev;
	nents = blk_rq_map_sg(ireq->req->q, ireq->req, ireq->sg_table);
	if (rq_data_dir(ireq->req) == READ)
		direction = PCI_DMA_FROMDEVICE;
	else
		direction = PCI_DMA_TODEVICE;
	ireq->sg_nents = nents;
	return i2o_dma_map_sg(c, ireq->sg_table, nents, direction, mptr);
}