diff options
author | Jens Axboe <axboe@suse.de> | 2006-08-10 02:59:11 -0400 |
---|---|---|
committer | Jens Axboe <axboe@nelson.home.kernel.dk> | 2006-09-30 14:29:22 -0400 |
commit | 49171e5c6f414d49a061b5c1c84967c2eb569822 (patch) | |
tree | 95da6dad18f9bfe10367db86e740b8842f60a686 | |
parent | c00895ab2f08df7044e58ee01c38bf0a661ea0eb (diff) |
[PATCH] Remove struct request_list from struct request
It is always identical to &q->rq, and we only use it for detecting
whether this request came out of our mempool or not. So replace it
with an additional ->flags bit flag.
Signed-off-by: Jens Axboe <axboe@suse.de>
-rw-r--r-- | block/ll_rw_blk.c | 10 | ||||
-rw-r--r-- | include/linux/blkdev.h | 3 |
2 files changed, 4 insertions, 9 deletions
diff --git a/block/ll_rw_blk.c b/block/ll_rw_blk.c index 3b6aad2affd8..f7462502bfdf 100644 --- a/block/ll_rw_blk.c +++ b/block/ll_rw_blk.c | |||
@@ -452,7 +452,6 @@ static void queue_flush(request_queue_t *q, unsigned which) | |||
452 | rq->elevator_private = NULL; | 452 | rq->elevator_private = NULL; |
453 | rq->elevator_private2 = 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; | ||
456 | rq->end_io = end_io; | 455 | rq->end_io = end_io; |
457 | q->prepare_flush_fn(q, rq); | 456 | q->prepare_flush_fn(q, rq); |
458 | 457 | ||
@@ -480,7 +479,6 @@ static inline struct request *start_ordered(request_queue_t *q, | |||
480 | rq->cmd_flags |= q->ordered & QUEUE_ORDERED_FUA ? REQ_FUA : 0; | 479 | rq->cmd_flags |= q->ordered & QUEUE_ORDERED_FUA ? REQ_FUA : 0; |
481 | rq->elevator_private = NULL; | 480 | rq->elevator_private = NULL; |
482 | rq->elevator_private2 = NULL; | 481 | rq->elevator_private2 = NULL; |
483 | rq->rl = NULL; | ||
484 | init_request_from_bio(rq, q->orig_bar_rq->bio); | 482 | init_request_from_bio(rq, q->orig_bar_rq->bio); |
485 | rq->end_io = bar_end_io; | 483 | rq->end_io = bar_end_io; |
486 | 484 | ||
@@ -2018,7 +2016,7 @@ blk_alloc_request(request_queue_t *q, int rw, struct bio *bio, | |||
2018 | * first three bits are identical in rq->cmd_flags and bio->bi_rw, | 2016 | * first three bits are identical in rq->cmd_flags and bio->bi_rw, |
2019 | * see bio.h and blkdev.h | 2017 | * see bio.h and blkdev.h |
2020 | */ | 2018 | */ |
2021 | rq->cmd_flags = rw; | 2019 | rq->cmd_flags = rw | REQ_ALLOCED; |
2022 | 2020 | ||
2023 | if (priv) { | 2021 | if (priv) { |
2024 | if (unlikely(elv_set_request(q, rq, bio, gfp_mask))) { | 2022 | if (unlikely(elv_set_request(q, rq, bio, gfp_mask))) { |
@@ -2196,7 +2194,6 @@ rq_starved: | |||
2196 | ioc->nr_batch_requests--; | 2194 | ioc->nr_batch_requests--; |
2197 | 2195 | ||
2198 | rq_init(q, rq); | 2196 | rq_init(q, rq); |
2199 | rq->rl = rl; | ||
2200 | 2197 | ||
2201 | blk_add_trace_generic(q, bio, rw, BLK_TA_GETRQ); | 2198 | blk_add_trace_generic(q, bio, rw, BLK_TA_GETRQ); |
2202 | out: | 2199 | out: |
@@ -2681,8 +2678,6 @@ EXPORT_SYMBOL_GPL(disk_round_stats); | |||
2681 | */ | 2678 | */ |
2682 | void __blk_put_request(request_queue_t *q, struct request *req) | 2679 | void __blk_put_request(request_queue_t *q, struct request *req) |
2683 | { | 2680 | { |
2684 | struct request_list *rl = req->rl; | ||
2685 | |||
2686 | if (unlikely(!q)) | 2681 | if (unlikely(!q)) |
2687 | return; | 2682 | return; |
2688 | if (unlikely(--req->ref_count)) | 2683 | if (unlikely(--req->ref_count)) |
@@ -2691,13 +2686,12 @@ void __blk_put_request(request_queue_t *q, struct request *req) | |||
2691 | elv_completed_request(q, req); | 2686 | elv_completed_request(q, req); |
2692 | 2687 | ||
2693 | req->rq_status = RQ_INACTIVE; | 2688 | req->rq_status = RQ_INACTIVE; |
2694 | req->rl = NULL; | ||
2695 | 2689 | ||
2696 | /* | 2690 | /* |
2697 | * Request may not have originated from ll_rw_blk. if not, | 2691 | * Request may not have originated from ll_rw_blk. if not, |
2698 | * it didn't come out of our reserved rq pools | 2692 | * it didn't come out of our reserved rq pools |
2699 | */ | 2693 | */ |
2700 | if (rl) { | 2694 | if (req->cmd_flags & REQ_ALLOCED) { |
2701 | int rw = rq_data_dir(req); | 2695 | int rw = rq_data_dir(req); |
2702 | int priv = req->cmd_flags & REQ_ELVPRIV; | 2696 | int priv = req->cmd_flags & REQ_ELVPRIV; |
2703 | 2697 | ||
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 604f23189097..d4c1dd046e27 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
@@ -180,6 +180,7 @@ enum rq_flag_bits { | |||
180 | __REQ_PREEMPT, /* set for "ide_preempt" requests */ | 180 | __REQ_PREEMPT, /* set for "ide_preempt" requests */ |
181 | __REQ_ORDERED_COLOR, /* is before or after barrier */ | 181 | __REQ_ORDERED_COLOR, /* is before or after barrier */ |
182 | __REQ_RW_SYNC, /* request is sync (O_DIRECT) */ | 182 | __REQ_RW_SYNC, /* request is sync (O_DIRECT) */ |
183 | __REQ_ALLOCED, /* request came from our alloc pool */ | ||
183 | __REQ_NR_BITS, /* stops here */ | 184 | __REQ_NR_BITS, /* stops here */ |
184 | }; | 185 | }; |
185 | 186 | ||
@@ -199,6 +200,7 @@ enum rq_flag_bits { | |||
199 | #define REQ_PREEMPT (1 << __REQ_PREEMPT) | 200 | #define REQ_PREEMPT (1 << __REQ_PREEMPT) |
200 | #define REQ_ORDERED_COLOR (1 << __REQ_ORDERED_COLOR) | 201 | #define REQ_ORDERED_COLOR (1 << __REQ_ORDERED_COLOR) |
201 | #define REQ_RW_SYNC (1 << __REQ_RW_SYNC) | 202 | #define REQ_RW_SYNC (1 << __REQ_RW_SYNC) |
203 | #define REQ_ALLOCED (1 << __REQ_ALLOCED) | ||
202 | 204 | ||
203 | #define BLK_MAX_CDB 16 | 205 | #define BLK_MAX_CDB 16 |
204 | 206 | ||
@@ -264,7 +266,6 @@ struct request { | |||
264 | 266 | ||
265 | int ref_count; | 267 | int ref_count; |
266 | request_queue_t *q; | 268 | request_queue_t *q; |
267 | struct request_list *rl; | ||
268 | 269 | ||
269 | void *special; | 270 | void *special; |
270 | char *buffer; | 271 | char *buffer; |