summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTejun Heo2014-03-19 15:23:54 +0100
committerTejun Heo2014-03-19 15:23:54 +0100
commitfdce6bf8c5b6968eb9b96ecc5fe400514a604902 (patch)
treef6e0c4f6b026cf7edd3db7270c910355fc481351
parentcgroup: use cgroup_setup_root() to initialize cgroup_dummy_root (diff)
downloadkernel-qcow2-linux-fdce6bf8c5b6968eb9b96ecc5fe400514a604902.tar.gz
kernel-qcow2-linux-fdce6bf8c5b6968eb9b96ecc5fe400514a604902.tar.xz
kernel-qcow2-linux-fdce6bf8c5b6968eb9b96ecc5fe400514a604902.zip
cgroup: remove NULL checks from [pr_cont_]cgroup_{name|path}()
The dummy hierarchy is now a fully functional one and dummy_top has a kernfs_node associated with it. Drop the NULL checks in [pr_cont_]cont_{name|path}() which are no longer necessary. Signed-off-by: Tejun Heo <tj@kernel.org> Acked-by: Li Zefan <lizefan@huawei.com>
-rw-r--r--include/linux/cgroup.h24
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);
static inline int cgroup_name(struct cgroup *cgrp, char *buf, size_t buflen)
{
- /* dummy_top doesn't have a kn associated */
- if (cgrp->kn)
- return kernfs_name(cgrp->kn, buf, buflen);
- else
- return strlcpy(buf, "/", buflen);
+ return kernfs_name(cgrp->kn, buf, buflen);
}
static inline char * __must_check cgroup_path(struct cgroup *cgrp, char *buf,
size_t buflen)
{
- /* dummy_top doesn't have a kn associated */
- if (cgrp->kn)
- return kernfs_path(cgrp->kn, buf, buflen);
- strlcpy(buf, "/", buflen);
- return (buflen <= 2) ? NULL : buf;
+ return kernfs_path(cgrp->kn, buf, buflen);
}
static inline void pr_cont_cgroup_name(struct cgroup *cgrp)
{
- /* dummy_top doesn't have a kn associated */
- if (cgrp->kn)
- pr_cont_kernfs_name(cgrp->kn);
- else
- pr_cont("/");
+ pr_cont_kernfs_name(cgrp->kn);
}
static inline void pr_cont_cgroup_path(struct cgroup *cgrp)
{
- /* dummy_top doesn't have a kn associated */
- if (cgrp->kn)
- pr_cont_kernfs_path(cgrp->kn);
- else
- pr_cont("/");
+ pr_cont_kernfs_path(cgrp->kn);
}
char *task_cgroup_path(struct task_struct *task, char *buf, size_t buflen);