Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

blk_end_request: changing i2o_block (take 4)

This patch converts i2o_block to use blk_end_request interfaces.
Related 'uptodate' arguments are converted to 'error'.

As a result, the interface of internal function, i2o_block_end_request(),
is changed.

Cc: Markus Lidel <Markus.Lidel@shadowconnect.com>
Signed-off-by: Kiyoshi Ueda <k-ueda@ct.jp.nec.com>
Signed-off-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>

authored by

Kiyoshi Ueda and committed by
Jens Axboe
1381b7e8 e935eb9d

+8 -12
+8 -12
drivers/message/i2o/i2o_block.c
··· 412 412 /** 413 413 * i2o_block_end_request - Post-processing of completed commands 414 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 416 * @nr_bytes: number of bytes to complete 417 417 * 418 418 * Mark the request as complete. The lock must not be held when entering. 419 419 * 420 420 */ 421 - static void i2o_block_end_request(struct request *req, int uptodate, 421 + static void i2o_block_end_request(struct request *req, int error, 422 422 int nr_bytes) 423 423 { 424 424 struct i2o_block_request *ireq = req->special; ··· 426 426 struct request_queue *q = req->q; 427 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 430 int leftover = (req->hard_nr_sectors << KERNEL_SECTOR_SHIFT); 431 431 432 432 if (blk_pc_request(req)) 433 433 leftover = req->data_len; 434 434 435 - if (end_io_error(uptodate)) 436 - end_that_request_chunk(req, 0, leftover); 435 + if (error) 436 + blk_end_request(req, -EIO, leftover); 437 437 } 438 438 439 - add_disk_randomness(req->rq_disk); 440 - 441 439 spin_lock_irqsave(q->queue_lock, flags); 442 - 443 - end_that_request_last(req, uptodate); 444 440 445 441 if (likely(dev)) { 446 442 dev->open_queue_depth--; ··· 464 468 struct i2o_message *msg) 465 469 { 466 470 struct request *req; 467 - int uptodate = 1; 471 + int error = 0; 468 472 469 473 req = i2o_cntxt_list_get(c, le32_to_cpu(msg->u.s.tcntxt)); 470 474 if (unlikely(!req)) { ··· 497 501 498 502 req->errors++; 499 503 500 - uptodate = 0; 504 + error = -EIO; 501 505 } 502 506 503 - i2o_block_end_request(req, uptodate, le32_to_cpu(msg->body[1])); 507 + i2o_block_end_request(req, error, le32_to_cpu(msg->body[1])); 504 508 505 509 return 1; 506 510 };