Skip to content

Commit

Permalink
cgroups: s/base_cgroup/container_base_path/g
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
  • Loading branch information
Christian Brauner committed Sep 30, 2018
1 parent 984dec4 commit 1537e2c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
18 changes: 9 additions & 9 deletions src/lxc/cgroups/cgfsng.c
Expand Up @@ -573,7 +573,7 @@ static bool cg_legacy_handle_cpuset_hierarchy(struct hierarchy *h, char *cgname)
if (slash)
*slash = '\0';

cgpath = must_make_path(h->mountpoint, h->base_cgroup, cgname, NULL);
cgpath = must_make_path(h->mountpoint, h->container_base_path, cgname, NULL);
if (slash)
*slash = '/';

Expand Down Expand Up @@ -810,15 +810,15 @@ static char **cg_unified_get_controllers(const char *file)
}

static struct hierarchy *add_hierarchy(struct hierarchy ***h, char **clist, char *mountpoint,
char *base_cgroup, int type)
char *container_base_path, int type)
{
struct hierarchy *new;
int newentry;

new = must_alloc(sizeof(*new));
new->controllers = clist;
new->mountpoint = mountpoint;
new->base_cgroup = base_cgroup;
new->container_base_path = container_base_path;
new->container_full_path = NULL;
new->version = type;

Expand Down Expand Up @@ -1015,7 +1015,7 @@ static void lxc_cgfsng_print_hierarchies(struct cgroup_ops *ops)
int j;
char **cit;

TRACE(" %d: base_cgroup: %s", i, (*it)->base_cgroup ? (*it)->base_cgroup : "(null)");
TRACE(" %d: base_cgroup: %s", i, (*it)->container_base_path ? (*it)->container_base_path : "(null)");
TRACE(" mountpoint: %s", (*it)->mountpoint ? (*it)->mountpoint : "(null)");
TRACE(" controllers:");
for (j = 0, cit = (*it)->controllers; cit && *cit; cit++, j++)
Expand Down Expand Up @@ -1167,7 +1167,7 @@ static bool cg_unified_create_cgroup(struct hierarchy *h, char *cgname)
if (parts_len > 0)
parts_len--;

cgroup = must_make_path(h->mountpoint, h->base_cgroup, NULL);
cgroup = must_make_path(h->mountpoint, h->container_base_path, NULL);
for (i = 0; i < parts_len; i++) {
int ret;
char *target;
Expand Down Expand Up @@ -1196,7 +1196,7 @@ static bool create_path_for_hierarchy(struct hierarchy *h, char *cgname)
{
int ret;

h->container_full_path = must_make_path(h->mountpoint, h->base_cgroup, cgname, NULL);
h->container_full_path = must_make_path(h->mountpoint, h->container_base_path, cgname, NULL);
if (dir_exists(h->container_full_path)) {
ERROR("The cgroup \"%s\" already existed", h->container_full_path);
return false;
Expand Down Expand Up @@ -1498,7 +1498,7 @@ static int cg_legacy_mount_controllers(int type, struct hierarchy *h,
INFO("Remounted %s read-only", controllerpath);
}

sourcepath = must_make_path(h->mountpoint, h->base_cgroup,
sourcepath = must_make_path(h->mountpoint, h->container_base_path,
container_cgroup, NULL);
if (type == LXC_AUTO_CGROUP_RO)
flags |= MS_RDONLY;
Expand Down Expand Up @@ -1669,7 +1669,7 @@ __cgfsng_ops__ static bool cgfsng_mount(struct cgroup_ops *ops,
continue;
}

path2 = must_make_path(controllerpath, h->base_cgroup,
path2 = must_make_path(controllerpath, h->container_base_path,
ops->container_cgroup, NULL);
ret = mkdir_p(path2, 0755);
if (ret < 0) {
Expand Down Expand Up @@ -1761,7 +1761,7 @@ __cgfsng_ops__ static bool cgfsng_escape(const struct cgroup_ops *ops)
char *fullpath;

fullpath = must_make_path(ops->hierarchies[i]->mountpoint,
ops->hierarchies[i]->base_cgroup,
ops->hierarchies[i]->container_base_path,
"cgroup.procs", NULL);
ret = lxc_write_to_file(fullpath, "0", 2, false, 0666);
if (ret != 0) {
Expand Down
2 changes: 1 addition & 1 deletion src/lxc/cgroups/cgroup.c
Expand Up @@ -85,7 +85,7 @@ void cgroup_exit(struct cgroup_ops *ops)
free((*it)->controllers);

free((*it)->mountpoint);
free((*it)->base_cgroup);
free((*it)->container_base_path);
free((*it)->container_full_path);
free(*it);
}
Expand Down
4 changes: 2 additions & 2 deletions src/lxc/cgroups/cgroup.h
Expand Up @@ -57,7 +57,7 @@ typedef enum {
* depending on whether this is a hybrid cgroup layout (mix of legacy and
* unified hierarchies) or a pure unified cgroup layout.
*
* @base_cgroup
* @container_base_path
* - The cgroup under which the container cgroup path
* is created. This will be either the caller's cgroup (if not root), or
* init's cgroup (if root).
Expand All @@ -76,7 +76,7 @@ typedef enum {
struct hierarchy {
char **controllers;
char *mountpoint;
char *base_cgroup;
char *container_base_path;
char *container_full_path;
int version;
};
Expand Down

0 comments on commit 1537e2c

Please sign in to comment.