cgroups: s/base_cgroup/container_base_path/g

parent 984dec41
...@@ -573,7 +573,7 @@ static bool cg_legacy_handle_cpuset_hierarchy(struct hierarchy *h, char *cgname) ...@@ -573,7 +573,7 @@ static bool cg_legacy_handle_cpuset_hierarchy(struct hierarchy *h, char *cgname)
if (slash) if (slash)
*slash = '\0'; *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) if (slash)
*slash = '/'; *slash = '/';
...@@ -810,7 +810,7 @@ static char **cg_unified_get_controllers(const char *file) ...@@ -810,7 +810,7 @@ static char **cg_unified_get_controllers(const char *file)
} }
static struct hierarchy *add_hierarchy(struct hierarchy ***h, char **clist, char *mountpoint, 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; struct hierarchy *new;
int newentry; int newentry;
...@@ -818,7 +818,7 @@ static struct hierarchy *add_hierarchy(struct hierarchy ***h, char **clist, char ...@@ -818,7 +818,7 @@ static struct hierarchy *add_hierarchy(struct hierarchy ***h, char **clist, char
new = must_alloc(sizeof(*new)); new = must_alloc(sizeof(*new));
new->controllers = clist; new->controllers = clist;
new->mountpoint = mountpoint; new->mountpoint = mountpoint;
new->base_cgroup = base_cgroup; new->container_base_path = container_base_path;
new->container_full_path = NULL; new->container_full_path = NULL;
new->version = type; new->version = type;
...@@ -1015,7 +1015,7 @@ static void lxc_cgfsng_print_hierarchies(struct cgroup_ops *ops) ...@@ -1015,7 +1015,7 @@ static void lxc_cgfsng_print_hierarchies(struct cgroup_ops *ops)
int j; int j;
char **cit; 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(" mountpoint: %s", (*it)->mountpoint ? (*it)->mountpoint : "(null)");
TRACE(" controllers:"); TRACE(" controllers:");
for (j = 0, cit = (*it)->controllers; cit && *cit; cit++, j++) for (j = 0, cit = (*it)->controllers; cit && *cit; cit++, j++)
...@@ -1167,7 +1167,7 @@ static bool cg_unified_create_cgroup(struct hierarchy *h, char *cgname) ...@@ -1167,7 +1167,7 @@ static bool cg_unified_create_cgroup(struct hierarchy *h, char *cgname)
if (parts_len > 0) if (parts_len > 0)
parts_len--; 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++) { for (i = 0; i < parts_len; i++) {
int ret; int ret;
char *target; char *target;
...@@ -1196,7 +1196,7 @@ static bool create_path_for_hierarchy(struct hierarchy *h, char *cgname) ...@@ -1196,7 +1196,7 @@ static bool create_path_for_hierarchy(struct hierarchy *h, char *cgname)
{ {
int ret; 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)) { if (dir_exists(h->container_full_path)) {
ERROR("The cgroup \"%s\" already existed", h->container_full_path); ERROR("The cgroup \"%s\" already existed", h->container_full_path);
return false; return false;
...@@ -1498,7 +1498,7 @@ static int cg_legacy_mount_controllers(int type, struct hierarchy *h, ...@@ -1498,7 +1498,7 @@ static int cg_legacy_mount_controllers(int type, struct hierarchy *h,
INFO("Remounted %s read-only", controllerpath); 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); container_cgroup, NULL);
if (type == LXC_AUTO_CGROUP_RO) if (type == LXC_AUTO_CGROUP_RO)
flags |= MS_RDONLY; flags |= MS_RDONLY;
...@@ -1669,7 +1669,7 @@ __cgfsng_ops__ static bool cgfsng_mount(struct cgroup_ops *ops, ...@@ -1669,7 +1669,7 @@ __cgfsng_ops__ static bool cgfsng_mount(struct cgroup_ops *ops,
continue; continue;
} }
path2 = must_make_path(controllerpath, h->base_cgroup, path2 = must_make_path(controllerpath, h->container_base_path,
ops->container_cgroup, NULL); ops->container_cgroup, NULL);
ret = mkdir_p(path2, 0755); ret = mkdir_p(path2, 0755);
if (ret < 0) { if (ret < 0) {
...@@ -1761,7 +1761,7 @@ __cgfsng_ops__ static bool cgfsng_escape(const struct cgroup_ops *ops) ...@@ -1761,7 +1761,7 @@ __cgfsng_ops__ static bool cgfsng_escape(const struct cgroup_ops *ops)
char *fullpath; char *fullpath;
fullpath = must_make_path(ops->hierarchies[i]->mountpoint, fullpath = must_make_path(ops->hierarchies[i]->mountpoint,
ops->hierarchies[i]->base_cgroup, ops->hierarchies[i]->container_base_path,
"cgroup.procs", NULL); "cgroup.procs", NULL);
ret = lxc_write_to_file(fullpath, "0", 2, false, 0666); ret = lxc_write_to_file(fullpath, "0", 2, false, 0666);
if (ret != 0) { if (ret != 0) {
......
...@@ -85,7 +85,7 @@ void cgroup_exit(struct cgroup_ops *ops) ...@@ -85,7 +85,7 @@ void cgroup_exit(struct cgroup_ops *ops)
free((*it)->controllers); free((*it)->controllers);
free((*it)->mountpoint); free((*it)->mountpoint);
free((*it)->base_cgroup); free((*it)->container_base_path);
free((*it)->container_full_path); free((*it)->container_full_path);
free(*it); free(*it);
} }
......
...@@ -57,7 +57,7 @@ typedef enum { ...@@ -57,7 +57,7 @@ typedef enum {
* depending on whether this is a hybrid cgroup layout (mix of legacy and * depending on whether this is a hybrid cgroup layout (mix of legacy and
* unified hierarchies) or a pure unified cgroup layout. * unified hierarchies) or a pure unified cgroup layout.
* *
* @base_cgroup * @container_base_path
* - The cgroup under which the container cgroup path * - The cgroup under which the container cgroup path
* is created. This will be either the caller's cgroup (if not root), or * is created. This will be either the caller's cgroup (if not root), or
* init's cgroup (if root). * init's cgroup (if root).
...@@ -76,7 +76,7 @@ typedef enum { ...@@ -76,7 +76,7 @@ typedef enum {
struct hierarchy { struct hierarchy {
char **controllers; char **controllers;
char *mountpoint; char *mountpoint;
char *base_cgroup; char *container_base_path;
char *container_full_path; char *container_full_path;
int version; int version;
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment