aboutsummaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2012-04-16 16:57:23 -0400
committerJens Axboe <axboe@kernel.dk>2012-04-20 04:06:16 -0400
commit54e7ed12bad1e3aa2a28558fab6850240465f973 (patch)
tree907eb0451782f4eb1ad3f9236e51ec4acb7fb941 /block
parentc94bed89995e638e43a6663177358b9d20617361 (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')
-rw-r--r--block/blk-cgroup.c1
-rw-r--r--block/blk-cgroup.h21
-rw-r--r--block/blk-throttle.c9
-rw-r--r--block/cfq-iosched.c21
4 files changed, 37 insertions, 15 deletions
diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c
index b1807d4ecedb..63337024e4d7 100644
--- a/block/blk-cgroup.c
+++ b/block/blk-cgroup.c
@@ -114,7 +114,6 @@ static struct blkio_group *blkg_alloc(struct blkio_cgroup *blkcg,
114 INIT_LIST_HEAD(&blkg->q_node); 114 INIT_LIST_HEAD(&blkg->q_node);
115 blkg->blkcg = blkcg; 115 blkg->blkcg = blkcg;
116 blkg->refcnt = 1; 116 blkg->refcnt = 1;
117 cgroup_path(blkcg->css.cgroup, blkg->path, sizeof(blkg->path));
118 117
119 for (i = 0; i < BLKCG_MAX_POLS; i++) { 118 for (i = 0; i < BLKCG_MAX_POLS; i++) {
120 struct blkio_policy_type *pol = blkio_policy[i]; 119 struct blkio_policy_type *pol = blkio_policy[i];
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
170static 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 */
176static 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/**
diff --git a/block/blk-throttle.c b/block/blk-throttle.c
index e2aaf27e1f10..e9b7a47f6da0 100644
--- a/block/blk-throttle.c
+++ b/block/blk-throttle.c
@@ -155,9 +155,12 @@ static inline int throtl_tg_##name(const struct throtl_grp *tg) \
155 155
156THROTL_TG_FNS(on_rr); 156THROTL_TG_FNS(on_rr);
157 157
158#define throtl_log_tg(td, tg, fmt, args...) \ 158#define throtl_log_tg(td, tg, fmt, args...) do { \
159 blk_add_trace_msg((td)->queue, "throtl %s " fmt, \ 159 char __pbuf[128]; \
160 blkg_path(tg_to_blkg(tg)), ##args); \ 160 \
161 blkg_path(tg_to_blkg(tg), __pbuf, sizeof(__pbuf)); \
162 blk_add_trace_msg((td)->queue, "throtl %s " fmt, __pbuf, ##args); \
163} while (0)
161 164
162#define throtl_log(td, fmt, args...) \ 165#define throtl_log(td, fmt, args...) \
163 blk_add_trace_msg((td)->queue, "throtl " fmt, ##args) 166 blk_add_trace_msg((td)->queue, "throtl " fmt, ##args)
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
index eb07eb64e85b..901286b5f5cb 100644
--- a/block/cfq-iosched.c
+++ b/block/cfq-iosched.c
@@ -573,14 +573,21 @@ static inline void cfqg_put(struct cfq_group *cfqg)
573 return blkg_put(cfqg_to_blkg(cfqg)); 573 return blkg_put(cfqg_to_blkg(cfqg));
574} 574}
575 575
576#define cfq_log_cfqq(cfqd, cfqq, fmt, args...) \ 576#define cfq_log_cfqq(cfqd, cfqq, fmt, args...) do { \
577 char __pbuf[128]; \
578 \
579 blkg_path(cfqg_to_blkg((cfqq)->cfqg), __pbuf, sizeof(__pbuf)); \
577 blk_add_trace_msg((cfqd)->queue, "cfq%d%c %s " fmt, (cfqq)->pid, \ 580 blk_add_trace_msg((cfqd)->queue, "cfq%d%c %s " fmt, (cfqq)->pid, \
578 cfq_cfqq_sync((cfqq)) ? 'S' : 'A', \ 581 cfq_cfqq_sync((cfqq)) ? 'S' : 'A', \
579 blkg_path(cfqg_to_blkg((cfqq)->cfqg)), ##args) 582 __pbuf, ##args); \
580 583} while (0)
581#define cfq_log_cfqg(cfqd, cfqg, fmt, args...) \ 584
582 blk_add_trace_msg((cfqd)->queue, "%s " fmt, \ 585#define cfq_log_cfqg(cfqd, cfqg, fmt, args...) do { \
583 blkg_path(cfqg_to_blkg((cfqg))), ##args) \ 586 char __pbuf[128]; \
587 \
588 blkg_path(cfqg_to_blkg(cfqg), __pbuf, sizeof(__pbuf)); \
589 blk_add_trace_msg((cfqd)->queue, "%s " fmt, __pbuf, ##args); \
590} while (0)
584 591
585static inline void cfqg_stats_update_io_add(struct cfq_group *cfqg, 592static inline void cfqg_stats_update_io_add(struct cfq_group *cfqg,
586 struct cfq_group *curr_cfqg, int rw) 593 struct cfq_group *curr_cfqg, int rw)