History

block: move the bio cgroup associatation helpers to blk-cgroup.c

Keep the cgroup code together.

Christoph Hellwig committed 6 years ago

Commit 28fc5911 parent a18b9b13 files · +101 −107Browse files

Showing the changes to include/linux (1 of 3 files). Show all

Unified · Split

include/linux/blk-cgroup.h+0−30
@@ -183,10 +183,6 @@ extern bool blkcg_debug_stats; · 182 unmodified lines
183 183
184struct blkcg_gq *blkg_lookup_slowpath(struct blkcg *blkcg,184struct blkcg_gq *blkg_lookup_slowpath(struct blkcg *blkcg,
185 struct request_queue *q, bool update_hint);185 struct request_queue *q, bool update_hint);
186struct blkcg_gq *__blkg_lookup_create(struct blkcg *blkcg,
187 struct request_queue *q);
188struct blkcg_gq *blkg_lookup_create(struct blkcg *blkcg,
189 struct request_queue *q);
190int blkcg_init_queue(struct request_queue *q);186int blkcg_init_queue(struct request_queue *q);
191void blkcg_exit_queue(struct request_queue *q);187void blkcg_exit_queue(struct request_queue *q);
192 188
@@ -480,32 +476,6 @@ static inline bool blkg_tryget(struct blkcg_gq *blkg) · 287 unmodified lines
480 return blkg && percpu_ref_tryget(&blkg->refcnt);476 return blkg && percpu_ref_tryget(&blkg->refcnt);
481}477}
482 478
483/**
484 * blkg_tryget_closest - try and get a blkg ref on the closet blkg
485 * @blkg: blkg to get
486 *
487 * This needs to be called rcu protected. As the failure mode here is to walk
488 * up the blkg tree, this ensure that the blkg->parent pointers are always
489 * valid. This returns the blkg that it ended up taking a reference on or %NULL
490 * if no reference was taken.
491 */
492static inline struct blkcg_gq *blkg_tryget_closest(struct blkcg_gq *blkg)
493{
494 struct blkcg_gq *ret_blkg = NULL;
495
496 WARN_ON_ONCE(!rcu_read_lock_held());
497
498 while (blkg) {
499 if (blkg_tryget(blkg)) {
500 ret_blkg = blkg;
501 break;
502 }
503 blkg = blkg->parent;
504 }
505
506 return ret_blkg;
507}
508
509/**479/**
510 * blkg_put - put a blkg reference480 * blkg_put - put a blkg reference
511 * @blkg: blkg to put481 * @blkg: blkg to put