X-Git-Url: http://git.cascardo.info/?a=blobdiff_plain;f=block%2Fblk-cgroup.h;h=371fe8e92ab59ad30b84b0cd43f43bea5230b807;hb=32d01dc7be4e725ab85ce1d74e8f4adc02ad68dd;hp=604f6d99ab92ca859d46b7ff7d8ce4b5519ebb61;hpb=57a7744e09867ebcfa0ccf1d6d529caa7728d552;p=cascardo%2Flinux.git 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) static inline struct blkcg *task_blkcg(struct task_struct *tsk) { - return css_to_blkcg(task_css(tsk, blkio_subsys_id)); + return css_to_blkcg(task_css(tsk, blkio_cgrp_id)); } 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) */ static inline int blkg_path(struct blkcg_gq *blkg, char *buf, int buflen) { - int ret; + char *p; - ret = cgroup_path(blkg->blkcg->css.cgroup, buf, buflen); - if (ret) + p = cgroup_path(blkg->blkcg->css.cgroup, buf, buflen); + if (!p) { strncpy(buf, "", buflen); - return ret; + return -ENAMETOOLONG; + } + + memmove(buf, p, buf + buflen - p); + return 0; } /**