diff options
author | Kiyoshi Ueda <k-ueda@ct.jp.nec.com> | 2007-12-11 17:44:06 -0500 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2008-01-28 04:36:37 -0500 |
commit | 097c94a4e8bde978c8d12683d9a34048e9139e4b (patch) | |
tree | 1a90401134c5543dd78135f372842c9f5b232b58 /drivers/block/nbd.c | |
parent | 1c5093ba036b5e1a4befdcd6036d241178a720a8 (diff) |
blk_end_request: changing nbd (take 4)
This patch converts nbd to use blk_end_request interfaces.
Related 'uptodate' arguments are converted to 'error'.
Cc: Paul Clements <Paul.Clements@steeleye.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>
Diffstat (limited to 'drivers/block/nbd.c')
-rw-r--r-- | drivers/block/nbd.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c index ba9b17e507e0..ae3106045ee5 100644 --- a/drivers/block/nbd.c +++ b/drivers/block/nbd.c | |||
@@ -100,17 +100,15 @@ static const char *nbdcmd_to_ascii(int cmd) | |||
100 | 100 | ||
101 | static void nbd_end_request(struct request *req) | 101 | static void nbd_end_request(struct request *req) |
102 | { | 102 | { |
103 | int uptodate = (req->errors == 0) ? 1 : 0; | 103 | int error = req->errors ? -EIO : 0; |
104 | struct request_queue *q = req->q; | 104 | struct request_queue *q = req->q; |
105 | unsigned long flags; | 105 | unsigned long flags; |
106 | 106 | ||
107 | dprintk(DBG_BLKDEV, "%s: request %p: %s\n", req->rq_disk->disk_name, | 107 | dprintk(DBG_BLKDEV, "%s: request %p: %s\n", req->rq_disk->disk_name, |
108 | req, uptodate? "done": "failed"); | 108 | req, error ? "failed" : "done"); |
109 | 109 | ||
110 | spin_lock_irqsave(q->queue_lock, flags); | 110 | spin_lock_irqsave(q->queue_lock, flags); |
111 | if (!end_that_request_first(req, uptodate, req->nr_sectors)) { | 111 | __blk_end_request(req, error, req->nr_sectors << 9); |
112 | end_that_request_last(req, uptodate); | ||
113 | } | ||
114 | spin_unlock_irqrestore(q->queue_lock, flags); | 112 | spin_unlock_irqrestore(q->queue_lock, flags); |
115 | } | 113 | } |
116 | 114 | ||