diff options
author | Tejun Heo <tj@kernel.org> | 2012-03-05 16:15:28 -0500 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2012-03-06 15:27:24 -0500 |
commit | 4f85cb96d9d2fbbb7160db855a6beee1baced5e5 (patch) | |
tree | 5472bba04490da05fa6ca8f780431b37bd7375cb /block/blk-cgroup.h | |
parent | 852c788f8365062c8a383c5a93f7f7289977cb50 (diff) |
block: make block cgroup policies follow bio task association
Implement bio_blkio_cgroup() which returns the blkcg associated with
the bio if exists or %current's blkcg, and use it in blk-throttle and
cfq-iosched propio. This makes both cgroup policies honor task
association for the bio instead of always assuming %current.
As nobody is using bio_set_task() yet, this doesn't introduce any
behavior change.
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Vivek Goyal <vgoyal@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/blk-cgroup.h')
-rw-r--r-- | block/blk-cgroup.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/block/blk-cgroup.h b/block/blk-cgroup.h index 66eaefefcbd2..98cd8533378f 100644 --- a/block/blk-cgroup.h +++ b/block/blk-cgroup.h | |||
@@ -379,7 +379,7 @@ static inline void blkiocg_set_start_empty_time(struct blkio_group *blkg, | |||
379 | #ifdef CONFIG_BLK_CGROUP | 379 | #ifdef CONFIG_BLK_CGROUP |
380 | extern struct blkio_cgroup blkio_root_cgroup; | 380 | extern struct blkio_cgroup blkio_root_cgroup; |
381 | extern struct blkio_cgroup *cgroup_to_blkio_cgroup(struct cgroup *cgroup); | 381 | extern struct blkio_cgroup *cgroup_to_blkio_cgroup(struct cgroup *cgroup); |
382 | extern struct blkio_cgroup *task_blkio_cgroup(struct task_struct *tsk); | 382 | extern struct blkio_cgroup *bio_blkio_cgroup(struct bio *bio); |
383 | extern struct blkio_group *blkg_lookup(struct blkio_cgroup *blkcg, | 383 | extern struct blkio_group *blkg_lookup(struct blkio_cgroup *blkcg, |
384 | struct request_queue *q); | 384 | struct request_queue *q); |
385 | struct blkio_group *blkg_lookup_create(struct blkio_cgroup *blkcg, | 385 | struct blkio_group *blkg_lookup_create(struct blkio_cgroup *blkcg, |
@@ -413,7 +413,7 @@ struct cgroup; | |||
413 | static inline struct blkio_cgroup * | 413 | static inline struct blkio_cgroup * |
414 | cgroup_to_blkio_cgroup(struct cgroup *cgroup) { return NULL; } | 414 | cgroup_to_blkio_cgroup(struct cgroup *cgroup) { return NULL; } |
415 | static inline struct blkio_cgroup * | 415 | static inline struct blkio_cgroup * |
416 | task_blkio_cgroup(struct task_struct *tsk) { return NULL; } | 416 | bio_blkio_cgroup(struct bio *bio) { return NULL; } |
417 | 417 | ||
418 | static inline struct blkio_group *blkg_lookup(struct blkio_cgroup *blkcg, | 418 | static inline struct blkio_group *blkg_lookup(struct blkio_cgroup *blkcg, |
419 | void *key) { return NULL; } | 419 | void *key) { return NULL; } |