aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2006-09-30 14:29:12 -0400
committerJens Axboe <axboe@kernel.dk>2006-09-30 14:29:12 -0400
commitc00895ab2f08df7044e58ee01c38bf0a661ea0eb (patch)
tree95dee4eb76042087c4b8d43a5841b6bae85b8cf3
parent8a8e674cb1dafc818ffea93d97e4c1c1f01fdbb6 (diff)
[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>
-rw-r--r--block/elevator.c3
-rw-r--r--block/ll_rw_blk.c13
-rw-r--r--drivers/block/DAC960.c2
-rw-r--r--drivers/block/paride/pd.c3
-rw-r--r--drivers/block/pktcdvd.c2
-rw-r--r--drivers/ide/ide-io.c13
-rw-r--r--drivers/ide/ide-tape.c2
-rw-r--r--drivers/ide/ide.c4
-rw-r--r--include/linux/blkdev.h3
9 files changed, 20 insertions, 25 deletions
diff --git a/block/elevator.c b/block/elevator.c
index cbbc36ba016a..924b81b08f86 100644
--- a/block/elevator.c
+++ b/block/elevator.c
@@ -67,8 +67,7 @@ inline int elv_rq_merge_ok(struct request *rq, struct bio *bio)
67 /* 67 /*
68 * same device and no special stuff set, merge is ok 68 * same device and no special stuff set, merge is ok
69 */ 69 */
70 if (rq->rq_disk == bio->bi_bdev->bd_disk && 70 if (rq->rq_disk == bio->bi_bdev->bd_disk && !rq->special)
71 !rq->waiting && !rq->special)
72 return 1; 71 return 1;
73 72
74 return 0; 73 return 0;
diff --git a/block/ll_rw_blk.c b/block/ll_rw_blk.c
index d388486e98bb..3b6aad2affd8 100644
--- a/block/ll_rw_blk.c
+++ b/block/ll_rw_blk.c
@@ -291,7 +291,6 @@ static inline void rq_init(request_queue_t *q, struct request *rq)
291 rq->buffer = NULL; 291 rq->buffer = NULL;
292 rq->ref_count = 1; 292 rq->ref_count = 1;
293 rq->q = q; 293 rq->q = q;
294 rq->waiting = NULL;
295 rq->special = NULL; 294 rq->special = NULL;
296 rq->data_len = 0; 295 rq->data_len = 0;
297 rq->data = NULL; 296 rq->data = NULL;
@@ -451,6 +450,7 @@ static void queue_flush(request_queue_t *q, unsigned which)
451 rq->cmd_flags = REQ_HARDBARRIER; 450 rq->cmd_flags = REQ_HARDBARRIER;
452 rq_init(q, rq); 451 rq_init(q, rq);
453 rq->elevator_private = NULL; 452 rq->elevator_private = NULL;
453 rq->elevator_private2 = NULL;
454 rq->rq_disk = q->bar_rq.rq_disk; 454 rq->rq_disk = q->bar_rq.rq_disk;
455 rq->rl = NULL; 455 rq->rl = NULL;
456 rq->end_io = end_io; 456 rq->end_io = end_io;
@@ -479,6 +479,7 @@ static inline struct request *start_ordered(request_queue_t *q,
479 rq->cmd_flags |= REQ_RW; 479 rq->cmd_flags |= REQ_RW;
480 rq->cmd_flags |= q->ordered & QUEUE_ORDERED_FUA ? REQ_FUA : 0; 480 rq->cmd_flags |= q->ordered & QUEUE_ORDERED_FUA ? REQ_FUA : 0;
481 rq->elevator_private = NULL; 481 rq->elevator_private = NULL;
482 rq->elevator_private2 = NULL;
482 rq->rl = NULL; 483 rq->rl = NULL;
483 init_request_from_bio(rq, q->orig_bar_rq->bio); 484 init_request_from_bio(rq, q->orig_bar_rq->bio);
484 rq->end_io = bar_end_io; 485 rq->end_io = bar_end_io;
@@ -2569,10 +2570,9 @@ int blk_execute_rq(request_queue_t *q, struct gendisk *bd_disk,
2569 rq->sense_len = 0; 2570 rq->sense_len = 0;
2570 } 2571 }
2571 2572
2572 rq->waiting = &wait; 2573 rq->end_io_data = &wait;
2573 blk_execute_rq_nowait(q, bd_disk, rq, at_head, blk_end_sync_rq); 2574 blk_execute_rq_nowait(q, bd_disk, rq, at_head, blk_end_sync_rq);
2574 wait_for_completion(&wait); 2575 wait_for_completion(&wait);
2575 rq->waiting = NULL;
2576 2576
2577 if (rq->errors) 2577 if (rq->errors)
2578 err = -EIO; 2578 err = -EIO;
@@ -2736,9 +2736,9 @@ EXPORT_SYMBOL(blk_put_request);
2736 */ 2736 */
2737void blk_end_sync_rq(struct request *rq, int error) 2737void 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 __blk_put_request(rq->q, rq); 2742 __blk_put_request(rq->q, rq);
2743 2743
2744 /* 2744 /*
@@ -2801,7 +2801,7 @@ static int attempt_merge(request_queue_t *q, struct request *req,
2801 2801
2802 if (rq_data_dir(req) != rq_data_dir(next) 2802 if (rq_data_dir(req) != rq_data_dir(next)
2803 || req->rq_disk != next->rq_disk 2803 || req->rq_disk != next->rq_disk
2804 || next->waiting || next->special) 2804 || next->special)
2805 return 0; 2805 return 0;
2806 2806
2807 /* 2807 /*
@@ -2886,7 +2886,6 @@ static void init_request_from_bio(struct request *req, struct bio *bio)
2886 req->nr_phys_segments = bio_phys_segments(req->q, bio); 2886 req->nr_phys_segments = bio_phys_segments(req->q, bio);
2887 req->nr_hw_segments = bio_hw_segments(req->q, bio); 2887 req->nr_hw_segments = bio_hw_segments(req->q, bio);
2888 req->buffer = bio_data(bio); /* see ->buffer comment above */ 2888 req->buffer = bio_data(bio); /* see ->buffer comment above */
2889 req->waiting = NULL;
2890 req->bio = req->biotail = bio; 2889 req->bio = req->biotail = bio;
2891 req->ioprio = bio_prio(bio); 2890 req->ioprio = bio_prio(bio);
2892 req->rq_disk = bio->bi_bdev->bd_disk; 2891 req->rq_disk = bio->bi_bdev->bd_disk;
diff --git a/drivers/block/DAC960.c b/drivers/block/DAC960.c
index a360215dbce7..2568640430fb 100644
--- a/drivers/block/DAC960.c
+++ b/drivers/block/DAC960.c
@@ -3331,7 +3331,7 @@ static int DAC960_process_queue(DAC960_Controller_T *Controller, struct request_
3331 Command->DmaDirection = PCI_DMA_TODEVICE; 3331 Command->DmaDirection = PCI_DMA_TODEVICE;
3332 Command->CommandType = DAC960_WriteCommand; 3332 Command->CommandType = DAC960_WriteCommand;
3333 } 3333 }
3334 Command->Completion = Request->waiting; 3334 Command->Completion = Request->end_io_data;
3335 Command->LogicalDriveNumber = (long)Request->rq_disk->private_data; 3335 Command->LogicalDriveNumber = (long)Request->rq_disk->private_data;
3336 Command->BlockNumber = Request->sector; 3336 Command->BlockNumber = Request->sector;
3337 Command->BlockCount = Request->nr_sectors; 3337 Command->BlockCount = Request->nr_sectors;
diff --git a/drivers/block/paride/pd.c b/drivers/block/paride/pd.c
index 12ff1a274d91..500d2ebb41e4 100644
--- a/drivers/block/paride/pd.c
+++ b/drivers/block/paride/pd.c
@@ -722,11 +722,10 @@ static int pd_special_command(struct pd_unit *disk,
722 rq.rq_status = RQ_ACTIVE; 722 rq.rq_status = RQ_ACTIVE;
723 rq.rq_disk = disk->gd; 723 rq.rq_disk = disk->gd;
724 rq.ref_count = 1; 724 rq.ref_count = 1;
725 rq.waiting = &wait; 725 rq.end_io_data = &wait;
726 rq.end_io = blk_end_sync_rq; 726 rq.end_io = blk_end_sync_rq;
727 blk_insert_request(disk->gd->queue, &rq, 0, func); 727 blk_insert_request(disk->gd->queue, &rq, 0, func);
728 wait_for_completion(&wait); 728 wait_for_completion(&wait);
729 rq.waiting = NULL;
730 if (rq.errors) 729 if (rq.errors)
731 err = -EIO; 730 err = -EIO;
732 blk_put_request(&rq); 731 blk_put_request(&rq);
diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c
index 42891d2b054e..888d1aceeeff 100644
--- a/drivers/block/pktcdvd.c
+++ b/drivers/block/pktcdvd.c
@@ -375,7 +375,7 @@ static int pkt_generic_packet(struct pktcdvd_device *pd, struct packet_command *
375 rq->cmd_len = COMMAND_SIZE(rq->cmd[0]); 375 rq->cmd_len = COMMAND_SIZE(rq->cmd[0]);
376 376
377 rq->ref_count++; 377 rq->ref_count++;
378 rq->waiting = &wait; 378 rq->end_io_data = &wait;
379 rq->end_io = blk_end_sync_rq; 379 rq->end_io = blk_end_sync_rq;
380 elv_add_request(q, rq, ELEVATOR_INSERT_BACK, 1); 380 elv_add_request(q, rq, ELEVATOR_INSERT_BACK, 1);
381 generic_unplug_device(q); 381 generic_unplug_device(q);
diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c
index 3436b1f104eb..a3ffb04436bd 100644
--- a/drivers/ide/ide-io.c
+++ b/drivers/ide/ide-io.c
@@ -141,7 +141,7 @@ enum {
141 141
142static void ide_complete_power_step(ide_drive_t *drive, struct request *rq, u8 stat, u8 error) 142static 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 if (drive->media != ide_disk) 146 if (drive->media != ide_disk)
147 return; 147 return;
@@ -164,7 +164,7 @@ static void ide_complete_power_step(ide_drive_t *drive, struct request *rq, u8 s
164 164
165static ide_startstop_t ide_start_power_step(ide_drive_t *drive, struct request *rq) 165static 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 ide_task_t *args = rq->special; 168 ide_task_t *args = rq->special;
169 169
170 memset(args, 0, sizeof(*args)); 170 memset(args, 0, sizeof(*args));
@@ -421,7 +421,7 @@ void ide_end_drive_cmd (ide_drive_t *drive, u8 stat, u8 err)
421 } 421 }
422 } 422 }
423 } else if (blk_pm_request(rq)) { 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#ifdef DEBUG_PM 425#ifdef DEBUG_PM
426 printk("%s: complete_power_step(step: %d, stat: %x, err: %x)\n", 426 printk("%s: complete_power_step(step: %d, stat: %x, err: %x)\n",
427 drive->name, rq->pm->pm_step, stat, err); 427 drive->name, rq->pm->pm_step, stat, err);
@@ -933,7 +933,7 @@ done:
933 933
934static void ide_check_pm_state(ide_drive_t *drive, struct request *rq) 934static 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 if (blk_pm_suspend_request(rq) && 938 if (blk_pm_suspend_request(rq) &&
939 pm->pm_step == ide_pm_state_start_suspend) 939 pm->pm_step == ide_pm_state_start_suspend)
@@ -1018,7 +1018,7 @@ static ide_startstop_t start_request (ide_drive_t *drive, struct request *rq)
1018 rq->cmd_type == REQ_TYPE_ATA_TASKFILE) 1018 rq->cmd_type == REQ_TYPE_ATA_TASKFILE)
1019 return execute_drive_cmd(drive, rq); 1019 return execute_drive_cmd(drive, rq);
1020 else if (blk_pm_request(rq)) { 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#ifdef DEBUG_PM 1022#ifdef DEBUG_PM
1023 printk("%s: start_power_step(step: %d)\n", 1023 printk("%s: start_power_step(step: %d)\n",
1024 drive->name, rq->pm->pm_step); 1024 drive->name, rq->pm->pm_step);
@@ -1718,7 +1718,7 @@ int ide_do_drive_cmd (ide_drive_t *drive, struct request *rq, ide_action_t actio
1718 */ 1718 */
1719 if (must_wait) { 1719 if (must_wait) {
1720 rq->ref_count++; 1720 rq->ref_count++;
1721 rq->waiting = &wait; 1721 rq->end_io_data = &wait;
1722 rq->end_io = blk_end_sync_rq; 1722 rq->end_io = blk_end_sync_rq;
1723 } 1723 }
1724 1724
@@ -1736,7 +1736,6 @@ int ide_do_drive_cmd (ide_drive_t *drive, struct request *rq, ide_action_t actio
1736 err = 0; 1736 err = 0;
1737 if (must_wait) { 1737 if (must_wait) {
1738 wait_for_completion(&wait); 1738 wait_for_completion(&wait);
1739 rq->waiting = NULL;
1740 if (rq->errors) 1739 if (rq->errors)
1741 err = -EIO; 1740 err = -EIO;
1742 1741
diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c
index 643e4b9ac651..66f9678d2f10 100644
--- a/drivers/ide/ide-tape.c
+++ b/drivers/ide/ide-tape.c
@@ -2773,7 +2773,7 @@ static void idetape_wait_for_request (ide_drive_t *drive, struct request *rq)
2773 return; 2773 return;
2774 } 2774 }
2775#endif /* IDETAPE_DEBUG_BUGS */ 2775#endif /* IDETAPE_DEBUG_BUGS */
2776 rq->waiting = &wait; 2776 rq->end_io_data = &wait;
2777 rq->end_io = blk_end_sync_rq; 2777 rq->end_io = blk_end_sync_rq;
2778 spin_unlock_irq(&tape->spinlock); 2778 spin_unlock_irq(&tape->spinlock);
2779 wait_for_completion(&wait); 2779 wait_for_completion(&wait);
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c
index 9384a3fdde6c..2b1a1389c318 100644
--- a/drivers/ide/ide.c
+++ b/drivers/ide/ide.c
@@ -1219,7 +1219,7 @@ static int generic_ide_suspend(struct device *dev, pm_message_t mesg)
1219 memset(&args, 0, sizeof(args)); 1219 memset(&args, 0, sizeof(args));
1220 rq.cmd_type = REQ_TYPE_PM_SUSPEND; 1220 rq.cmd_type = REQ_TYPE_PM_SUSPEND;
1221 rq.special = &args; 1221 rq.special = &args;
1222 rq.end_io_data = &rqpm; 1222 rq.data = &rqpm;
1223 rqpm.pm_step = ide_pm_state_start_suspend; 1223 rqpm.pm_step = ide_pm_state_start_suspend;
1224 if (mesg.event == PM_EVENT_PRETHAW) 1224 if (mesg.event == PM_EVENT_PRETHAW)
1225 mesg.event = PM_EVENT_FREEZE; 1225 mesg.event = PM_EVENT_FREEZE;
@@ -1240,7 +1240,7 @@ static int generic_ide_resume(struct device *dev)
1240 memset(&args, 0, sizeof(args)); 1240 memset(&args, 0, sizeof(args));
1241 rq.cmd_type = REQ_TYPE_PM_RESUME; 1241 rq.cmd_type = REQ_TYPE_PM_RESUME;
1242 rq.special = &args; 1242 rq.special = &args;
1243 rq.end_io_data = &rqpm; 1243 rq.data = &rqpm;
1244 rqpm.pm_step = ide_pm_state_start_resume; 1244 rqpm.pm_step = ide_pm_state_start_resume;
1245 rqpm.pm_state = PM_EVENT_ON; 1245 rqpm.pm_state = PM_EVENT_ON;
1246 1246
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index d2dc17151f6c..604f23189097 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -266,7 +266,6 @@ struct request {
266 request_queue_t *q; 266 request_queue_t *q;
267 struct request_list *rl; 267 struct request_list *rl;
268 268
269 struct completion *waiting;
270 void *special; 269 void *special;
271 char *buffer; 270 char *buffer;
272 271
@@ -285,7 +284,7 @@ struct request {
285 int retries; 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 rq_end_io_fn *end_io; 289 rq_end_io_fn *end_io;
291 void *end_io_data; 290 void *end_io_data;