diff options
author | Tejun Heo <tj@kernel.org> | 2011-12-13 18:33:41 -0500 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2011-12-13 18:33:41 -0500 |
commit | 22f746e235a5cbee2a6ca9887b1be2aa7d31fe71 (patch) | |
tree | a9786fe9fdb994b5ff69794023e6e3e48e39e0b0 /block/blk.h | |
parent | f8fc877d3c1f10457d0d73d8540a0c51a1fa718a (diff) |
block: remove elevator_queue->ops
elevator_queue->ops points to the same ops struct ->elevator_type.ops
is pointing to. The only effect of caching it in elevator_queue is
shorter notation - it doesn't save any indirect derefence.
Relocate elevator_type->list which used only during module init/exit
to the end of the structure, rename elevator_queue->elevator_type to
->type, and replace elevator_queue->ops with elevator_queue->type.ops.
This doesn't introduce any functional difference.
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/blk.h')
-rw-r--r-- | block/blk.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/block/blk.h b/block/blk.h index 5bca2668e1bf..4943770e0792 100644 --- a/block/blk.h +++ b/block/blk.h | |||
@@ -94,7 +94,7 @@ static inline struct request *__elv_next_request(struct request_queue *q) | |||
94 | return NULL; | 94 | return NULL; |
95 | } | 95 | } |
96 | if (unlikely(blk_queue_dead(q)) || | 96 | if (unlikely(blk_queue_dead(q)) || |
97 | !q->elevator->ops->elevator_dispatch_fn(q, 0)) | 97 | !q->elevator->type->ops.elevator_dispatch_fn(q, 0)) |
98 | return NULL; | 98 | return NULL; |
99 | } | 99 | } |
100 | } | 100 | } |
@@ -103,16 +103,16 @@ static inline void elv_activate_rq(struct request_queue *q, struct request *rq) | |||
103 | { | 103 | { |
104 | struct elevator_queue *e = q->elevator; | 104 | struct elevator_queue *e = q->elevator; |
105 | 105 | ||
106 | if (e->ops->elevator_activate_req_fn) | 106 | if (e->type->ops.elevator_activate_req_fn) |
107 | e->ops->elevator_activate_req_fn(q, rq); | 107 | e->type->ops.elevator_activate_req_fn(q, rq); |
108 | } | 108 | } |
109 | 109 | ||
110 | static inline void elv_deactivate_rq(struct request_queue *q, struct request *rq) | 110 | static inline void elv_deactivate_rq(struct request_queue *q, struct request *rq) |
111 | { | 111 | { |
112 | struct elevator_queue *e = q->elevator; | 112 | struct elevator_queue *e = q->elevator; |
113 | 113 | ||
114 | if (e->ops->elevator_deactivate_req_fn) | 114 | if (e->type->ops.elevator_deactivate_req_fn) |
115 | e->ops->elevator_deactivate_req_fn(q, rq); | 115 | e->type->ops.elevator_deactivate_req_fn(q, rq); |
116 | } | 116 | } |
117 | 117 | ||
118 | #ifdef CONFIG_FAIL_IO_TIMEOUT | 118 | #ifdef CONFIG_FAIL_IO_TIMEOUT |