aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--block/cfq-iosched.c18
-rw-r--r--block/elevator.c2
-rw-r--r--include/linux/blkdev.h23
3 files changed, 22 insertions, 21 deletions
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
index 4cd59b0d7c15..968455c57e1a 100644
--- a/block/cfq-iosched.c
+++ b/block/cfq-iosched.c
@@ -54,9 +54,9 @@ static const int cfq_hist_divisor = 4;
54#define CFQQ_SEEKY(cfqq) (hweight32(cfqq->seek_history) > 32/8) 54#define CFQQ_SEEKY(cfqq) (hweight32(cfqq->seek_history) > 32/8)
55 55
56#define RQ_CIC(rq) \ 56#define RQ_CIC(rq) \
57 ((struct cfq_io_context *) (rq)->elevator_private) 57 ((struct cfq_io_context *) (rq)->elevator_private[0])
58#define RQ_CFQQ(rq) (struct cfq_queue *) ((rq)->elevator_private2) 58#define RQ_CFQQ(rq) (struct cfq_queue *) ((rq)->elevator_private[1])
59#define RQ_CFQG(rq) (struct cfq_group *) ((rq)->elevator_private3) 59#define RQ_CFQG(rq) (struct cfq_group *) ((rq)->elevator_private[2])
60 60
61static struct kmem_cache *cfq_pool; 61static struct kmem_cache *cfq_pool;
62static struct kmem_cache *cfq_ioc_pool; 62static struct kmem_cache *cfq_ioc_pool;
@@ -3589,12 +3589,12 @@ static void cfq_put_request(struct request *rq)
3589 3589
3590 put_io_context(RQ_CIC(rq)->ioc); 3590 put_io_context(RQ_CIC(rq)->ioc);
3591 3591
3592 rq->elevator_private = NULL; 3592 rq->elevator_private[0] = NULL;
3593 rq->elevator_private2 = NULL; 3593 rq->elevator_private[1] = NULL;
3594 3594
3595 /* Put down rq reference on cfqg */ 3595 /* Put down rq reference on cfqg */
3596 cfq_put_cfqg(RQ_CFQG(rq)); 3596 cfq_put_cfqg(RQ_CFQG(rq));
3597 rq->elevator_private3 = NULL; 3597 rq->elevator_private[2] = NULL;
3598 3598
3599 cfq_put_queue(cfqq); 3599 cfq_put_queue(cfqq);
3600 } 3600 }
@@ -3685,9 +3685,9 @@ new_queue:
3685 3685
3686 spin_unlock_irqrestore(q->queue_lock, flags); 3686 spin_unlock_irqrestore(q->queue_lock, flags);
3687 3687
3688 rq->elevator_private = cic; 3688 rq->elevator_private[0] = cic;
3689 rq->elevator_private2 = cfqq; 3689 rq->elevator_private[1] = cfqq;
3690 rq->elevator_private3 = cfq_ref_get_cfqg(cfqq->cfqg); 3690 rq->elevator_private[2] = cfq_ref_get_cfqg(cfqq->cfqg);
3691 return 0; 3691 return 0;
3692 3692
3693queue_fail: 3693queue_fail:
diff --git a/block/elevator.c b/block/elevator.c
index 270e0972eb9f..f98e92edc937 100644
--- a/block/elevator.c
+++ b/block/elevator.c
@@ -764,7 +764,7 @@ int elv_set_request(struct request_queue *q, struct request *rq, gfp_t gfp_mask)
764 if (e->ops->elevator_set_req_fn) 764 if (e->ops->elevator_set_req_fn)
765 return e->ops->elevator_set_req_fn(q, rq, gfp_mask); 765 return e->ops->elevator_set_req_fn(q, rq, gfp_mask);
766 766
767 rq->elevator_private = NULL; 767 rq->elevator_private[0] = NULL;
768 return 0; 768 return 0;
769} 769}
770 770
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 6d7e9afd08c3..12bb426949e9 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -99,25 +99,26 @@ struct request {
99 /* 99 /*
100 * The rb_node is only used inside the io scheduler, requests 100 * The rb_node is only used inside the io scheduler, requests
101 * are pruned when moved to the dispatch queue. So let the 101 * are pruned when moved to the dispatch queue. So let the
102 * flush fields share space with the rb_node. 102 * completion_data share space with the rb_node.
103 */ 103 */
104 union { 104 union {
105 struct rb_node rb_node; /* sort/lookup */ 105 struct rb_node rb_node; /* sort/lookup */
106 struct { 106 void *completion_data;
107 unsigned int seq;
108 struct list_head list;
109 } flush;
110 }; 107 };
111 108
112 void *completion_data;
113
114 /* 109 /*
115 * Three pointers are available for the IO schedulers, if they need 110 * Three pointers are available for the IO schedulers, if they need
116 * more they have to dynamically allocate it. 111 * more they have to dynamically allocate it. Flush requests are
112 * never put on the IO scheduler. So let the flush fields share
113 * space with the three elevator_private pointers.
117 */ 114 */
118 void *elevator_private; 115 union {
119 void *elevator_private2; 116 void *elevator_private[3];
120 void *elevator_private3; 117 struct {
118 unsigned int seq;
119 struct list_head list;
120 } flush;
121 };
121 122
122 struct gendisk *rq_disk; 123 struct gendisk *rq_disk;
123 unsigned long start_time; 124 unsigned long start_time;