diff options
-rw-r--r-- | include/linux/cgroup.h | 24 |
1 files changed, 4 insertions, 20 deletions
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index acbb9a4cb6e9..9f4f253f0e47 100644 --- a/include/linux/cgroup.h +++ b/include/linux/cgroup.h | |||
@@ -508,39 +508,23 @@ struct cgroup_subsys_state *seq_css(struct seq_file *seq); | |||
508 | 508 | ||
509 | static inline int cgroup_name(struct cgroup *cgrp, char *buf, size_t buflen) | 509 | static inline int cgroup_name(struct cgroup *cgrp, char *buf, size_t buflen) |
510 | { | 510 | { |
511 | /* dummy_top doesn't have a kn associated */ | 511 | return kernfs_name(cgrp->kn, buf, buflen); |
512 | if (cgrp->kn) | ||
513 | return kernfs_name(cgrp->kn, buf, buflen); | ||
514 | else | ||
515 | return strlcpy(buf, "/", buflen); | ||
516 | } | 512 | } |
517 | 513 | ||
518 | static inline char * __must_check cgroup_path(struct cgroup *cgrp, char *buf, | 514 | static inline char * __must_check cgroup_path(struct cgroup *cgrp, char *buf, |
519 | size_t buflen) | 515 | size_t buflen) |
520 | { | 516 | { |
521 | /* dummy_top doesn't have a kn associated */ | 517 | return kernfs_path(cgrp->kn, buf, buflen); |
522 | if (cgrp->kn) | ||
523 | return kernfs_path(cgrp->kn, buf, buflen); | ||
524 | strlcpy(buf, "/", buflen); | ||
525 | return (buflen <= 2) ? NULL : buf; | ||
526 | } | 518 | } |
527 | 519 | ||
528 | static inline void pr_cont_cgroup_name(struct cgroup *cgrp) | 520 | static inline void pr_cont_cgroup_name(struct cgroup *cgrp) |
529 | { | 521 | { |
530 | /* dummy_top doesn't have a kn associated */ | 522 | pr_cont_kernfs_name(cgrp->kn); |
531 | if (cgrp->kn) | ||
532 | pr_cont_kernfs_name(cgrp->kn); | ||
533 | else | ||
534 | pr_cont("/"); | ||
535 | } | 523 | } |
536 | 524 | ||
537 | static inline void pr_cont_cgroup_path(struct cgroup *cgrp) | 525 | static inline void pr_cont_cgroup_path(struct cgroup *cgrp) |
538 | { | 526 | { |
539 | /* dummy_top doesn't have a kn associated */ | 527 | pr_cont_kernfs_path(cgrp->kn); |
540 | if (cgrp->kn) | ||
541 | pr_cont_kernfs_path(cgrp->kn); | ||
542 | else | ||
543 | pr_cont("/"); | ||
544 | } | 528 | } |
545 | 529 | ||
546 | char *task_cgroup_path(struct task_struct *task, char *buf, size_t buflen); | 530 | char *task_cgroup_path(struct task_struct *task, char *buf, size_t buflen); |