This fill make fake-absolute paths to support virtual ve roots in cgroup hierarchies. The path will be used in subsequent patches.
Signed-off-by: Valeriy.Vdovin <[email protected]> Reviewed-by: Kirill Tkhai <[email protected]> --- kernel/cgroup/cgroup-v1.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/kernel/cgroup/cgroup-v1.c b/kernel/cgroup/cgroup-v1.c index fb06fc9d96ca..21a7c36fbf44 100644 --- a/kernel/cgroup/cgroup-v1.c +++ b/kernel/cgroup/cgroup-v1.c @@ -787,6 +787,16 @@ void cgroup1_check_for_release(struct cgroup *cgrp) schedule_work(&cgrp->release_agent_work); } +/* + * Used to get a fake-absolute path to a cgroup on kernfs filesystem, but it + * actually be relative to cgroup root, provided in the argument. + */ +static inline int cgroup_path_ve_relative(struct cgroup *ve_root_cgrp, + struct cgroup *cgrp, char *buf, size_t buflen) +{ + return kernfs_path_from_node(cgrp->kn, ve_root_cgrp->kn, buf, buflen); +} + /* * Notify userspace when a cgroup is released, by running the * configured release agent with the name of the cgroup (path -- 2.27.0 _______________________________________________ Devel mailing list [email protected] https://lists.openvz.org/mailman/listinfo/devel
