Lines Matching refs:blkg
47 struct blkcg_gq *blkg; member
137 struct blkcg_gq *blkg; member
201 const char *blkg_dev_name(struct blkcg_gq *blkg);
213 struct blkcg_gq *blkg; member
250 struct blkcg_gq *blkg; in blkg_lookup() local
255 blkg = rcu_dereference_check(blkcg->blkg_hint, in blkg_lookup()
257 if (blkg && blkg->q == q) in blkg_lookup()
258 return blkg; in blkg_lookup()
260 blkg = radix_tree_lookup(&blkcg->blkg_tree, q->id); in blkg_lookup()
261 if (blkg && blkg->q != q) in blkg_lookup()
262 blkg = NULL; in blkg_lookup()
263 return blkg; in blkg_lookup()
273 static inline struct blkg_policy_data *blkg_to_pd(struct blkcg_gq *blkg, in blkg_to_pd() argument
276 return blkg ? blkg->pd[pol->plid] : NULL; in blkg_to_pd()
293 return pd ? pd->blkg : NULL; in pd_to_blkg()
309 static inline int blkg_path(struct blkcg_gq *blkg, char *buf, int buflen) in blkg_path() argument
311 return cgroup_path(blkg->blkcg->css.cgroup, buf, buflen); in blkg_path()
320 static inline void blkg_get(struct blkcg_gq *blkg) in blkg_get() argument
322 percpu_ref_get(&blkg->refcnt); in blkg_get()
332 static inline bool blkg_tryget(struct blkcg_gq *blkg) in blkg_tryget() argument
334 return blkg && percpu_ref_tryget(&blkg->refcnt); in blkg_tryget()
341 static inline void blkg_put(struct blkcg_gq *blkg) in blkg_put() argument
343 percpu_ref_put(&blkg->refcnt); in blkg_put()
383 static inline void blkcg_use_delay(struct blkcg_gq *blkg) in blkcg_use_delay() argument
385 if (WARN_ON_ONCE(atomic_read(&blkg->use_delay) < 0)) in blkcg_use_delay()
387 if (atomic_add_return(1, &blkg->use_delay) == 1) in blkcg_use_delay()
388 atomic_inc(&blkg->blkcg->css.cgroup->congestion_count); in blkcg_use_delay()
391 static inline int blkcg_unuse_delay(struct blkcg_gq *blkg) in blkcg_unuse_delay() argument
393 int old = atomic_read(&blkg->use_delay); in blkcg_unuse_delay()
407 while (old && !atomic_try_cmpxchg(&blkg->use_delay, &old, old - 1)) in blkcg_unuse_delay()
413 atomic_dec(&blkg->blkcg->css.cgroup->congestion_count); in blkcg_unuse_delay()
426 static inline void blkcg_set_delay(struct blkcg_gq *blkg, u64 delay) in blkcg_set_delay() argument
428 int old = atomic_read(&blkg->use_delay); in blkcg_set_delay()
431 if (!old && atomic_try_cmpxchg(&blkg->use_delay, &old, -1)) in blkcg_set_delay()
432 atomic_inc(&blkg->blkcg->css.cgroup->congestion_count); in blkcg_set_delay()
434 atomic64_set(&blkg->delay_nsec, delay); in blkcg_set_delay()
443 static inline void blkcg_clear_delay(struct blkcg_gq *blkg) in blkcg_clear_delay() argument
445 int old = atomic_read(&blkg->use_delay); in blkcg_clear_delay()
448 if (old && atomic_try_cmpxchg(&blkg->use_delay, &old, 0)) in blkcg_clear_delay()
449 atomic_dec(&blkg->blkcg->css.cgroup->congestion_count); in blkcg_clear_delay()
468 void blkcg_add_delay(struct blkcg_gq *blkg, u64 now, u64 delta);
493 static inline struct blkg_policy_data *blkg_to_pd(struct blkcg_gq *blkg, in blkg_to_pd() argument
496 static inline char *blkg_path(struct blkcg_gq *blkg) { return NULL; } in blkg_path() argument
497 static inline void blkg_get(struct blkcg_gq *blkg) { } in blkg_get() argument
498 static inline void blkg_put(struct blkcg_gq *blkg) { } in blkg_put() argument