X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fmessage%2Fi2o%2Fi2o_block.c;h=81483de8c0fdfeae0262dc745a1147ca5c28f966;hb=666484f0250db2e016948d63b3ef33e202e3b8d0;hp=682406168de9fca39e8581cdaca638019c9ad5da;hpb=37e58df30063e229ee5157f9d1c1fa1d749917c2;p=linux-2.6-omap-h63xx.git diff --git a/drivers/message/i2o/i2o_block.c b/drivers/message/i2o/i2o_block.c index 682406168de..81483de8c0f 100644 --- a/drivers/message/i2o/i2o_block.c +++ b/drivers/message/i2o/i2o_block.c @@ -371,7 +371,7 @@ static int i2o_block_prep_req_fn(struct request_queue *q, struct request *req) /* connect the i2o_block_request to the request */ if (!req->special) { ireq = i2o_block_request_alloc(); - if (unlikely(IS_ERR(ireq))) { + if (IS_ERR(ireq)) { osm_debug("unable to allocate i2o_block_request!\n"); return BLKPREP_DEFER; } @@ -412,13 +412,13 @@ static void i2o_block_delayed_request_fn(struct work_struct *work) /** * i2o_block_end_request - Post-processing of completed commands * @req: request which should be completed - * @uptodate: 1 for success, 0 for I/O error, < 0 for specific error + * @error: 0 for success, < 0 for error * @nr_bytes: number of bytes to complete * * Mark the request as complete. The lock must not be held when entering. * */ -static void i2o_block_end_request(struct request *req, int uptodate, +static void i2o_block_end_request(struct request *req, int error, int nr_bytes) { struct i2o_block_request *ireq = req->special; @@ -426,22 +426,18 @@ static void i2o_block_end_request(struct request *req, int uptodate, struct request_queue *q = req->q; unsigned long flags; - if (end_that_request_chunk(req, uptodate, nr_bytes)) { + if (blk_end_request(req, error, nr_bytes)) { int leftover = (req->hard_nr_sectors << KERNEL_SECTOR_SHIFT); if (blk_pc_request(req)) leftover = req->data_len; - if (end_io_error(uptodate)) - end_that_request_chunk(req, 0, leftover); + if (error) + blk_end_request(req, -EIO, leftover); } - add_disk_randomness(req->rq_disk); - spin_lock_irqsave(q->queue_lock, flags); - end_that_request_last(req, uptodate); - if (likely(dev)) { dev->open_queue_depth--; list_del(&ireq->queue); @@ -468,7 +464,7 @@ static int i2o_block_reply(struct i2o_controller *c, u32 m, struct i2o_message *msg) { struct request *req; - int uptodate = 1; + int error = 0; req = i2o_cntxt_list_get(c, le32_to_cpu(msg->u.s.tcntxt)); if (unlikely(!req)) { @@ -501,10 +497,10 @@ static int i2o_block_reply(struct i2o_controller *c, u32 m, req->errors++; - uptodate = 0; + error = -EIO; } - i2o_block_end_request(req, uptodate, le32_to_cpu(msg->body[1])); + i2o_block_end_request(req, error, le32_to_cpu(msg->body[1])); return 1; }; @@ -1077,8 +1073,8 @@ static int i2o_block_probe(struct device *dev) blk_queue_max_sectors(queue, max_sectors); blk_queue_max_hw_segments(queue, i2o_sg_tablesize(c, body_size)); - osm_debug("max sectors = %d\n", queue->max_phys_segments); - osm_debug("phys segments = %d\n", queue->max_sectors); + osm_debug("max sectors = %d\n", queue->max_sectors); + osm_debug("phys segments = %d\n", queue->max_phys_segments); osm_debug("max hw segments = %d\n", queue->max_hw_segments); /*