aboutsummaryrefslogtreecommitdiffstats
path: root/block/blk-cgroup.h
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2012-03-05 16:15:28 -0500
committerJens Axboe <axboe@kernel.dk>2012-03-06 15:27:24 -0500
commit4f85cb96d9d2fbbb7160db855a6beee1baced5e5 (patch)
tree5472bba04490da05fa6ca8f780431b37bd7375cb /block/blk-cgroup.h
parent852c788f8365062c8a383c5a93f7f7289977cb50 (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.h4
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
380extern struct blkio_cgroup blkio_root_cgroup; 380extern struct blkio_cgroup blkio_root_cgroup;
381extern struct blkio_cgroup *cgroup_to_blkio_cgroup(struct cgroup *cgroup); 381extern struct blkio_cgroup *cgroup_to_blkio_cgroup(struct cgroup *cgroup);
382extern struct blkio_cgroup *task_blkio_cgroup(struct task_struct *tsk); 382extern struct blkio_cgroup *bio_blkio_cgroup(struct bio *bio);
383extern struct blkio_group *blkg_lookup(struct blkio_cgroup *blkcg, 383extern struct blkio_group *blkg_lookup(struct blkio_cgroup *blkcg,
384 struct request_queue *q); 384 struct request_queue *q);
385struct blkio_group *blkg_lookup_create(struct blkio_cgroup *blkcg, 385struct blkio_group *blkg_lookup_create(struct blkio_cgroup *blkcg,
@@ -413,7 +413,7 @@ struct cgroup;
413static inline struct blkio_cgroup * 413static inline struct blkio_cgroup *
414cgroup_to_blkio_cgroup(struct cgroup *cgroup) { return NULL; } 414cgroup_to_blkio_cgroup(struct cgroup *cgroup) { return NULL; }
415static inline struct blkio_cgroup * 415static inline struct blkio_cgroup *
416task_blkio_cgroup(struct task_struct *tsk) { return NULL; } 416bio_blkio_cgroup(struct bio *bio) { return NULL; }
417 417
418static inline struct blkio_group *blkg_lookup(struct blkio_cgroup *blkcg, 418static inline struct blkio_group *blkg_lookup(struct blkio_cgroup *blkcg,
419 void *key) { return NULL; } 419 void *key) { return NULL; }