From 5521881e56ca624a71e893cc2972d543f5556dd8 Mon Sep 17 00:00:00 2001 From: Kiyoshi Ueda Date: Mon, 28 Jan 2008 10:36:21 +0100 Subject: [PATCH] --- yaml --- r: 77611 b: refs/heads/master c: 1c5093ba036b5e1a4befdcd6036d241178a720a8 h: refs/heads/master i: 77609: 84d3b6fdfedad7fa2a09a7ef901b5816cf3531e1 77607: 58fbad84a063d0808ff4f166ab5477e613264c98 v: v3 --- [refs] | 2 +- trunk/drivers/block/floppy.c | 16 +++++++--------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/[refs] b/[refs] index 4227664a069d..fba721939e63 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 0156c2547e92df559d5592aad9535838ef459615 +refs/heads/master: 1c5093ba036b5e1a4befdcd6036d241178a720a8 diff --git a/trunk/drivers/block/floppy.c b/trunk/drivers/block/floppy.c index 639ed14bb08d..32c79a55511b 100644 --- a/trunk/drivers/block/floppy.c +++ b/trunk/drivers/block/floppy.c @@ -2287,21 +2287,19 @@ static int do_format(int drive, struct format_descr *tmp_format_req) * ============================= */ -static void floppy_end_request(struct request *req, int uptodate) +static void floppy_end_request(struct request *req, int error) { unsigned int nr_sectors = current_count_sectors; + unsigned int drive = (unsigned long)req->rq_disk->private_data; /* current_count_sectors can be zero if transfer failed */ - if (!uptodate) + if (error) nr_sectors = req->current_nr_sectors; - if (end_that_request_first(req, uptodate, nr_sectors)) + if (__blk_end_request(req, error, nr_sectors << 9)) return; - add_disk_randomness(req->rq_disk); - floppy_off((long)req->rq_disk->private_data); - blkdev_dequeue_request(req); - end_that_request_last(req, uptodate); /* We're done with the request */ + floppy_off(drive); current_req = NULL; } @@ -2332,7 +2330,7 @@ static void request_done(int uptodate) /* unlock chained buffers */ spin_lock_irqsave(q->queue_lock, flags); - floppy_end_request(req, 1); + floppy_end_request(req, 0); spin_unlock_irqrestore(q->queue_lock, flags); } else { if (rq_data_dir(req) == WRITE) { @@ -2346,7 +2344,7 @@ static void request_done(int uptodate) DRWE->last_error_generation = DRS->generation; } spin_lock_irqsave(q->queue_lock, flags); - floppy_end_request(req, 0); + floppy_end_request(req, -EIO); spin_unlock_irqrestore(q->queue_lock, flags); } }