diff options
Diffstat (limited to 'block/blk-cgroup.c')
-rw-r--r-- | block/blk-cgroup.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c index 73a5525cc0a2..4d4a277b2905 100644 --- a/block/blk-cgroup.c +++ b/block/blk-cgroup.c | |||
@@ -13,16 +13,33 @@ | |||
13 | #include <linux/ioprio.h> | 13 | #include <linux/ioprio.h> |
14 | #include <linux/seq_file.h> | 14 | #include <linux/seq_file.h> |
15 | #include <linux/kdev_t.h> | 15 | #include <linux/kdev_t.h> |
16 | #include <linux/module.h> | ||
16 | #include "blk-cgroup.h" | 17 | #include "blk-cgroup.h" |
17 | #include "cfq-iosched.h" | 18 | #include "cfq-iosched.h" |
18 | 19 | ||
19 | struct blkio_cgroup blkio_root_cgroup = { .weight = 2*BLKIO_WEIGHT_DEFAULT }; | 20 | struct blkio_cgroup blkio_root_cgroup = { .weight = 2*BLKIO_WEIGHT_DEFAULT }; |
21 | EXPORT_SYMBOL_GPL(blkio_root_cgroup); | ||
22 | |||
23 | bool blkiocg_css_tryget(struct blkio_cgroup *blkcg) | ||
24 | { | ||
25 | if (!css_tryget(&blkcg->css)) | ||
26 | return false; | ||
27 | return true; | ||
28 | } | ||
29 | EXPORT_SYMBOL_GPL(blkiocg_css_tryget); | ||
30 | |||
31 | void blkiocg_css_put(struct blkio_cgroup *blkcg) | ||
32 | { | ||
33 | css_put(&blkcg->css); | ||
34 | } | ||
35 | EXPORT_SYMBOL_GPL(blkiocg_css_put); | ||
20 | 36 | ||
21 | struct blkio_cgroup *cgroup_to_blkio_cgroup(struct cgroup *cgroup) | 37 | struct blkio_cgroup *cgroup_to_blkio_cgroup(struct cgroup *cgroup) |
22 | { | 38 | { |
23 | return container_of(cgroup_subsys_state(cgroup, blkio_subsys_id), | 39 | return container_of(cgroup_subsys_state(cgroup, blkio_subsys_id), |
24 | struct blkio_cgroup, css); | 40 | struct blkio_cgroup, css); |
25 | } | 41 | } |
42 | EXPORT_SYMBOL_GPL(cgroup_to_blkio_cgroup); | ||
26 | 43 | ||
27 | void blkiocg_update_blkio_group_stats(struct blkio_group *blkg, | 44 | void blkiocg_update_blkio_group_stats(struct blkio_group *blkg, |
28 | unsigned long time, unsigned long sectors) | 45 | unsigned long time, unsigned long sectors) |
@@ -30,6 +47,7 @@ void blkiocg_update_blkio_group_stats(struct blkio_group *blkg, | |||
30 | blkg->time += time; | 47 | blkg->time += time; |
31 | blkg->sectors += sectors; | 48 | blkg->sectors += sectors; |
32 | } | 49 | } |
50 | EXPORT_SYMBOL_GPL(blkiocg_update_blkio_group_stats); | ||
33 | 51 | ||
34 | void blkiocg_add_blkio_group(struct blkio_cgroup *blkcg, | 52 | void blkiocg_add_blkio_group(struct blkio_cgroup *blkcg, |
35 | struct blkio_group *blkg, void *key, dev_t dev) | 53 | struct blkio_group *blkg, void *key, dev_t dev) |
@@ -47,6 +65,7 @@ void blkiocg_add_blkio_group(struct blkio_cgroup *blkcg, | |||
47 | #endif | 65 | #endif |
48 | blkg->dev = dev; | 66 | blkg->dev = dev; |
49 | } | 67 | } |
68 | EXPORT_SYMBOL_GPL(blkiocg_add_blkio_group); | ||
50 | 69 | ||
51 | static void __blkiocg_del_blkio_group(struct blkio_group *blkg) | 70 | static void __blkiocg_del_blkio_group(struct blkio_group *blkg) |
52 | { | 71 | { |
@@ -81,6 +100,7 @@ out: | |||
81 | rcu_read_unlock(); | 100 | rcu_read_unlock(); |
82 | return ret; | 101 | return ret; |
83 | } | 102 | } |
103 | EXPORT_SYMBOL_GPL(blkiocg_del_blkio_group); | ||
84 | 104 | ||
85 | /* called under rcu_read_lock(). */ | 105 | /* called under rcu_read_lock(). */ |
86 | struct blkio_group *blkiocg_lookup_group(struct blkio_cgroup *blkcg, void *key) | 106 | struct blkio_group *blkiocg_lookup_group(struct blkio_cgroup *blkcg, void *key) |
@@ -97,6 +117,7 @@ struct blkio_group *blkiocg_lookup_group(struct blkio_cgroup *blkcg, void *key) | |||
97 | 117 | ||
98 | return NULL; | 118 | return NULL; |
99 | } | 119 | } |
120 | EXPORT_SYMBOL_GPL(blkiocg_lookup_group); | ||
100 | 121 | ||
101 | #define SHOW_FUNCTION(__VAR) \ | 122 | #define SHOW_FUNCTION(__VAR) \ |
102 | static u64 blkiocg_##__VAR##_read(struct cgroup *cgroup, \ | 123 | static u64 blkiocg_##__VAR##_read(struct cgroup *cgroup, \ |
@@ -166,6 +187,7 @@ void blkiocg_update_blkio_group_dequeue_stats(struct blkio_group *blkg, | |||
166 | { | 187 | { |
167 | blkg->dequeue += dequeue; | 188 | blkg->dequeue += dequeue; |
168 | } | 189 | } |
190 | EXPORT_SYMBOL_GPL(blkiocg_update_blkio_group_dequeue_stats); | ||
169 | #endif | 191 | #endif |
170 | 192 | ||
171 | struct cftype blkio_files[] = { | 193 | struct cftype blkio_files[] = { |