1 #ifndef _CFQ_H
2 #define _CFQ_H
3 #include "blk-cgroup.h"
4
5 #ifdef CONFIG_CFQ_GROUP_IOSCHED
cfq_blkiocg_update_io_add_stats(struct blkio_group * blkg,struct blkio_group * curr_blkg,bool direction,bool sync)6 static inline void cfq_blkiocg_update_io_add_stats(struct blkio_group *blkg,
7 struct blkio_group *curr_blkg, bool direction, bool sync)
8 {
9 blkiocg_update_io_add_stats(blkg, curr_blkg, direction, sync);
10 }
11
cfq_blkiocg_update_dequeue_stats(struct blkio_group * blkg,unsigned long dequeue)12 static inline void cfq_blkiocg_update_dequeue_stats(struct blkio_group *blkg,
13 unsigned long dequeue)
14 {
15 blkiocg_update_dequeue_stats(blkg, dequeue);
16 }
17
cfq_blkiocg_update_timeslice_used(struct blkio_group * blkg,unsigned long time,unsigned long unaccounted_time)18 static inline void cfq_blkiocg_update_timeslice_used(struct blkio_group *blkg,
19 unsigned long time, unsigned long unaccounted_time)
20 {
21 blkiocg_update_timeslice_used(blkg, time, unaccounted_time);
22 }
23
cfq_blkiocg_set_start_empty_time(struct blkio_group * blkg)24 static inline void cfq_blkiocg_set_start_empty_time(struct blkio_group *blkg)
25 {
26 blkiocg_set_start_empty_time(blkg);
27 }
28
cfq_blkiocg_update_io_remove_stats(struct blkio_group * blkg,bool direction,bool sync)29 static inline void cfq_blkiocg_update_io_remove_stats(struct blkio_group *blkg,
30 bool direction, bool sync)
31 {
32 blkiocg_update_io_remove_stats(blkg, direction, sync);
33 }
34
cfq_blkiocg_update_io_merged_stats(struct blkio_group * blkg,bool direction,bool sync)35 static inline void cfq_blkiocg_update_io_merged_stats(struct blkio_group *blkg,
36 bool direction, bool sync)
37 {
38 blkiocg_update_io_merged_stats(blkg, direction, sync);
39 }
40
cfq_blkiocg_update_idle_time_stats(struct blkio_group * blkg)41 static inline void cfq_blkiocg_update_idle_time_stats(struct blkio_group *blkg)
42 {
43 blkiocg_update_idle_time_stats(blkg);
44 }
45
46 static inline void
cfq_blkiocg_update_avg_queue_size_stats(struct blkio_group * blkg)47 cfq_blkiocg_update_avg_queue_size_stats(struct blkio_group *blkg)
48 {
49 blkiocg_update_avg_queue_size_stats(blkg);
50 }
51
52 static inline void
cfq_blkiocg_update_set_idle_time_stats(struct blkio_group * blkg)53 cfq_blkiocg_update_set_idle_time_stats(struct blkio_group *blkg)
54 {
55 blkiocg_update_set_idle_time_stats(blkg);
56 }
57
cfq_blkiocg_update_dispatch_stats(struct blkio_group * blkg,uint64_t bytes,bool direction,bool sync)58 static inline void cfq_blkiocg_update_dispatch_stats(struct blkio_group *blkg,
59 uint64_t bytes, bool direction, bool sync)
60 {
61 blkiocg_update_dispatch_stats(blkg, bytes, direction, sync);
62 }
63
cfq_blkiocg_update_completion_stats(struct blkio_group * blkg,uint64_t start_time,uint64_t io_start_time,bool direction,bool sync)64 static inline void cfq_blkiocg_update_completion_stats(struct blkio_group *blkg, uint64_t start_time, uint64_t io_start_time, bool direction, bool sync)
65 {
66 blkiocg_update_completion_stats(blkg, start_time, io_start_time,
67 direction, sync);
68 }
69
cfq_blkiocg_add_blkio_group(struct blkio_cgroup * blkcg,struct blkio_group * blkg,void * key,dev_t dev)70 static inline void cfq_blkiocg_add_blkio_group(struct blkio_cgroup *blkcg,
71 struct blkio_group *blkg, void *key, dev_t dev) {
72 blkiocg_add_blkio_group(blkcg, blkg, key, dev, BLKIO_POLICY_PROP);
73 }
74
cfq_blkiocg_del_blkio_group(struct blkio_group * blkg)75 static inline int cfq_blkiocg_del_blkio_group(struct blkio_group *blkg)
76 {
77 return blkiocg_del_blkio_group(blkg);
78 }
79
80 #else /* CFQ_GROUP_IOSCHED */
cfq_blkiocg_update_io_add_stats(struct blkio_group * blkg,struct blkio_group * curr_blkg,bool direction,bool sync)81 static inline void cfq_blkiocg_update_io_add_stats(struct blkio_group *blkg,
82 struct blkio_group *curr_blkg, bool direction, bool sync) {}
83
cfq_blkiocg_update_dequeue_stats(struct blkio_group * blkg,unsigned long dequeue)84 static inline void cfq_blkiocg_update_dequeue_stats(struct blkio_group *blkg,
85 unsigned long dequeue) {}
86
cfq_blkiocg_update_timeslice_used(struct blkio_group * blkg,unsigned long time,unsigned long unaccounted_time)87 static inline void cfq_blkiocg_update_timeslice_used(struct blkio_group *blkg,
88 unsigned long time, unsigned long unaccounted_time) {}
cfq_blkiocg_set_start_empty_time(struct blkio_group * blkg)89 static inline void cfq_blkiocg_set_start_empty_time(struct blkio_group *blkg) {}
cfq_blkiocg_update_io_remove_stats(struct blkio_group * blkg,bool direction,bool sync)90 static inline void cfq_blkiocg_update_io_remove_stats(struct blkio_group *blkg,
91 bool direction, bool sync) {}
cfq_blkiocg_update_io_merged_stats(struct blkio_group * blkg,bool direction,bool sync)92 static inline void cfq_blkiocg_update_io_merged_stats(struct blkio_group *blkg,
93 bool direction, bool sync) {}
cfq_blkiocg_update_idle_time_stats(struct blkio_group * blkg)94 static inline void cfq_blkiocg_update_idle_time_stats(struct blkio_group *blkg)
95 {
96 }
97 static inline void
cfq_blkiocg_update_avg_queue_size_stats(struct blkio_group * blkg)98 cfq_blkiocg_update_avg_queue_size_stats(struct blkio_group *blkg) {}
99
100 static inline void
cfq_blkiocg_update_set_idle_time_stats(struct blkio_group * blkg)101 cfq_blkiocg_update_set_idle_time_stats(struct blkio_group *blkg) {}
102
cfq_blkiocg_update_dispatch_stats(struct blkio_group * blkg,uint64_t bytes,bool direction,bool sync)103 static inline void cfq_blkiocg_update_dispatch_stats(struct blkio_group *blkg,
104 uint64_t bytes, bool direction, bool sync) {}
cfq_blkiocg_update_completion_stats(struct blkio_group * blkg,uint64_t start_time,uint64_t io_start_time,bool direction,bool sync)105 static inline void cfq_blkiocg_update_completion_stats(struct blkio_group *blkg, uint64_t start_time, uint64_t io_start_time, bool direction, bool sync) {}
106
cfq_blkiocg_add_blkio_group(struct blkio_cgroup * blkcg,struct blkio_group * blkg,void * key,dev_t dev)107 static inline void cfq_blkiocg_add_blkio_group(struct blkio_cgroup *blkcg,
108 struct blkio_group *blkg, void *key, dev_t dev) {}
cfq_blkiocg_del_blkio_group(struct blkio_group * blkg)109 static inline int cfq_blkiocg_del_blkio_group(struct blkio_group *blkg)
110 {
111 return 0;
112 }
113
114 #endif /* CFQ_GROUP_IOSCHED */
115 #endif
116