block, cfq: move ioc ioprio/cgroup changed handling to cic
[deliverable/linux.git] / include / linux / iocontext.h
index 5037a0ad231245b3b2779c81bf76f912df467879..2c2b6da96b3c5de2a1e5c916a216ffeb8faaecdb 100644 (file)
@@ -13,8 +13,14 @@ struct cfq_ttime {
        unsigned long ttime_mean;
 };
 
+enum {
+       CIC_IOPRIO_CHANGED,
+       CIC_CGROUP_CHANGED,
+};
+
 struct cfq_io_context {
        void *key;
+       struct request_queue *q;
 
        struct cfq_queue *cfqq[2];
 
@@ -25,6 +31,8 @@ struct cfq_io_context {
        struct list_head queue_list;
        struct hlist_node cic_list;
 
+       unsigned long changed;
+
        void (*dtor)(struct io_context *); /* destructor */
        void (*exit)(struct io_context *); /* called on task exit */
 
@@ -43,11 +51,6 @@ struct io_context {
        spinlock_t lock;
 
        unsigned short ioprio;
-       unsigned short ioprio_changed;
-
-#if defined(CONFIG_BLK_CGROUP) || defined(CONFIG_BLK_CGROUP_MODULE)
-       unsigned short cgroup_changed;
-#endif
 
        /*
         * For request batching
@@ -76,20 +79,16 @@ static inline struct io_context *ioc_task_link(struct io_context *ioc)
 
 struct task_struct;
 #ifdef CONFIG_BLOCK
-int put_io_context(struct io_context *ioc);
+void put_io_context(struct io_context *ioc);
 void exit_io_context(struct task_struct *task);
-struct io_context *get_io_context(gfp_t gfp_flags, int node);
-struct io_context *alloc_io_context(gfp_t gfp_flags, int node);
+struct io_context *get_task_io_context(struct task_struct *task,
+                                      gfp_t gfp_flags, int node);
+void ioc_ioprio_changed(struct io_context *ioc, int ioprio);
+void ioc_cgroup_changed(struct io_context *ioc);
 #else
-static inline void exit_io_context(struct task_struct *task)
-{
-}
-
 struct io_context;
-static inline int put_io_context(struct io_context *ioc)
-{
-       return 1;
-}
+static inline void put_io_context(struct io_context *ioc) { }
+static inline void exit_io_context(struct task_struct *task) { }
 #endif
 
 #endif
This page took 0.02905 seconds and 5 git commands to generate.