Commit c00895ab2f08df7044e58ee01c38bf0a661ea0eb
1 parent
8a8e674cb1
[PATCH] Remove ->waiting member from struct request
As the comments indicates in blkdev.h, we can fold it into ->end_io_data usage as that is really what ->waiting is. Fixup the users of blk_end_sync_rq(). Signed-off-by: Jens Axboe <axboe@kernel.dk>
Showing 9 changed files with 20 additions and 25 deletions Side-by-side Diff
block/elevator.c
block/ll_rw_blk.c
... | ... | @@ -291,7 +291,6 @@ |
291 | 291 | rq->buffer = NULL; |
292 | 292 | rq->ref_count = 1; |
293 | 293 | rq->q = q; |
294 | - rq->waiting = NULL; | |
295 | 294 | rq->special = NULL; |
296 | 295 | rq->data_len = 0; |
297 | 296 | rq->data = NULL; |
... | ... | @@ -451,6 +450,7 @@ |
451 | 450 | rq->cmd_flags = REQ_HARDBARRIER; |
452 | 451 | rq_init(q, rq); |
453 | 452 | rq->elevator_private = NULL; |
453 | + rq->elevator_private2 = NULL; | |
454 | 454 | rq->rq_disk = q->bar_rq.rq_disk; |
455 | 455 | rq->rl = NULL; |
456 | 456 | rq->end_io = end_io; |
... | ... | @@ -479,6 +479,7 @@ |
479 | 479 | rq->cmd_flags |= REQ_RW; |
480 | 480 | rq->cmd_flags |= q->ordered & QUEUE_ORDERED_FUA ? REQ_FUA : 0; |
481 | 481 | rq->elevator_private = NULL; |
482 | + rq->elevator_private2 = NULL; | |
482 | 483 | rq->rl = NULL; |
483 | 484 | init_request_from_bio(rq, q->orig_bar_rq->bio); |
484 | 485 | rq->end_io = bar_end_io; |
485 | 486 | |
... | ... | @@ -2569,10 +2570,9 @@ |
2569 | 2570 | rq->sense_len = 0; |
2570 | 2571 | } |
2571 | 2572 | |
2572 | - rq->waiting = &wait; | |
2573 | + rq->end_io_data = &wait; | |
2573 | 2574 | blk_execute_rq_nowait(q, bd_disk, rq, at_head, blk_end_sync_rq); |
2574 | 2575 | wait_for_completion(&wait); |
2575 | - rq->waiting = NULL; | |
2576 | 2576 | |
2577 | 2577 | if (rq->errors) |
2578 | 2578 | err = -EIO; |
2579 | 2579 | |
... | ... | @@ -2736,9 +2736,9 @@ |
2736 | 2736 | */ |
2737 | 2737 | void blk_end_sync_rq(struct request *rq, int error) |
2738 | 2738 | { |
2739 | - struct completion *waiting = rq->waiting; | |
2739 | + struct completion *waiting = rq->end_io_data; | |
2740 | 2740 | |
2741 | - rq->waiting = NULL; | |
2741 | + rq->end_io_data = NULL; | |
2742 | 2742 | __blk_put_request(rq->q, rq); |
2743 | 2743 | |
2744 | 2744 | /* |
... | ... | @@ -2801,7 +2801,7 @@ |
2801 | 2801 | |
2802 | 2802 | if (rq_data_dir(req) != rq_data_dir(next) |
2803 | 2803 | || req->rq_disk != next->rq_disk |
2804 | - || next->waiting || next->special) | |
2804 | + || next->special) | |
2805 | 2805 | return 0; |
2806 | 2806 | |
2807 | 2807 | /* |
... | ... | @@ -2886,7 +2886,6 @@ |
2886 | 2886 | req->nr_phys_segments = bio_phys_segments(req->q, bio); |
2887 | 2887 | req->nr_hw_segments = bio_hw_segments(req->q, bio); |
2888 | 2888 | req->buffer = bio_data(bio); /* see ->buffer comment above */ |
2889 | - req->waiting = NULL; | |
2890 | 2889 | req->bio = req->biotail = bio; |
2891 | 2890 | req->ioprio = bio_prio(bio); |
2892 | 2891 | req->rq_disk = bio->bi_bdev->bd_disk; |
drivers/block/DAC960.c
... | ... | @@ -3331,7 +3331,7 @@ |
3331 | 3331 | Command->DmaDirection = PCI_DMA_TODEVICE; |
3332 | 3332 | Command->CommandType = DAC960_WriteCommand; |
3333 | 3333 | } |
3334 | - Command->Completion = Request->waiting; | |
3334 | + Command->Completion = Request->end_io_data; | |
3335 | 3335 | Command->LogicalDriveNumber = (long)Request->rq_disk->private_data; |
3336 | 3336 | Command->BlockNumber = Request->sector; |
3337 | 3337 | Command->BlockCount = Request->nr_sectors; |
drivers/block/paride/pd.c
... | ... | @@ -722,11 +722,10 @@ |
722 | 722 | rq.rq_status = RQ_ACTIVE; |
723 | 723 | rq.rq_disk = disk->gd; |
724 | 724 | rq.ref_count = 1; |
725 | - rq.waiting = &wait; | |
725 | + rq.end_io_data = &wait; | |
726 | 726 | rq.end_io = blk_end_sync_rq; |
727 | 727 | blk_insert_request(disk->gd->queue, &rq, 0, func); |
728 | 728 | wait_for_completion(&wait); |
729 | - rq.waiting = NULL; | |
730 | 729 | if (rq.errors) |
731 | 730 | err = -EIO; |
732 | 731 | blk_put_request(&rq); |
drivers/block/pktcdvd.c
drivers/ide/ide-io.c
... | ... | @@ -141,7 +141,7 @@ |
141 | 141 | |
142 | 142 | static void ide_complete_power_step(ide_drive_t *drive, struct request *rq, u8 stat, u8 error) |
143 | 143 | { |
144 | - struct request_pm_state *pm = rq->end_io_data; | |
144 | + struct request_pm_state *pm = rq->data; | |
145 | 145 | |
146 | 146 | if (drive->media != ide_disk) |
147 | 147 | return; |
... | ... | @@ -164,7 +164,7 @@ |
164 | 164 | |
165 | 165 | static ide_startstop_t ide_start_power_step(ide_drive_t *drive, struct request *rq) |
166 | 166 | { |
167 | - struct request_pm_state *pm = rq->end_io_data; | |
167 | + struct request_pm_state *pm = rq->data; | |
168 | 168 | ide_task_t *args = rq->special; |
169 | 169 | |
170 | 170 | memset(args, 0, sizeof(*args)); |
... | ... | @@ -421,7 +421,7 @@ |
421 | 421 | } |
422 | 422 | } |
423 | 423 | } else if (blk_pm_request(rq)) { |
424 | - struct request_pm_state *pm = rq->end_io_data; | |
424 | + struct request_pm_state *pm = rq->data; | |
425 | 425 | #ifdef DEBUG_PM |
426 | 426 | printk("%s: complete_power_step(step: %d, stat: %x, err: %x)\n", |
427 | 427 | drive->name, rq->pm->pm_step, stat, err); |
... | ... | @@ -933,7 +933,7 @@ |
933 | 933 | |
934 | 934 | static void ide_check_pm_state(ide_drive_t *drive, struct request *rq) |
935 | 935 | { |
936 | - struct request_pm_state *pm = rq->end_io_data; | |
936 | + struct request_pm_state *pm = rq->data; | |
937 | 937 | |
938 | 938 | if (blk_pm_suspend_request(rq) && |
939 | 939 | pm->pm_step == ide_pm_state_start_suspend) |
... | ... | @@ -1018,7 +1018,7 @@ |
1018 | 1018 | rq->cmd_type == REQ_TYPE_ATA_TASKFILE) |
1019 | 1019 | return execute_drive_cmd(drive, rq); |
1020 | 1020 | else if (blk_pm_request(rq)) { |
1021 | - struct request_pm_state *pm = rq->end_io_data; | |
1021 | + struct request_pm_state *pm = rq->data; | |
1022 | 1022 | #ifdef DEBUG_PM |
1023 | 1023 | printk("%s: start_power_step(step: %d)\n", |
1024 | 1024 | drive->name, rq->pm->pm_step); |
... | ... | @@ -1718,7 +1718,7 @@ |
1718 | 1718 | */ |
1719 | 1719 | if (must_wait) { |
1720 | 1720 | rq->ref_count++; |
1721 | - rq->waiting = &wait; | |
1721 | + rq->end_io_data = &wait; | |
1722 | 1722 | rq->end_io = blk_end_sync_rq; |
1723 | 1723 | } |
1724 | 1724 | |
... | ... | @@ -1736,7 +1736,6 @@ |
1736 | 1736 | err = 0; |
1737 | 1737 | if (must_wait) { |
1738 | 1738 | wait_for_completion(&wait); |
1739 | - rq->waiting = NULL; | |
1740 | 1739 | if (rq->errors) |
1741 | 1740 | err = -EIO; |
1742 | 1741 |
drivers/ide/ide-tape.c
drivers/ide/ide.c
... | ... | @@ -1219,7 +1219,7 @@ |
1219 | 1219 | memset(&args, 0, sizeof(args)); |
1220 | 1220 | rq.cmd_type = REQ_TYPE_PM_SUSPEND; |
1221 | 1221 | rq.special = &args; |
1222 | - rq.end_io_data = &rqpm; | |
1222 | + rq.data = &rqpm; | |
1223 | 1223 | rqpm.pm_step = ide_pm_state_start_suspend; |
1224 | 1224 | if (mesg.event == PM_EVENT_PRETHAW) |
1225 | 1225 | mesg.event = PM_EVENT_FREEZE; |
... | ... | @@ -1240,7 +1240,7 @@ |
1240 | 1240 | memset(&args, 0, sizeof(args)); |
1241 | 1241 | rq.cmd_type = REQ_TYPE_PM_RESUME; |
1242 | 1242 | rq.special = &args; |
1243 | - rq.end_io_data = &rqpm; | |
1243 | + rq.data = &rqpm; | |
1244 | 1244 | rqpm.pm_step = ide_pm_state_start_resume; |
1245 | 1245 | rqpm.pm_state = PM_EVENT_ON; |
1246 | 1246 |
include/linux/blkdev.h
... | ... | @@ -266,7 +266,6 @@ |
266 | 266 | request_queue_t *q; |
267 | 267 | struct request_list *rl; |
268 | 268 | |
269 | - struct completion *waiting; | |
270 | 269 | void *special; |
271 | 270 | char *buffer; |
272 | 271 | |
... | ... | @@ -285,7 +284,7 @@ |
285 | 284 | int retries; |
286 | 285 | |
287 | 286 | /* |
288 | - * completion callback. end_io_data should be folded in with waiting | |
287 | + * completion callback. | |
289 | 288 | */ |
290 | 289 | rq_end_io_fn *end_io; |
291 | 290 | void *end_io_data; |