aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/message
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/message')
-rw-r--r--drivers/message/i2o/i2o_block.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/drivers/message/i2o/i2o_block.c b/drivers/message/i2o/i2o_block.c
index e4ad7a1c4fbd..a95314897402 100644
--- a/drivers/message/i2o/i2o_block.c
+++ b/drivers/message/i2o/i2o_block.c
@@ -412,13 +412,13 @@ static void i2o_block_delayed_request_fn(struct work_struct *work)
412/** 412/**
413 * i2o_block_end_request - Post-processing of completed commands 413 * i2o_block_end_request - Post-processing of completed commands
414 * @req: request which should be completed 414 * @req: request which should be completed
415 * @uptodate: 1 for success, 0 for I/O error, < 0 for specific error 415 * @error: 0 for success, < 0 for error
416 * @nr_bytes: number of bytes to complete 416 * @nr_bytes: number of bytes to complete
417 * 417 *
418 * Mark the request as complete. The lock must not be held when entering. 418 * Mark the request as complete. The lock must not be held when entering.
419 * 419 *
420 */ 420 */
421static void i2o_block_end_request(struct request *req, int uptodate, 421static void i2o_block_end_request(struct request *req, int error,
422 int nr_bytes) 422 int nr_bytes)
423{ 423{
424 struct i2o_block_request *ireq = req->special; 424 struct i2o_block_request *ireq = req->special;
@@ -426,22 +426,18 @@ static void i2o_block_end_request(struct request *req, int uptodate,
426 struct request_queue *q = req->q; 426 struct request_queue *q = req->q;
427 unsigned long flags; 427 unsigned long flags;
428 428
429 if (end_that_request_chunk(req, uptodate, nr_bytes)) { 429 if (blk_end_request(req, error, nr_bytes)) {
430 int leftover = (req->hard_nr_sectors << KERNEL_SECTOR_SHIFT); 430 int leftover = (req->hard_nr_sectors << KERNEL_SECTOR_SHIFT);
431 431
432 if (blk_pc_request(req)) 432 if (blk_pc_request(req))
433 leftover = req->data_len; 433 leftover = req->data_len;
434 434
435 if (end_io_error(uptodate)) 435 if (error)
436 end_that_request_chunk(req, 0, leftover); 436 blk_end_request(req, -EIO, leftover);
437 } 437 }
438 438
439 add_disk_randomness(req->rq_disk);
440
441 spin_lock_irqsave(q->queue_lock, flags); 439 spin_lock_irqsave(q->queue_lock, flags);
442 440
443 end_that_request_last(req, uptodate);
444
445 if (likely(dev)) { 441 if (likely(dev)) {
446 dev->open_queue_depth--; 442 dev->open_queue_depth--;
447 list_del(&ireq->queue); 443 list_del(&ireq->queue);
@@ -468,7 +464,7 @@ static int i2o_block_reply(struct i2o_controller *c, u32 m,
468 struct i2o_message *msg) 464 struct i2o_message *msg)
469{ 465{
470 struct request *req; 466 struct request *req;
471 int uptodate = 1; 467 int error = 0;
472 468
473 req = i2o_cntxt_list_get(c, le32_to_cpu(msg->u.s.tcntxt)); 469 req = i2o_cntxt_list_get(c, le32_to_cpu(msg->u.s.tcntxt));
474 if (unlikely(!req)) { 470 if (unlikely(!req)) {
@@ -501,10 +497,10 @@ static int i2o_block_reply(struct i2o_controller *c, u32 m,
501 497
502 req->errors++; 498 req->errors++;
503 499
504 uptodate = 0; 500 error = -EIO;
505 } 501 }
506 502
507 i2o_block_end_request(req, uptodate, le32_to_cpu(msg->body[1])); 503 i2o_block_end_request(req, error, le32_to_cpu(msg->body[1]));
508 504
509 return 1; 505 return 1;
510}; 506};