diff options
Diffstat (limited to 'block/blk-cgroup.h')
-rw-r--r-- | block/blk-cgroup.h | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/block/blk-cgroup.h b/block/blk-cgroup.h index 604f6d99ab92..371fe8e92ab5 100644 --- a/block/blk-cgroup.h +++ b/block/blk-cgroup.h | |||
@@ -186,7 +186,7 @@ static inline struct blkcg *css_to_blkcg(struct cgroup_subsys_state *css) | |||
186 | 186 | ||
187 | static inline struct blkcg *task_blkcg(struct task_struct *tsk) | 187 | static inline struct blkcg *task_blkcg(struct task_struct *tsk) |
188 | { | 188 | { |
189 | return css_to_blkcg(task_css(tsk, blkio_subsys_id)); | 189 | return css_to_blkcg(task_css(tsk, blkio_cgrp_id)); |
190 | } | 190 | } |
191 | 191 | ||
192 | static inline struct blkcg *bio_blkcg(struct bio *bio) | 192 | static inline struct blkcg *bio_blkcg(struct bio *bio) |
@@ -241,12 +241,16 @@ static inline struct blkcg_gq *pd_to_blkg(struct blkg_policy_data *pd) | |||
241 | */ | 241 | */ |
242 | static inline int blkg_path(struct blkcg_gq *blkg, char *buf, int buflen) | 242 | static inline int blkg_path(struct blkcg_gq *blkg, char *buf, int buflen) |
243 | { | 243 | { |
244 | int ret; | 244 | char *p; |
245 | 245 | ||
246 | ret = cgroup_path(blkg->blkcg->css.cgroup, buf, buflen); | 246 | p = cgroup_path(blkg->blkcg->css.cgroup, buf, buflen); |
247 | if (ret) | 247 | if (!p) { |
248 | strncpy(buf, "<unavailable>", buflen); | 248 | strncpy(buf, "<unavailable>", buflen); |
249 | return ret; | 249 | return -ENAMETOOLONG; |
250 | } | ||
251 | |||
252 | memmove(buf, p, buf + buflen - p); | ||
253 | return 0; | ||
250 | } | 254 | } |
251 | 255 | ||
252 | /** | 256 | /** |