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
257 blkg = rcu_dereference(blkcg->blkg_hint); in blkg_lookup()
258 if (blkg && blkg->q == q) in blkg_lookup()
259 return blkg; in blkg_lookup()
261 blkg = radix_tree_lookup(&blkcg->blkg_tree, q->id); in blkg_lookup()
262 if (blkg && blkg->q != q) in blkg_lookup()
263 blkg = NULL; in blkg_lookup()
264 return blkg; in blkg_lookup()
274 static inline struct blkg_policy_data *blkg_to_pd(struct blkcg_gq *blkg, in blkg_to_pd() argument
277 return blkg ? blkg->pd[pol->plid] : NULL; in blkg_to_pd()
294 return pd ? pd->blkg : NULL; in pd_to_blkg()
310 static inline int blkg_path(struct blkcg_gq *blkg, char *buf, int buflen) in blkg_path() argument
312 return cgroup_path(blkg->blkcg->css.cgroup, buf, buflen); in blkg_path()
321 static inline void blkg_get(struct blkcg_gq *blkg) in blkg_get() argument
323 percpu_ref_get(&blkg->refcnt); in blkg_get()
333 static inline bool blkg_tryget(struct blkcg_gq *blkg) in blkg_tryget() argument
335 return blkg && percpu_ref_tryget(&blkg->refcnt); in blkg_tryget()
342 static inline void blkg_put(struct blkcg_gq *blkg) in blkg_put() argument
344 percpu_ref_put(&blkg->refcnt); in blkg_put()
384 static inline void blkcg_use_delay(struct blkcg_gq *blkg) in blkcg_use_delay() argument
386 if (WARN_ON_ONCE(atomic_read(&blkg->use_delay) < 0)) in blkcg_use_delay()
388 if (atomic_add_return(1, &blkg->use_delay) == 1) in blkcg_use_delay()
389 atomic_inc(&blkg->blkcg->css.cgroup->congestion_count); in blkcg_use_delay()
392 static inline int blkcg_unuse_delay(struct blkcg_gq *blkg) in blkcg_unuse_delay() argument
394 int old = atomic_read(&blkg->use_delay); in blkcg_unuse_delay()
408 while (old && !atomic_try_cmpxchg(&blkg->use_delay, &old, old - 1)) in blkcg_unuse_delay()
414 atomic_dec(&blkg->blkcg->css.cgroup->congestion_count); in blkcg_unuse_delay()
427 static inline void blkcg_set_delay(struct blkcg_gq *blkg, u64 delay) in blkcg_set_delay() argument
429 int old = atomic_read(&blkg->use_delay); in blkcg_set_delay()
432 if (!old && atomic_try_cmpxchg(&blkg->use_delay, &old, -1)) in blkcg_set_delay()
433 atomic_inc(&blkg->blkcg->css.cgroup->congestion_count); in blkcg_set_delay()
435 atomic64_set(&blkg->delay_nsec, delay); in blkcg_set_delay()
444 static inline void blkcg_clear_delay(struct blkcg_gq *blkg) in blkcg_clear_delay() argument
446 int old = atomic_read(&blkg->use_delay); in blkcg_clear_delay()
449 if (old && atomic_try_cmpxchg(&blkg->use_delay, &old, 0)) in blkcg_clear_delay()
450 atomic_dec(&blkg->blkcg->css.cgroup->congestion_count); in blkcg_clear_delay()
469 void blkcg_add_delay(struct blkcg_gq *blkg, u64 now, u64 delta);
494 static inline struct blkg_policy_data *blkg_to_pd(struct blkcg_gq *blkg, in blkg_to_pd() argument
497 static inline char *blkg_path(struct blkcg_gq *blkg) { return NULL; } in blkg_path() argument
498 static inline void blkg_get(struct blkcg_gq *blkg) { } in blkg_get() argument
499 static inline void blkg_put(struct blkcg_gq *blkg) { } in blkg_put() argument