Skip to content

Commit

Permalink
ps3disk: dequeue in-flight request
Browse files Browse the repository at this point in the history
Other than in issue error paths, ps3disk always completely finishes
fetched requests.  With full completion on error paths, it can be
easily converted to dequeueing model.

* After L1 r/w call failure, ps3disk_submit_request_sg() now fails the
  whole request.  Issue failure isn't likely to benefit from partial
  retry anyway and ps3disk uses full failure in completion error path
  too, so I don't think this amounts to any meaningful functionality
  loss.

* flush completion is converted to _all for consistency.  It doesn't
  make any functional difference.

[ Impact: dequeue in-flight request ]

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
  • Loading branch information
Tejun Heo authored and Jens Axboe committed May 11, 2009
1 parent b12d4f8 commit 10e1e62
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions drivers/block/ps3disk.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ static int ps3disk_submit_request_sg(struct ps3_storage_device *dev,
if (res) {
dev_err(&dev->sbd.core, "%s:%u: %s failed %d\n", __func__,
__LINE__, op, res);
__blk_end_request_cur(req, -EIO);
__blk_end_request_all(req, -EIO);
return 0;
}

Expand All @@ -179,7 +179,7 @@ static int ps3disk_submit_flush_request(struct ps3_storage_device *dev,
if (res) {
dev_err(&dev->sbd.core, "%s:%u: sync cache failed 0x%llx\n",
__func__, __LINE__, res);
__blk_end_request_cur(req, -EIO);
__blk_end_request_all(req, -EIO);
return 0;
}

Expand All @@ -195,6 +195,8 @@ static void ps3disk_do_request(struct ps3_storage_device *dev,
dev_dbg(&dev->sbd.core, "%s:%u\n", __func__, __LINE__);

while ((req = elv_next_request(q))) {
blkdev_dequeue_request(req);

if (blk_fs_request(req)) {
if (ps3disk_submit_request_sg(dev, req))
break;
Expand All @@ -204,7 +206,7 @@ static void ps3disk_do_request(struct ps3_storage_device *dev,
break;
} else {
blk_dump_rq_flags(req, DEVICE_NAME " bad request");
__blk_end_request_cur(req, -EIO);
__blk_end_request_all(req, -EIO);
continue;
}
}
Expand Down

0 comments on commit 10e1e62

Please sign in to comment.