aboutsummaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorMike Snitzer <snitzer@redhat.com>2011-02-11 05:08:00 -0500
committerJens Axboe <jaxboe@fusionio.com>2011-02-11 05:08:00 -0500
commitc186794dbb466b45cf40f942f2d09d6d5b4b0e42 (patch)
tree07ccd819bb6cced2c19053d2ed97ebaac88f824e /block
parent9d5a4e946ce5352f19400b6370f4cd8e72806278 (diff)
block: share request flush fields with elevator_private
Flush requests are never put on the IO scheduler. Convert request structure's elevator_private* into an array and have the flush fields share a union with it. Reclaim the space lost in 'struct request' by moving 'completion_data' back in the union with 'rb_node'. Signed-off-by: Mike Snitzer <snitzer@redhat.com> Acked-by: Vivek Goyal <vgoyal@redhat.com> Acked-by: Tejun Heo <tj@kernel.org> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
Diffstat (limited to 'block')
-rw-r--r--block/cfq-iosched.c18
-rw-r--r--block/elevator.c2
2 files changed, 10 insertions, 10 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