diff options
author | Ben Blum <bblum@andrew.cmu.edu> | 2010-03-10 18:22:11 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-03-12 18:52:36 -0500 |
commit | 67523c48aa74d5637848edeccf285af1c60bf14a (patch) | |
tree | ebd14992e210c8dfb503ae5fdffc1f5392ad52df /block/blk-cgroup.h | |
parent | 8ca712ea84728531d36841ca8f98f9e8680bcf4e (diff) |
cgroups: blkio subsystem as module
Modify the Block I/O cgroup subsystem to be able to be built as a module.
As the CFQ disk scheduler optionally depends on blk-cgroup, config options
in block/Kconfig, block/Kconfig.iosched, and block/blk-cgroup.h are
enhanced to support the new module dependency.
Signed-off-by: Ben Blum <bblum@andrew.cmu.edu>
Cc: Li Zefan <lizf@cn.fujitsu.com>
Cc: Paul Menage <menage@google.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Lai Jiangshan <laijs@cn.fujitsu.com>
Cc: Vivek Goyal <vgoyal@redhat.com>
Cc: Jens Axboe <jens.axboe@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'block/blk-cgroup.h')
-rw-r--r-- | block/blk-cgroup.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/block/blk-cgroup.h b/block/blk-cgroup.h index 84bf745fa775..8ccc20464dae 100644 --- a/block/blk-cgroup.h +++ b/block/blk-cgroup.h | |||
@@ -15,7 +15,13 @@ | |||
15 | 15 | ||
16 | #include <linux/cgroup.h> | 16 | #include <linux/cgroup.h> |
17 | 17 | ||
18 | #ifdef CONFIG_BLK_CGROUP | 18 | #if defined(CONFIG_BLK_CGROUP) || defined(CONFIG_BLK_CGROUP_MODULE) |
19 | |||
20 | #ifndef CONFIG_BLK_CGROUP | ||
21 | /* When blk-cgroup is a module, its subsys_id isn't a compile-time constant */ | ||
22 | extern struct cgroup_subsys blkio_subsys; | ||
23 | #define blkio_subsys_id blkio_subsys.subsys_id | ||
24 | #endif | ||
19 | 25 | ||
20 | struct blkio_cgroup { | 26 | struct blkio_cgroup { |
21 | struct cgroup_subsys_state css; | 27 | struct cgroup_subsys_state css; |
@@ -91,7 +97,7 @@ static inline void blkiocg_update_blkio_group_dequeue_stats( | |||
91 | struct blkio_group *blkg, unsigned long dequeue) {} | 97 | struct blkio_group *blkg, unsigned long dequeue) {} |
92 | #endif | 98 | #endif |
93 | 99 | ||
94 | #ifdef CONFIG_BLK_CGROUP | 100 | #if defined(CONFIG_BLK_CGROUP) || defined(CONFIG_BLK_CGROUP_MODULE) |
95 | extern struct blkio_cgroup blkio_root_cgroup; | 101 | extern struct blkio_cgroup blkio_root_cgroup; |
96 | extern struct blkio_cgroup *cgroup_to_blkio_cgroup(struct cgroup *cgroup); | 102 | extern struct blkio_cgroup *cgroup_to_blkio_cgroup(struct cgroup *cgroup); |
97 | extern void blkiocg_add_blkio_group(struct blkio_cgroup *blkcg, | 103 | extern void blkiocg_add_blkio_group(struct blkio_cgroup *blkcg, |