summaryrefslogtreecommitdiffstats
path: root/include/linux/iocontext.h
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2011-12-14 00:33:41 +0100
committerJens Axboe <axboe@kernel.dk>2011-12-14 00:33:41 +0100
commitc58698073218f2c8f2fc5982fa3938c2d3803b9f (patch)
treeccd2403fd8674051a062efd2c22e6fdd179b7b8f /include/linux/iocontext.h
parent22f746e235a5cbee2a6ca9887b1be2aa7d31fe71 (diff)
downloadop-kernel-dev-c58698073218f2c8f2fc5982fa3938c2d3803b9f.zip
op-kernel-dev-c58698073218f2c8f2fc5982fa3938c2d3803b9f.tar.gz
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.h43
1 files changed, 14 insertions, 29 deletions
diff --git a/include/linux/iocontext.h b/include/linux/iocontext.h
index b2b75a5..d15ca65 100644
--- a/include/linux/iocontext.h
+++ b/include/linux/iocontext.h
@@ -5,38 +5,23 @@
#include <linux/rcupdate.h>
#include <linux/workqueue.h>
-struct cfq_queue;
-struct cfq_ttime {
- unsigned long last_end_request;
-
- unsigned long ttime_total;
- unsigned long ttime_samples;
- unsigned long ttime_mean;
-};
-
enum {
- CIC_IOPRIO_CHANGED,
- CIC_CGROUP_CHANGED,
+ ICQ_IOPRIO_CHANGED,
+ ICQ_CGROUP_CHANGED,
};
-struct cfq_io_context {
- struct request_queue *q;
-
- struct cfq_queue *cfqq[2];
-
- struct io_context *ioc;
-
- struct cfq_ttime ttime;
-
- struct list_head queue_list;
- struct hlist_node cic_list;
+struct io_cq {
+ struct request_queue *q;
+ struct io_context *ioc;
- unsigned long changed;
+ struct list_head q_node;
+ struct hlist_node ioc_node;
- void (*exit)(struct cfq_io_context *);
- void (*release)(struct cfq_io_context *);
+ unsigned long changed;
+ struct rcu_head rcu_head;
- struct rcu_head rcu_head;
+ void (*exit)(struct io_cq *);
+ void (*release)(struct io_cq *);
};
/*
@@ -58,9 +43,9 @@ struct io_context {
int nr_batch_requests; /* Number of requests left in the batch */
unsigned long last_waited; /* Time last woken after wait for request */
- struct radix_tree_root radix_root;
- struct hlist_head cic_list;
- void __rcu *ioc_data;
+ struct radix_tree_root icq_tree;
+ struct io_cq __rcu *icq_hint;
+ struct hlist_head icq_list;
struct work_struct release_work;
};
OpenPOWER on IntegriCloud