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 | c58698073218f2c8f2fc5982fa3938c2d3803b9f (patch) | |
tree | ccd2403fd8674051a062efd2c22e6fdd179b7b8f /include/linux/iocontext.h | |
parent | 22f746e235a5cbee2a6ca9887b1be2aa7d31fe71 (diff) |
block, cfq: reorganize cfq_io_context into generic and cfq specific parts
Currently io_context and cfq logics are mixed without clear boundary.
Most of io_context is independent from cfq but cfq_io_context handling
logic is dispersed between generic ioc code and cfq.
cfq_io_context represents association between an io_context and a
request_queue, which is a concept useful outside of cfq, but it also
contains fields which are useful only to cfq.
This patch takes out generic part and put it into io_cq (io
context-queue) and the rest into cfq_io_cq (cic moniker remains the
same) which contains io_cq. The following changes are made together.
* cfq_ttime and cfq_io_cq now live in cfq-iosched.c.
* All related fields, functions and constants are renamed accordingly.
* ioc->ioc_data is now "struct io_cq *" instead of "void *" and
renamed to icq_hint.
This prepares for io_context API cleanup. Documentation is currently
sparse. It will be added later.
Changes in this patch are mechanical and don't cause functional
change.
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'include/linux/iocontext.h')
-rw-r--r-- | include/linux/iocontext.h | 43 |
1 files changed, 14 insertions, 29 deletions
diff --git a/include/linux/iocontext.h b/include/linux/iocontext.h index b2b75a54f252..d15ca6591f96 100644 --- a/include/linux/iocontext.h +++ b/include/linux/iocontext.h | |||
@@ -5,38 +5,23 @@ | |||
5 | #include <linux/rcupdate.h> | 5 | #include <linux/rcupdate.h> |
6 | #include <linux/workqueue.h> | 6 | #include <linux/workqueue.h> |
7 | 7 | ||
8 | struct cfq_queue; | ||
9 | struct cfq_ttime { | ||
10 | unsigned long last_end_request; | ||
11 | |||
12 | unsigned long ttime_total; | ||
13 | unsigned long ttime_samples; | ||
14 | unsigned long ttime_mean; | ||
15 | }; | ||
16 | |||
17 | enum { | 8 | enum { |
18 | CIC_IOPRIO_CHANGED, | 9 | ICQ_IOPRIO_CHANGED, |
19 | CIC_CGROUP_CHANGED, | 10 | ICQ_CGROUP_CHANGED, |
20 | }; | 11 | }; |
21 | 12 | ||
22 | struct cfq_io_context { | 13 | struct io_cq { |
23 | struct request_queue *q; | 14 | struct request_queue *q; |
24 | 15 | struct io_context *ioc; | |
25 | struct cfq_queue *cfqq[2]; | ||
26 | |||
27 | struct io_context *ioc; | ||
28 | |||
29 | struct cfq_ttime ttime; | ||
30 | |||
31 | struct list_head queue_list; | ||
32 | struct hlist_node cic_list; | ||
33 | 16 | ||
34 | unsigned long changed; | 17 | struct list_head q_node; |
18 | struct hlist_node ioc_node; | ||
35 | 19 | ||
36 | void (*exit)(struct cfq_io_context *); | 20 | unsigned long changed; |
37 | void (*release)(struct cfq_io_context *); | 21 | struct rcu_head rcu_head; |
38 | 22 | ||
39 | struct rcu_head rcu_head; | 23 | void (*exit)(struct io_cq *); |
24 | void (*release)(struct io_cq *); | ||
40 | }; | 25 | }; |
41 | 26 | ||
42 | /* | 27 | /* |
@@ -58,9 +43,9 @@ struct io_context { | |||
58 | int nr_batch_requests; /* Number of requests left in the batch */ | 43 | int nr_batch_requests; /* Number of requests left in the batch */ |
59 | unsigned long last_waited; /* Time last woken after wait for request */ | 44 | unsigned long last_waited; /* Time last woken after wait for request */ |
60 | 45 | ||
61 | struct radix_tree_root radix_root; | 46 | struct radix_tree_root icq_tree; |
62 | struct hlist_head cic_list; | 47 | struct io_cq __rcu *icq_hint; |
63 | void __rcu *ioc_data; | 48 | struct hlist_head icq_list; |
64 | 49 | ||
65 | struct work_struct release_work; | 50 | struct work_struct release_work; |
66 | }; | 51 | }; |