diff options
author | Jens Axboe <axboe@kernel.dk> | 2006-09-30 14:29:12 -0400 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2006-09-30 14:29:12 -0400 |
commit | c00895ab2f08df7044e58ee01c38bf0a661ea0eb (patch) | |
tree | 95dee4eb76042087c4b8d43a5841b6bae85b8cf3 /block | |
parent | 8a8e674cb1dafc818ffea93d97e4c1c1f01fdbb6 (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>
Diffstat (limited to 'block')
-rw-r--r-- | block/elevator.c | 3 | ||||
-rw-r--r-- | block/ll_rw_blk.c | 13 |
2 files changed, 7 insertions, 9 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 | */ |
2737 | void blk_end_sync_rq(struct request *rq, int error) | 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 | __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; |