summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2013-04-14 20:50:08 -0700
committerMaciej Wereski <m.wereski@partner.samsung.com>2014-12-29 09:31:37 +0100
commita5d3882f7dda6213caccd748809a1be9961fb2dc (patch)
treeb6f0240d616b447668764c47310996ad5db33bbd /include
parent4912bfd6d1e13b32f9c9efa43ff6dfcb59618c58 (diff)
downloadlinux-3.10-a5d3882f7dda6213caccd748809a1be9961fb2dc.tar.gz
linux-3.10-a5d3882f7dda6213caccd748809a1be9961fb2dc.tar.bz2
linux-3.10-a5d3882f7dda6213caccd748809a1be9961fb2dc.zip
cgroup: implement task_cgroup_path_from_hierarchy()
kdbus folks want a sane way to determine the cgroup path that a given task belongs to on a given hierarchy, which is a reasonble thing to expect from cgroup core. Implement task_cgroup_path_from_hierarchy(). v2: Dropped unnecessary NULL check on the return value of task_cgroup_from_root() as suggested by Li Zefan. Signed-off-by: Tejun Heo <tj@kernel.org> Acked-by: Greg Kroah-Hartman <greg@kroah.com> Acked-by: Li Zefan <lizefan@huawei.com> Cc: Kay Sievers <kay@vrfy.org> Cc: Lennart Poettering <lennart@poettering.net> Cc: Daniel Mack <daniel@zonque.org> Change-Id: Ifd630e09163b8272627c2ef8be1866c5e9dc05f9 Origin: https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=857a2beb09ab83e9a8185821ae16db7dfbe8b837 Backported-by: Maciej Wereski <m.wereski@partner.samsung.com> Signed-off-by: Maciej Wereski <m.wereski@partner.samsung.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/cgroup.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h
index 8852d370c72..5982ebf66ae 100644
--- a/include/linux/cgroup.h
+++ b/include/linux/cgroup.h
@@ -542,6 +542,8 @@ int cgroup_is_removed(const struct cgroup *cgrp);
bool cgroup_is_descendant(struct cgroup *cgrp, struct cgroup *ancestor);
int cgroup_path(const struct cgroup *cgrp, char *buf, int buflen);
+int task_cgroup_path_from_hierarchy(struct task_struct *task, int hierarchy_id,
+ char *buf, size_t buflen);
int cgroup_task_count(const struct cgroup *cgrp);