mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-08-08 12:18:51 +00:00
cgroups: simplify cgfsng_nrtasks()
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
This commit is contained in:
parent
779b3d82e6
commit
3312a94ff4
@ -1898,14 +1898,12 @@ static int recursive_count_nrtasks(char *dirname)
|
|||||||
__cgfsng_ops static int cgfsng_nrtasks(struct cgroup_ops *ops)
|
__cgfsng_ops static int cgfsng_nrtasks(struct cgroup_ops *ops)
|
||||||
{
|
{
|
||||||
__do_free char *path = NULL;
|
__do_free char *path = NULL;
|
||||||
int count;
|
|
||||||
|
|
||||||
if (!ops->container_cgroup || !ops->hierarchies)
|
if (!ops->container_cgroup || !ops->hierarchies)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
path = must_make_path(ops->hierarchies[0]->container_full_path, NULL);
|
path = must_make_path(ops->hierarchies[0]->container_full_path, NULL);
|
||||||
count = recursive_count_nrtasks(path);
|
return recursive_count_nrtasks(path);
|
||||||
return count;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Only root needs to escape to the cgroup of its init. */
|
/* Only root needs to escape to the cgroup of its init. */
|
||||||
|
Loading…
Reference in New Issue
Block a user