blkcg: simplify blkg_conf_prep()
[linux-2.6.git] / block / cfq.h
blobc8b15ef57e5dee494fd78473529d437ba1d4e02f
1 #ifndef _CFQ_H
2 #define _CFQ_H
3 #include "blk-cgroup.h"
5 #ifdef CONFIG_CFQ_GROUP_IOSCHED
6 static inline void cfq_blkiocg_update_io_add_stats(struct blkio_group *blkg,
7 struct blkio_policy_type *pol,
8 struct blkio_group *curr_blkg,
9 bool direction, bool sync)
11 blkiocg_update_io_add_stats(blkg, pol, curr_blkg, direction, sync);
14 static inline void cfq_blkiocg_update_dequeue_stats(struct blkio_group *blkg,
15 struct blkio_policy_type *pol, unsigned long dequeue)
17 blkiocg_update_dequeue_stats(blkg, pol, dequeue);
20 static inline void cfq_blkiocg_update_timeslice_used(struct blkio_group *blkg,
21 struct blkio_policy_type *pol, unsigned long time,
22 unsigned long unaccounted_time)
24 blkiocg_update_timeslice_used(blkg, pol, time, unaccounted_time);
27 static inline void cfq_blkiocg_set_start_empty_time(struct blkio_group *blkg,
28 struct blkio_policy_type *pol)
30 blkiocg_set_start_empty_time(blkg, pol);
33 static inline void cfq_blkiocg_update_io_remove_stats(struct blkio_group *blkg,
34 struct blkio_policy_type *pol, bool direction,
35 bool sync)
37 blkiocg_update_io_remove_stats(blkg, pol, direction, sync);
40 static inline void cfq_blkiocg_update_io_merged_stats(struct blkio_group *blkg,
41 struct blkio_policy_type *pol, bool direction,
42 bool sync)
44 blkiocg_update_io_merged_stats(blkg, pol, direction, sync);
47 static inline void cfq_blkiocg_update_idle_time_stats(struct blkio_group *blkg,
48 struct blkio_policy_type *pol)
50 blkiocg_update_idle_time_stats(blkg, pol);
53 static inline void
54 cfq_blkiocg_update_avg_queue_size_stats(struct blkio_group *blkg,
55 struct blkio_policy_type *pol)
57 blkiocg_update_avg_queue_size_stats(blkg, pol);
60 static inline void
61 cfq_blkiocg_update_set_idle_time_stats(struct blkio_group *blkg,
62 struct blkio_policy_type *pol)
64 blkiocg_update_set_idle_time_stats(blkg, pol);
67 static inline void cfq_blkiocg_update_dispatch_stats(struct blkio_group *blkg,
68 struct blkio_policy_type *pol, uint64_t bytes,
69 bool direction, bool sync)
71 blkiocg_update_dispatch_stats(blkg, pol, bytes, direction, sync);
74 static inline void cfq_blkiocg_update_completion_stats(struct blkio_group *blkg,
75 struct blkio_policy_type *pol, uint64_t start_time,
76 uint64_t io_start_time, bool direction, bool sync)
78 blkiocg_update_completion_stats(blkg, pol, start_time, io_start_time,
79 direction, sync);
82 #else /* CFQ_GROUP_IOSCHED */
83 static inline void cfq_blkiocg_update_io_add_stats(struct blkio_group *blkg,
84 struct blkio_policy_type *pol,
85 struct blkio_group *curr_blkg, bool direction,
86 bool sync) { }
87 static inline void cfq_blkiocg_update_dequeue_stats(struct blkio_group *blkg,
88 struct blkio_policy_type *pol, unsigned long dequeue) { }
89 static inline void cfq_blkiocg_update_timeslice_used(struct blkio_group *blkg,
90 struct blkio_policy_type *pol, unsigned long time,
91 unsigned long unaccounted_time) { }
92 static inline void cfq_blkiocg_set_start_empty_time(struct blkio_group *blkg,
93 struct blkio_policy_type *pol) { }
94 static inline void cfq_blkiocg_update_io_remove_stats(struct blkio_group *blkg,
95 struct blkio_policy_type *pol, bool direction,
96 bool sync) { }
97 static inline void cfq_blkiocg_update_io_merged_stats(struct blkio_group *blkg,
98 struct blkio_policy_type *pol, bool direction,
99 bool sync) { }
100 static inline void cfq_blkiocg_update_idle_time_stats(struct blkio_group *blkg,
101 struct blkio_policy_type *pol) { }
102 static inline void
103 cfq_blkiocg_update_avg_queue_size_stats(struct blkio_group *blkg,
104 struct blkio_policy_type *pol) { }
106 static inline void
107 cfq_blkiocg_update_set_idle_time_stats(struct blkio_group *blkg,
108 struct blkio_policy_type *pol) { }
110 static inline void cfq_blkiocg_update_dispatch_stats(struct blkio_group *blkg,
111 struct blkio_policy_type *pol, uint64_t bytes,
112 bool direction, bool sync) { }
113 static inline void cfq_blkiocg_update_completion_stats(struct blkio_group *blkg,
114 struct blkio_policy_type *pol, uint64_t start_time,
115 uint64_t io_start_time, bool direction, bool sync) { }
117 #endif /* CFQ_GROUP_IOSCHED */
118 #endif