Commit 1c5093ba036b5e1a4befdcd6036d241178a720a8
Committed by
Jens Axboe
1 parent
0156c2547e
blk_end_request: changing floppy (take 4)
This patch converts floppy to use blk_end_request interfaces. Related 'uptodate' arguments are converted to 'error'. As a result, the interface of internal function, floppy_end_request(), is changed. 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>
Showing 1 changed file with 7 additions and 9 deletions Side-by-side Diff
drivers/block/floppy.c
... | ... | @@ -2287,21 +2287,19 @@ |
2287 | 2287 | * ============================= |
2288 | 2288 | */ |
2289 | 2289 | |
2290 | -static void floppy_end_request(struct request *req, int uptodate) | |
2290 | +static void floppy_end_request(struct request *req, int error) | |
2291 | 2291 | { |
2292 | 2292 | unsigned int nr_sectors = current_count_sectors; |
2293 | + unsigned int drive = (unsigned long)req->rq_disk->private_data; | |
2293 | 2294 | |
2294 | 2295 | /* current_count_sectors can be zero if transfer failed */ |
2295 | - if (!uptodate) | |
2296 | + if (error) | |
2296 | 2297 | nr_sectors = req->current_nr_sectors; |
2297 | - if (end_that_request_first(req, uptodate, nr_sectors)) | |
2298 | + if (__blk_end_request(req, error, nr_sectors << 9)) | |
2298 | 2299 | return; |
2299 | - add_disk_randomness(req->rq_disk); | |
2300 | - floppy_off((long)req->rq_disk->private_data); | |
2301 | - blkdev_dequeue_request(req); | |
2302 | - end_that_request_last(req, uptodate); | |
2303 | 2300 | |
2304 | 2301 | /* We're done with the request */ |
2302 | + floppy_off(drive); | |
2305 | 2303 | current_req = NULL; |
2306 | 2304 | } |
2307 | 2305 | |
... | ... | @@ -2332,7 +2330,7 @@ |
2332 | 2330 | |
2333 | 2331 | /* unlock chained buffers */ |
2334 | 2332 | spin_lock_irqsave(q->queue_lock, flags); |
2335 | - floppy_end_request(req, 1); | |
2333 | + floppy_end_request(req, 0); | |
2336 | 2334 | spin_unlock_irqrestore(q->queue_lock, flags); |
2337 | 2335 | } else { |
2338 | 2336 | if (rq_data_dir(req) == WRITE) { |
... | ... | @@ -2346,7 +2344,7 @@ |
2346 | 2344 | DRWE->last_error_generation = DRS->generation; |
2347 | 2345 | } |
2348 | 2346 | spin_lock_irqsave(q->queue_lock, flags); |
2349 | - floppy_end_request(req, 0); | |
2347 | + floppy_end_request(req, -EIO); | |
2350 | 2348 | spin_unlock_irqrestore(q->queue_lock, flags); |
2351 | 2349 | } |
2352 | 2350 | } |