Commit 994ca9a19616f0d4161a9e825f0835925d522426

Authored by James Bottomley
Committed by Jens Axboe
1 parent f63eb21b4f

[PATCH] update blk_execute_rq to take an at_head parameter

Original From: Mike Christie <michaelc@cs.wisc.edu>

Modified to split out block changes (this patch) and SCSI pieces.

Signed-off-by: Jens Axboe <axboe@suse.de>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>

Showing 5 changed files with 11 additions and 10 deletions Side-by-side Diff

drivers/block/ll_rw_blk.c
... ... @@ -2269,13 +2269,14 @@
2269 2269 * @q: queue to insert the request in
2270 2270 * @bd_disk: matching gendisk
2271 2271 * @rq: request to insert
  2272 + * @at_head: insert request at head or tail of queue
2272 2273 *
2273 2274 * Description:
2274 2275 * Insert a fully prepared request at the back of the io scheduler queue
2275 2276 * for execution.
2276 2277 */
2277 2278 int blk_execute_rq(request_queue_t *q, struct gendisk *bd_disk,
2278   - struct request *rq)
  2279 + struct request *rq, int at_head)
2279 2280 {
2280 2281 DECLARE_COMPLETION(wait);
2281 2282 char sense[SCSI_SENSE_BUFFERSIZE];
... ... @@ -2294,7 +2295,7 @@
2294 2295 }
2295 2296  
2296 2297 rq->waiting = &wait;
2297   - blk_execute_rq_nowait(q, bd_disk, rq, 0, blk_end_sync_rq);
  2298 + blk_execute_rq_nowait(q, bd_disk, rq, at_head, blk_end_sync_rq);
2298 2299 wait_for_completion(&wait);
2299 2300 rq->waiting = NULL;
2300 2301  
... ... @@ -2361,7 +2362,7 @@
2361 2362 rq->data_len = 0;
2362 2363 rq->timeout = 60 * HZ;
2363 2364  
2364   - ret = blk_execute_rq(q, disk, rq);
  2365 + ret = blk_execute_rq(q, disk, rq, 0);
2365 2366  
2366 2367 if (ret && error_sector)
2367 2368 *error_sector = rq->sector;
drivers/block/scsi_ioctl.c
... ... @@ -308,7 +308,7 @@
308 308 * (if he doesn't check that is his problem).
309 309 * N.B. a non-zero SCSI status is _not_ necessarily an error.
310 310 */
311   - blk_execute_rq(q, bd_disk, rq);
  311 + blk_execute_rq(q, bd_disk, rq, 0);
312 312  
313 313 /* write to all output members */
314 314 hdr->status = 0xff & rq->errors;
... ... @@ -420,7 +420,7 @@
420 420 rq->data_len = bytes;
421 421 rq->flags |= REQ_BLOCK_PC;
422 422  
423   - blk_execute_rq(q, bd_disk, rq);
  423 + blk_execute_rq(q, bd_disk, rq, 0);
424 424 err = rq->errors & 0xff; /* only 8 bit SCSI status */
425 425 if (err) {
426 426 if (rq->sense_len && rq->sense) {
... ... @@ -573,7 +573,7 @@
573 573 rq->cmd[0] = GPCMD_START_STOP_UNIT;
574 574 rq->cmd[4] = 0x02 + (close != 0);
575 575 rq->cmd_len = 6;
576   - err = blk_execute_rq(q, bd_disk, rq);
  576 + err = blk_execute_rq(q, bd_disk, rq, 0);
577 577 blk_put_request(rq);
578 578 break;
579 579 default:
drivers/cdrom/cdrom.c
... ... @@ -2136,7 +2136,7 @@
2136 2136 if (rq->bio)
2137 2137 blk_queue_bounce(q, &rq->bio);
2138 2138  
2139   - if (blk_execute_rq(q, cdi->disk, rq)) {
  2139 + if (blk_execute_rq(q, cdi->disk, rq, 0)) {
2140 2140 struct request_sense *s = rq->sense;
2141 2141 ret = -EIO;
2142 2142 cdi->last_sense = s->sense_key;
drivers/ide/ide-disk.c
... ... @@ -750,7 +750,7 @@
750 750  
751 751 idedisk_prepare_flush(q, rq);
752 752  
753   - ret = blk_execute_rq(q, disk, rq);
  753 + ret = blk_execute_rq(q, disk, rq, 0);
754 754  
755 755 /*
756 756 * if we failed and caller wants error offset, get it
include/linux/blkdev.h
... ... @@ -562,8 +562,8 @@
562 562 extern int blk_rq_unmap_user(struct bio *, unsigned int);
563 563 extern int blk_rq_map_kern(request_queue_t *, struct request *, void *, unsigned int, unsigned int);
564 564 extern int blk_rq_map_user_iov(request_queue_t *, struct request *, struct sg_iovec *, int);
565   -extern int blk_execute_rq(request_queue_t *, struct gendisk *, struct request *);
566   -
  565 +extern int blk_execute_rq(request_queue_t *, struct gendisk *,
  566 + struct request *, int);
567 567 static inline request_queue_t *bdev_get_queue(struct block_device *bdev)
568 568 {
569 569 return bdev->bd_disk->queue;