diff options
author | Tejun Heo <tj@kernel.org> | 2012-04-16 16:57:23 -0400 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2012-04-20 04:06:16 -0400 |
commit | 54e7ed12bad1e3aa2a28558fab6850240465f973 (patch) | |
tree | 907eb0451782f4eb1ad3f9236e51ec4acb7fb941 /block/blk-cgroup.h | |
parent | c94bed89995e638e43a6663177358b9d20617361 (diff) |
blkcg: remove blkio_group->path[]
blkio_group->path[] stores the path of the associated cgroup and is
used only for debug messages. Just format the path from blkg->cgroup
when printing debug messages.
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 | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/block/blk-cgroup.h b/block/blk-cgroup.h index ef6550a67a69..c524267e4f7f 100644 --- a/block/blk-cgroup.h +++ b/block/blk-cgroup.h | |||
@@ -77,8 +77,6 @@ struct blkio_group { | |||
77 | struct list_head q_node; | 77 | struct list_head q_node; |
78 | struct hlist_node blkcg_node; | 78 | struct hlist_node blkcg_node; |
79 | struct blkio_cgroup *blkcg; | 79 | struct blkio_cgroup *blkcg; |
80 | /* Store cgroup path */ | ||
81 | char path[128]; | ||
82 | /* reference count */ | 80 | /* reference count */ |
83 | int refcnt; | 81 | int refcnt; |
84 | 82 | ||
@@ -167,9 +165,24 @@ static inline struct blkio_group *pdata_to_blkg(void *pdata) | |||
167 | return NULL; | 165 | return NULL; |
168 | } | 166 | } |
169 | 167 | ||
170 | static inline char *blkg_path(struct blkio_group *blkg) | 168 | /** |
169 | * blkg_path - format cgroup path of blkg | ||
170 | * @blkg: blkg of interest | ||
171 | * @buf: target buffer | ||
172 | * @buflen: target buffer length | ||
173 | * | ||
174 | * Format the path of the cgroup of @blkg into @buf. | ||
175 | */ | ||
176 | static inline int blkg_path(struct blkio_group *blkg, char *buf, int buflen) | ||
171 | { | 177 | { |
172 | return blkg->path; | 178 | int ret; |
179 | |||
180 | rcu_read_lock(); | ||
181 | ret = cgroup_path(blkg->blkcg->css.cgroup, buf, buflen); | ||
182 | rcu_read_unlock(); | ||
183 | if (ret) | ||
184 | strncpy(buf, "<unavailable>", buflen); | ||
185 | return ret; | ||
173 | } | 186 | } |
174 | 187 | ||
175 | /** | 188 | /** |