Vivek Goyal | 31e4c28 | 2009-12-03 12:59:42 -0500 | [diff] [blame] | 1 | #ifndef _BLK_CGROUP_H |
| 2 | #define _BLK_CGROUP_H |
| 3 | /* |
| 4 | * Common Block IO controller cgroup interface |
| 5 | * |
| 6 | * Based on ideas and code from CFQ, CFS and BFQ: |
| 7 | * Copyright (C) 2003 Jens Axboe <axboe@kernel.dk> |
| 8 | * |
| 9 | * Copyright (C) 2008 Fabio Checconi <fabio@gandalf.sssup.it> |
| 10 | * Paolo Valente <paolo.valente@unimore.it> |
| 11 | * |
| 12 | * Copyright (C) 2009 Vivek Goyal <vgoyal@redhat.com> |
| 13 | * Nauman Rafique <nauman@google.com> |
| 14 | */ |
| 15 | |
| 16 | #include <linux/cgroup.h> |
Vivek Goyal | 575969a | 2011-05-19 15:38:29 -0400 | [diff] [blame] | 17 | #include <linux/u64_stats_sync.h> |
Tejun Heo | 829fdb5 | 2012-04-01 14:38:43 -0700 | [diff] [blame] | 18 | #include <linux/seq_file.h> |
Vivek Goyal | 31e4c28 | 2009-12-03 12:59:42 -0500 | [diff] [blame] | 19 | |
Vivek Goyal | 9355aed | 2010-10-01 21:16:41 +0200 | [diff] [blame] | 20 | /* Max limits for throttle policy */ |
| 21 | #define THROTL_IOPS_MAX UINT_MAX |
| 22 | |
Tejun Heo | 3381cb8 | 2012-04-01 14:38:44 -0700 | [diff] [blame] | 23 | /* CFQ specific, out here for blkcg->cfq_weight */ |
| 24 | #define CFQ_WEIGHT_MIN 10 |
| 25 | #define CFQ_WEIGHT_MAX 1000 |
| 26 | #define CFQ_WEIGHT_DEFAULT 500 |
| 27 | |
Tejun Heo | f48ec1d | 2012-04-13 13:11:25 -0700 | [diff] [blame] | 28 | #ifdef CONFIG_BLK_CGROUP |
| 29 | |
Tejun Heo | edcb072 | 2012-04-01 14:38:42 -0700 | [diff] [blame] | 30 | enum blkg_rwstat_type { |
| 31 | BLKG_RWSTAT_READ, |
| 32 | BLKG_RWSTAT_WRITE, |
| 33 | BLKG_RWSTAT_SYNC, |
| 34 | BLKG_RWSTAT_ASYNC, |
| 35 | |
| 36 | BLKG_RWSTAT_NR, |
| 37 | BLKG_RWSTAT_TOTAL = BLKG_RWSTAT_NR, |
Divyesh Shah | 303a3ac | 2010-04-01 15:01:24 -0700 | [diff] [blame] | 38 | }; |
| 39 | |
Vivek Goyal | 31e4c28 | 2009-12-03 12:59:42 -0500 | [diff] [blame] | 40 | struct blkio_cgroup { |
Tejun Heo | 36558c8 | 2012-04-16 13:57:24 -0700 | [diff] [blame^] | 41 | struct cgroup_subsys_state css; |
| 42 | spinlock_t lock; |
| 43 | struct hlist_head blkg_list; |
Tejun Heo | 9a9e8a2 | 2012-03-19 15:10:56 -0700 | [diff] [blame] | 44 | |
| 45 | /* for policies to test whether associated blkcg has changed */ |
Tejun Heo | 36558c8 | 2012-04-16 13:57:24 -0700 | [diff] [blame^] | 46 | uint64_t id; |
Tejun Heo | 3381cb8 | 2012-04-01 14:38:44 -0700 | [diff] [blame] | 47 | |
| 48 | /* TODO: per-policy storage in blkio_cgroup */ |
Tejun Heo | 36558c8 | 2012-04-16 13:57:24 -0700 | [diff] [blame^] | 49 | unsigned int cfq_weight; /* belongs to cfq */ |
Vivek Goyal | 31e4c28 | 2009-12-03 12:59:42 -0500 | [diff] [blame] | 50 | }; |
| 51 | |
Tejun Heo | edcb072 | 2012-04-01 14:38:42 -0700 | [diff] [blame] | 52 | struct blkg_stat { |
| 53 | struct u64_stats_sync syncp; |
| 54 | uint64_t cnt; |
| 55 | }; |
| 56 | |
| 57 | struct blkg_rwstat { |
| 58 | struct u64_stats_sync syncp; |
| 59 | uint64_t cnt[BLKG_RWSTAT_NR]; |
| 60 | }; |
| 61 | |
Tejun Heo | 0381411 | 2012-03-05 13:15:14 -0800 | [diff] [blame] | 62 | /* per-blkg per-policy data */ |
| 63 | struct blkg_policy_data { |
| 64 | /* the blkg this per-policy data belongs to */ |
Tejun Heo | 36558c8 | 2012-04-16 13:57:24 -0700 | [diff] [blame^] | 65 | struct blkio_group *blkg; |
Tejun Heo | 0381411 | 2012-03-05 13:15:14 -0800 | [diff] [blame] | 66 | |
Tejun Heo | a2b1693 | 2012-04-13 13:11:33 -0700 | [diff] [blame] | 67 | /* used during policy activation */ |
Tejun Heo | 36558c8 | 2012-04-16 13:57:24 -0700 | [diff] [blame^] | 68 | struct list_head alloc_node; |
Tejun Heo | a2b1693 | 2012-04-13 13:11:33 -0700 | [diff] [blame] | 69 | |
Tejun Heo | 0381411 | 2012-03-05 13:15:14 -0800 | [diff] [blame] | 70 | /* pol->pdata_size bytes of private data used by policy impl */ |
Tejun Heo | 36558c8 | 2012-04-16 13:57:24 -0700 | [diff] [blame^] | 71 | char pdata[] __aligned(__alignof__(unsigned long long)); |
Tejun Heo | 0381411 | 2012-03-05 13:15:14 -0800 | [diff] [blame] | 72 | }; |
| 73 | |
Vivek Goyal | 31e4c28 | 2009-12-03 12:59:42 -0500 | [diff] [blame] | 74 | struct blkio_group { |
Tejun Heo | c875f4d | 2012-03-05 13:15:22 -0800 | [diff] [blame] | 75 | /* Pointer to the associated request_queue */ |
Tejun Heo | 36558c8 | 2012-04-16 13:57:24 -0700 | [diff] [blame^] | 76 | struct request_queue *q; |
| 77 | struct list_head q_node; |
| 78 | struct hlist_node blkcg_node; |
| 79 | struct blkio_cgroup *blkcg; |
Tejun Heo | 1adaf3d | 2012-03-05 13:15:15 -0800 | [diff] [blame] | 80 | /* reference count */ |
Tejun Heo | 36558c8 | 2012-04-16 13:57:24 -0700 | [diff] [blame^] | 81 | int refcnt; |
Vivek Goyal | 2208419 | 2009-12-03 12:59:49 -0500 | [diff] [blame] | 82 | |
Tejun Heo | 36558c8 | 2012-04-16 13:57:24 -0700 | [diff] [blame^] | 83 | struct blkg_policy_data *pd[BLKCG_MAX_POLS]; |
Tejun Heo | 1adaf3d | 2012-03-05 13:15:15 -0800 | [diff] [blame] | 84 | |
Tejun Heo | 36558c8 | 2012-04-16 13:57:24 -0700 | [diff] [blame^] | 85 | struct rcu_head rcu_head; |
Vivek Goyal | 31e4c28 | 2009-12-03 12:59:42 -0500 | [diff] [blame] | 86 | }; |
| 87 | |
Tejun Heo | 0381411 | 2012-03-05 13:15:14 -0800 | [diff] [blame] | 88 | typedef void (blkio_init_group_fn)(struct blkio_group *blkg); |
Tejun Heo | 9ade5ea | 2012-04-01 14:38:44 -0700 | [diff] [blame] | 89 | typedef void (blkio_exit_group_fn)(struct blkio_group *blkg); |
| 90 | typedef void (blkio_reset_group_stats_fn)(struct blkio_group *blkg); |
Vivek Goyal | 3e25206 | 2009-12-04 10:36:42 -0500 | [diff] [blame] | 91 | |
| 92 | struct blkio_policy_ops { |
Tejun Heo | 36558c8 | 2012-04-16 13:57:24 -0700 | [diff] [blame^] | 93 | blkio_init_group_fn *blkio_init_group_fn; |
| 94 | blkio_exit_group_fn *blkio_exit_group_fn; |
| 95 | blkio_reset_group_stats_fn *blkio_reset_group_stats_fn; |
Vivek Goyal | 3e25206 | 2009-12-04 10:36:42 -0500 | [diff] [blame] | 96 | }; |
| 97 | |
| 98 | struct blkio_policy_type { |
Tejun Heo | 36558c8 | 2012-04-16 13:57:24 -0700 | [diff] [blame^] | 99 | struct blkio_policy_ops ops; |
| 100 | int plid; |
| 101 | /* policy specific private data size */ |
| 102 | size_t pdata_size; |
| 103 | /* cgroup files for the policy */ |
| 104 | struct cftype *cftypes; |
Vivek Goyal | 3e25206 | 2009-12-04 10:36:42 -0500 | [diff] [blame] | 105 | }; |
| 106 | |
Tejun Heo | 36558c8 | 2012-04-16 13:57:24 -0700 | [diff] [blame^] | 107 | extern struct blkio_cgroup blkio_root_cgroup; |
| 108 | |
| 109 | struct blkio_cgroup *cgroup_to_blkio_cgroup(struct cgroup *cgroup); |
| 110 | struct blkio_cgroup *bio_blkio_cgroup(struct bio *bio); |
| 111 | struct blkio_group *blkg_lookup(struct blkio_cgroup *blkcg, |
| 112 | struct request_queue *q); |
| 113 | struct blkio_group *blkg_lookup_create(struct blkio_cgroup *blkcg, |
| 114 | struct request_queue *q); |
| 115 | int blkcg_init_queue(struct request_queue *q); |
| 116 | void blkcg_drain_queue(struct request_queue *q); |
| 117 | void blkcg_exit_queue(struct request_queue *q); |
Tejun Heo | 5efd611 | 2012-03-05 13:15:12 -0800 | [diff] [blame] | 118 | |
Vivek Goyal | 3e25206 | 2009-12-04 10:36:42 -0500 | [diff] [blame] | 119 | /* Blkio controller policy registration */ |
Tejun Heo | 36558c8 | 2012-04-16 13:57:24 -0700 | [diff] [blame^] | 120 | int blkio_policy_register(struct blkio_policy_type *); |
| 121 | void blkio_policy_unregister(struct blkio_policy_type *); |
| 122 | int blkcg_activate_policy(struct request_queue *q, |
| 123 | const struct blkio_policy_type *pol); |
| 124 | void blkcg_deactivate_policy(struct request_queue *q, |
| 125 | const struct blkio_policy_type *pol); |
Vivek Goyal | 3e25206 | 2009-12-04 10:36:42 -0500 | [diff] [blame] | 126 | |
Tejun Heo | 829fdb5 | 2012-04-01 14:38:43 -0700 | [diff] [blame] | 127 | void blkcg_print_blkgs(struct seq_file *sf, struct blkio_cgroup *blkcg, |
Tejun Heo | d366e7e | 2012-04-01 14:38:44 -0700 | [diff] [blame] | 128 | u64 (*prfill)(struct seq_file *, void *, int), |
Tejun Heo | ec39934 | 2012-04-13 13:11:27 -0700 | [diff] [blame] | 129 | const struct blkio_policy_type *pol, int data, |
| 130 | bool show_total); |
Tejun Heo | d366e7e | 2012-04-01 14:38:44 -0700 | [diff] [blame] | 131 | u64 __blkg_prfill_u64(struct seq_file *sf, void *pdata, u64 v); |
| 132 | u64 __blkg_prfill_rwstat(struct seq_file *sf, void *pdata, |
Tejun Heo | 829fdb5 | 2012-04-01 14:38:43 -0700 | [diff] [blame] | 133 | const struct blkg_rwstat *rwstat); |
Tejun Heo | 5bc4afb1 | 2012-04-01 14:38:45 -0700 | [diff] [blame] | 134 | u64 blkg_prfill_stat(struct seq_file *sf, void *pdata, int off); |
| 135 | u64 blkg_prfill_rwstat(struct seq_file *sf, void *pdata, int off); |
Tejun Heo | 829fdb5 | 2012-04-01 14:38:43 -0700 | [diff] [blame] | 136 | |
| 137 | struct blkg_conf_ctx { |
Tejun Heo | 36558c8 | 2012-04-16 13:57:24 -0700 | [diff] [blame^] | 138 | struct gendisk *disk; |
| 139 | struct blkio_group *blkg; |
| 140 | u64 v; |
Tejun Heo | 829fdb5 | 2012-04-01 14:38:43 -0700 | [diff] [blame] | 141 | }; |
| 142 | |
Tejun Heo | da8b066 | 2012-04-13 13:11:29 -0700 | [diff] [blame] | 143 | int blkg_conf_prep(struct blkio_cgroup *blkcg, |
| 144 | const struct blkio_policy_type *pol, const char *input, |
Tejun Heo | 829fdb5 | 2012-04-01 14:38:43 -0700 | [diff] [blame] | 145 | struct blkg_conf_ctx *ctx); |
| 146 | void blkg_conf_finish(struct blkg_conf_ctx *ctx); |
| 147 | |
| 148 | |
Tejun Heo | 0381411 | 2012-03-05 13:15:14 -0800 | [diff] [blame] | 149 | /** |
| 150 | * blkg_to_pdata - get policy private data |
| 151 | * @blkg: blkg of interest |
| 152 | * @pol: policy of interest |
| 153 | * |
| 154 | * Return pointer to private data associated with the @blkg-@pol pair. |
| 155 | */ |
| 156 | static inline void *blkg_to_pdata(struct blkio_group *blkg, |
| 157 | struct blkio_policy_type *pol) |
| 158 | { |
Tejun Heo | 549d3aa | 2012-03-05 13:15:16 -0800 | [diff] [blame] | 159 | return blkg ? blkg->pd[pol->plid]->pdata : NULL; |
Tejun Heo | 0381411 | 2012-03-05 13:15:14 -0800 | [diff] [blame] | 160 | } |
| 161 | |
| 162 | /** |
| 163 | * pdata_to_blkg - get blkg associated with policy private data |
| 164 | * @pdata: policy private data of interest |
Tejun Heo | 0381411 | 2012-03-05 13:15:14 -0800 | [diff] [blame] | 165 | * |
Tejun Heo | aaec55a | 2012-04-01 14:38:42 -0700 | [diff] [blame] | 166 | * @pdata is policy private data. Determine the blkg it's associated with. |
Tejun Heo | 0381411 | 2012-03-05 13:15:14 -0800 | [diff] [blame] | 167 | */ |
Tejun Heo | aaec55a | 2012-04-01 14:38:42 -0700 | [diff] [blame] | 168 | static inline struct blkio_group *pdata_to_blkg(void *pdata) |
Tejun Heo | 0381411 | 2012-03-05 13:15:14 -0800 | [diff] [blame] | 169 | { |
| 170 | if (pdata) { |
| 171 | struct blkg_policy_data *pd = |
| 172 | container_of(pdata, struct blkg_policy_data, pdata); |
| 173 | return pd->blkg; |
| 174 | } |
| 175 | return NULL; |
| 176 | } |
| 177 | |
Tejun Heo | 54e7ed1 | 2012-04-16 13:57:23 -0700 | [diff] [blame] | 178 | /** |
| 179 | * blkg_path - format cgroup path of blkg |
| 180 | * @blkg: blkg of interest |
| 181 | * @buf: target buffer |
| 182 | * @buflen: target buffer length |
| 183 | * |
| 184 | * Format the path of the cgroup of @blkg into @buf. |
| 185 | */ |
| 186 | static inline int blkg_path(struct blkio_group *blkg, char *buf, int buflen) |
Vivek Goyal | afc24d4 | 2010-04-26 19:27:56 +0200 | [diff] [blame] | 187 | { |
Tejun Heo | 54e7ed1 | 2012-04-16 13:57:23 -0700 | [diff] [blame] | 188 | int ret; |
| 189 | |
| 190 | rcu_read_lock(); |
| 191 | ret = cgroup_path(blkg->blkcg->css.cgroup, buf, buflen); |
| 192 | rcu_read_unlock(); |
| 193 | if (ret) |
| 194 | strncpy(buf, "<unavailable>", buflen); |
| 195 | return ret; |
Vivek Goyal | afc24d4 | 2010-04-26 19:27:56 +0200 | [diff] [blame] | 196 | } |
| 197 | |
Tejun Heo | 1adaf3d | 2012-03-05 13:15:15 -0800 | [diff] [blame] | 198 | /** |
| 199 | * blkg_get - get a blkg reference |
| 200 | * @blkg: blkg to get |
| 201 | * |
| 202 | * The caller should be holding queue_lock and an existing reference. |
| 203 | */ |
| 204 | static inline void blkg_get(struct blkio_group *blkg) |
| 205 | { |
| 206 | lockdep_assert_held(blkg->q->queue_lock); |
| 207 | WARN_ON_ONCE(!blkg->refcnt); |
| 208 | blkg->refcnt++; |
| 209 | } |
| 210 | |
| 211 | void __blkg_release(struct blkio_group *blkg); |
| 212 | |
| 213 | /** |
| 214 | * blkg_put - put a blkg reference |
| 215 | * @blkg: blkg to put |
| 216 | * |
| 217 | * The caller should be holding queue_lock. |
| 218 | */ |
| 219 | static inline void blkg_put(struct blkio_group *blkg) |
| 220 | { |
| 221 | lockdep_assert_held(blkg->q->queue_lock); |
| 222 | WARN_ON_ONCE(blkg->refcnt <= 0); |
| 223 | if (!--blkg->refcnt) |
| 224 | __blkg_release(blkg); |
| 225 | } |
| 226 | |
Tejun Heo | edcb072 | 2012-04-01 14:38:42 -0700 | [diff] [blame] | 227 | /** |
| 228 | * blkg_stat_add - add a value to a blkg_stat |
| 229 | * @stat: target blkg_stat |
| 230 | * @val: value to add |
| 231 | * |
| 232 | * Add @val to @stat. The caller is responsible for synchronizing calls to |
| 233 | * this function. |
| 234 | */ |
| 235 | static inline void blkg_stat_add(struct blkg_stat *stat, uint64_t val) |
| 236 | { |
| 237 | u64_stats_update_begin(&stat->syncp); |
| 238 | stat->cnt += val; |
| 239 | u64_stats_update_end(&stat->syncp); |
| 240 | } |
| 241 | |
| 242 | /** |
| 243 | * blkg_stat_read - read the current value of a blkg_stat |
| 244 | * @stat: blkg_stat to read |
| 245 | * |
| 246 | * Read the current value of @stat. This function can be called without |
| 247 | * synchroniztion and takes care of u64 atomicity. |
| 248 | */ |
| 249 | static inline uint64_t blkg_stat_read(struct blkg_stat *stat) |
| 250 | { |
| 251 | unsigned int start; |
| 252 | uint64_t v; |
| 253 | |
| 254 | do { |
| 255 | start = u64_stats_fetch_begin(&stat->syncp); |
| 256 | v = stat->cnt; |
| 257 | } while (u64_stats_fetch_retry(&stat->syncp, start)); |
| 258 | |
| 259 | return v; |
| 260 | } |
| 261 | |
| 262 | /** |
| 263 | * blkg_stat_reset - reset a blkg_stat |
| 264 | * @stat: blkg_stat to reset |
| 265 | */ |
| 266 | static inline void blkg_stat_reset(struct blkg_stat *stat) |
| 267 | { |
| 268 | stat->cnt = 0; |
| 269 | } |
| 270 | |
| 271 | /** |
| 272 | * blkg_rwstat_add - add a value to a blkg_rwstat |
| 273 | * @rwstat: target blkg_rwstat |
| 274 | * @rw: mask of REQ_{WRITE|SYNC} |
| 275 | * @val: value to add |
| 276 | * |
| 277 | * Add @val to @rwstat. The counters are chosen according to @rw. The |
| 278 | * caller is responsible for synchronizing calls to this function. |
| 279 | */ |
| 280 | static inline void blkg_rwstat_add(struct blkg_rwstat *rwstat, |
| 281 | int rw, uint64_t val) |
| 282 | { |
| 283 | u64_stats_update_begin(&rwstat->syncp); |
| 284 | |
| 285 | if (rw & REQ_WRITE) |
| 286 | rwstat->cnt[BLKG_RWSTAT_WRITE] += val; |
| 287 | else |
| 288 | rwstat->cnt[BLKG_RWSTAT_READ] += val; |
| 289 | if (rw & REQ_SYNC) |
| 290 | rwstat->cnt[BLKG_RWSTAT_SYNC] += val; |
| 291 | else |
| 292 | rwstat->cnt[BLKG_RWSTAT_ASYNC] += val; |
| 293 | |
| 294 | u64_stats_update_end(&rwstat->syncp); |
| 295 | } |
| 296 | |
| 297 | /** |
| 298 | * blkg_rwstat_read - read the current values of a blkg_rwstat |
| 299 | * @rwstat: blkg_rwstat to read |
| 300 | * |
| 301 | * Read the current snapshot of @rwstat and return it as the return value. |
| 302 | * This function can be called without synchronization and takes care of |
| 303 | * u64 atomicity. |
| 304 | */ |
Tejun Heo | c94bed89 | 2012-04-16 13:57:22 -0700 | [diff] [blame] | 305 | static inline struct blkg_rwstat blkg_rwstat_read(struct blkg_rwstat *rwstat) |
Tejun Heo | edcb072 | 2012-04-01 14:38:42 -0700 | [diff] [blame] | 306 | { |
| 307 | unsigned int start; |
| 308 | struct blkg_rwstat tmp; |
| 309 | |
| 310 | do { |
| 311 | start = u64_stats_fetch_begin(&rwstat->syncp); |
| 312 | tmp = *rwstat; |
| 313 | } while (u64_stats_fetch_retry(&rwstat->syncp, start)); |
| 314 | |
| 315 | return tmp; |
| 316 | } |
| 317 | |
| 318 | /** |
| 319 | * blkg_rwstat_sum - read the total count of a blkg_rwstat |
| 320 | * @rwstat: blkg_rwstat to read |
| 321 | * |
| 322 | * Return the total count of @rwstat regardless of the IO direction. This |
| 323 | * function can be called without synchronization and takes care of u64 |
| 324 | * atomicity. |
| 325 | */ |
| 326 | static inline uint64_t blkg_rwstat_sum(struct blkg_rwstat *rwstat) |
| 327 | { |
| 328 | struct blkg_rwstat tmp = blkg_rwstat_read(rwstat); |
| 329 | |
| 330 | return tmp.cnt[BLKG_RWSTAT_READ] + tmp.cnt[BLKG_RWSTAT_WRITE]; |
| 331 | } |
| 332 | |
| 333 | /** |
| 334 | * blkg_rwstat_reset - reset a blkg_rwstat |
| 335 | * @rwstat: blkg_rwstat to reset |
| 336 | */ |
| 337 | static inline void blkg_rwstat_reset(struct blkg_rwstat *rwstat) |
| 338 | { |
| 339 | memset(rwstat->cnt, 0, sizeof(rwstat->cnt)); |
| 340 | } |
| 341 | |
Tejun Heo | 36558c8 | 2012-04-16 13:57:24 -0700 | [diff] [blame^] | 342 | #else /* CONFIG_BLK_CGROUP */ |
| 343 | |
| 344 | struct cgroup; |
Jens Axboe | 2f5ea47 | 2009-12-03 21:06:43 +0100 | [diff] [blame] | 345 | |
| 346 | struct blkio_group { |
| 347 | }; |
| 348 | |
Vivek Goyal | 3e25206 | 2009-12-04 10:36:42 -0500 | [diff] [blame] | 349 | struct blkio_policy_type { |
| 350 | }; |
| 351 | |
Tejun Heo | 36558c8 | 2012-04-16 13:57:24 -0700 | [diff] [blame^] | 352 | static inline struct blkio_cgroup *cgroup_to_blkio_cgroup(struct cgroup *cgroup) { return NULL; } |
| 353 | static inline struct blkio_cgroup *bio_blkio_cgroup(struct bio *bio) { return NULL; } |
| 354 | static inline struct blkio_group *blkg_lookup(struct blkio_cgroup *blkcg, void *key) { return NULL; } |
Tejun Heo | 5efd611 | 2012-03-05 13:15:12 -0800 | [diff] [blame] | 355 | static inline int blkcg_init_queue(struct request_queue *q) { return 0; } |
| 356 | static inline void blkcg_drain_queue(struct request_queue *q) { } |
| 357 | static inline void blkcg_exit_queue(struct request_queue *q) { } |
Tejun Heo | 8bd435b | 2012-04-13 13:11:28 -0700 | [diff] [blame] | 358 | static inline int blkio_policy_register(struct blkio_policy_type *blkiop) { return 0; } |
Vivek Goyal | 3e25206 | 2009-12-04 10:36:42 -0500 | [diff] [blame] | 359 | static inline void blkio_policy_unregister(struct blkio_policy_type *blkiop) { } |
Tejun Heo | a2b1693 | 2012-04-13 13:11:33 -0700 | [diff] [blame] | 360 | static inline int blkcg_activate_policy(struct request_queue *q, |
| 361 | const struct blkio_policy_type *pol) { return 0; } |
| 362 | static inline void blkcg_deactivate_policy(struct request_queue *q, |
| 363 | const struct blkio_policy_type *pol) { } |
Vivek Goyal | 3e25206 | 2009-12-04 10:36:42 -0500 | [diff] [blame] | 364 | |
Tejun Heo | 0381411 | 2012-03-05 13:15:14 -0800 | [diff] [blame] | 365 | static inline void *blkg_to_pdata(struct blkio_group *blkg, |
| 366 | struct blkio_policy_type *pol) { return NULL; } |
| 367 | static inline struct blkio_group *pdata_to_blkg(void *pdata, |
| 368 | struct blkio_policy_type *pol) { return NULL; } |
Vivek Goyal | afc24d4 | 2010-04-26 19:27:56 +0200 | [diff] [blame] | 369 | static inline char *blkg_path(struct blkio_group *blkg) { return NULL; } |
Tejun Heo | 1adaf3d | 2012-03-05 13:15:15 -0800 | [diff] [blame] | 370 | static inline void blkg_get(struct blkio_group *blkg) { } |
| 371 | static inline void blkg_put(struct blkio_group *blkg) { } |
Vivek Goyal | afc24d4 | 2010-04-26 19:27:56 +0200 | [diff] [blame] | 372 | |
Tejun Heo | 36558c8 | 2012-04-16 13:57:24 -0700 | [diff] [blame^] | 373 | #endif /* CONFIG_BLK_CGROUP */ |
| 374 | #endif /* _BLK_CGROUP_H */ |