summaryrefslogtreecommitdiff
path: root/block/blk-cgroup.h
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2012-04-16 13:57:23 -0700
committerJens Axboe <axboe@kernel.dk>2012-04-20 10:06:16 +0200
commit54e7ed12bad1e3aa2a28558fab6850240465f973 (patch)
tree907eb0451782f4eb1ad3f9236e51ec4acb7fb941 /block/blk-cgroup.h
parentc94bed89995e638e43a6663177358b9d20617361 (diff)
downloadlwn-54e7ed12bad1e3aa2a28558fab6850240465f973.tar.gz
lwn-54e7ed12bad1e3aa2a28558fab6850240465f973.zip
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.h21
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 {
struct list_head q_node;
struct hlist_node blkcg_node;
struct blkio_cgroup *blkcg;
- /* Store cgroup path */
- char path[128];
/* reference count */
int refcnt;
@@ -167,9 +165,24 @@ static inline struct blkio_group *pdata_to_blkg(void *pdata)
return NULL;
}
-static inline char *blkg_path(struct blkio_group *blkg)
+/**
+ * blkg_path - format cgroup path of blkg
+ * @blkg: blkg of interest
+ * @buf: target buffer
+ * @buflen: target buffer length
+ *
+ * Format the path of the cgroup of @blkg into @buf.
+ */
+static inline int blkg_path(struct blkio_group *blkg, char *buf, int buflen)
{
- return blkg->path;
+ int ret;
+
+ rcu_read_lock();
+ ret = cgroup_path(blkg->blkcg->css.cgroup, buf, buflen);
+ rcu_read_unlock();
+ if (ret)
+ strncpy(buf, "<unavailable>", buflen);
+ return ret;
}
/**