cgroups: s/container_base_path/at_base/g

parent e18e9053
...@@ -401,17 +401,17 @@ static int cgroup_hierarchy_add(struct cgroup_ops *ops, int dfd_mnt, char *mnt, ...@@ -401,17 +401,17 @@ static int cgroup_hierarchy_add(struct cgroup_ops *ops, int dfd_mnt, char *mnt,
if (!new) if (!new)
return ret_errno(ENOMEM); return ret_errno(ENOMEM);
new->cgfd_con = -EBADF; new->cgfd_con = -EBADF;
new->cgfd_limit = -EBADF; new->cgfd_limit = -EBADF;
new->cgfd_mon = -EBADF; new->cgfd_mon = -EBADF;
new->fs_type = fs_type; new->fs_type = fs_type;
new->controllers = controllers; new->controllers = controllers;
new->mountpoint = mnt; new->mountpoint = mnt;
new->container_base_path = base_cgroup; new->at_base = base_cgroup;
new->dfd_mnt = dfd_mnt; new->dfd_mnt = dfd_mnt;
new->dfd_base = dfd_base; new->dfd_base = dfd_base;
TRACE("Adding cgroup hierarchy mounted at %s and base cgroup %s", TRACE("Adding cgroup hierarchy mounted at %s and base cgroup %s",
mnt, maybe_empty(base_cgroup)); mnt, maybe_empty(base_cgroup));
...@@ -777,7 +777,7 @@ static bool cgroup_tree_create(struct cgroup_ops *ops, struct lxc_conf *conf, ...@@ -777,7 +777,7 @@ static bool cgroup_tree_create(struct cgroup_ops *ops, struct lxc_conf *conf,
!ops->setup_limits_legacy(ops, conf, true)) !ops->setup_limits_legacy(ops, conf, true))
return log_error(false, "Failed to setup legacy device limits"); return log_error(false, "Failed to setup legacy device limits");
limit_path = make_cgroup_path(h, h->container_base_path, cgroup_limit_dir, NULL); limit_path = make_cgroup_path(h, h->at_base, cgroup_limit_dir, NULL);
path = must_make_path(limit_path, cgroup_leaf, NULL); path = must_make_path(limit_path, cgroup_leaf, NULL);
/* /*
...@@ -793,7 +793,7 @@ static bool cgroup_tree_create(struct cgroup_ops *ops, struct lxc_conf *conf, ...@@ -793,7 +793,7 @@ static bool cgroup_tree_create(struct cgroup_ops *ops, struct lxc_conf *conf,
TRACE("Removed cgroup tree %d(%s)", h->dfd_base, cgroup_limit_dir); TRACE("Removed cgroup tree %d(%s)", h->dfd_base, cgroup_limit_dir);
} }
} else { } else {
path = make_cgroup_path(h, h->container_base_path, cgroup_limit_dir, NULL); path = make_cgroup_path(h, h->at_base, cgroup_limit_dir, NULL);
fd_final = __cgroup_tree_create(h->dfd_base, cgroup_limit_dir, 0755, cpuset_v1, false); fd_final = __cgroup_tree_create(h->dfd_base, cgroup_limit_dir, 0755, cpuset_v1, false);
} }
...@@ -1452,7 +1452,7 @@ static int cg_legacy_mount_controllers(int cgroup_automount_type, struct hierarc ...@@ -1452,7 +1452,7 @@ static int cg_legacy_mount_controllers(int cgroup_automount_type, struct hierarc
INFO("Remounted %s read-only", hierarchy_mnt); INFO("Remounted %s read-only", hierarchy_mnt);
} }
sourcepath = make_cgroup_path(h, h->container_base_path, container_cgroup, NULL); sourcepath = make_cgroup_path(h, h->at_base, container_cgroup, NULL);
if (cgroup_automount_type == LXC_AUTO_CGROUP_RO) if (cgroup_automount_type == LXC_AUTO_CGROUP_RO)
flags |= MS_RDONLY; flags |= MS_RDONLY;
...@@ -1806,7 +1806,7 @@ __cgfsng_ops static bool cgfsng_mount(struct cgroup_ops *ops, ...@@ -1806,7 +1806,7 @@ __cgfsng_ops static bool cgfsng_mount(struct cgroup_ops *ops,
cgroup_root = must_make_path(rootfs_mnt, DEFAULT_CGROUP_MOUNTPOINT, NULL); cgroup_root = must_make_path(rootfs_mnt, DEFAULT_CGROUP_MOUNTPOINT, NULL);
hierarchy_mnt = must_make_path(cgroup_root, h->mountpoint, NULL); hierarchy_mnt = must_make_path(cgroup_root, h->mountpoint, NULL);
path2 = must_make_path(hierarchy_mnt, h->container_base_path, path2 = must_make_path(hierarchy_mnt, h->at_base,
ops->container_cgroup, NULL); ops->container_cgroup, NULL);
ret = mkdir_p(path2, 0755); ret = mkdir_p(path2, 0755);
if (ret < 0 && (errno != EEXIST)) if (ret < 0 && (errno != EEXIST))
...@@ -1843,7 +1843,7 @@ __cgfsng_ops static bool cgfsng_criu_escape(const struct cgroup_ops *ops, ...@@ -1843,7 +1843,7 @@ __cgfsng_ops static bool cgfsng_criu_escape(const struct cgroup_ops *ops,
int ret; int ret;
fullpath = make_cgroup_path(ops->hierarchies[i], fullpath = make_cgroup_path(ops->hierarchies[i],
ops->hierarchies[i]->container_base_path, ops->hierarchies[i]->at_base,
"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)
......
...@@ -86,7 +86,7 @@ void cgroup_exit(struct cgroup_ops *ops) ...@@ -86,7 +86,7 @@ void cgroup_exit(struct cgroup_ops *ops)
free((*it)->cgroup2_chown); free((*it)->cgroup2_chown);
free((*it)->mountpoint); free((*it)->mountpoint);
free((*it)->container_base_path); free((*it)->at_base);
free_equal((*it)->container_full_path, free_equal((*it)->container_full_path,
(*it)->container_limit_path); (*it)->container_limit_path);
......
...@@ -56,7 +56,7 @@ typedef enum { ...@@ -56,7 +56,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.
* *
* @container_base_path * @at_base
* - 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).
...@@ -84,7 +84,6 @@ struct hierarchy { ...@@ -84,7 +84,6 @@ struct hierarchy {
char **cgroup2_chown; char **cgroup2_chown;
char **controllers; char **controllers;
char *mountpoint; char *mountpoint;
char *container_base_path;
char *container_full_path; char *container_full_path;
char *container_limit_path; char *container_limit_path;
cgroupfs_type_magic_t fs_type; cgroupfs_type_magic_t fs_type;
...@@ -109,8 +108,9 @@ struct hierarchy { ...@@ -109,8 +108,9 @@ struct hierarchy {
/* File descriptor for the controller's mountpoint @mountpoint. */ /* File descriptor for the controller's mountpoint @mountpoint. */
int dfd_mnt; int dfd_mnt;
/* File descriptor for the controller's base cgroup path @container_base_path. */ /* File descriptor for the controller's base cgroup path @at_base. */
int dfd_base; int dfd_base;
char *at_base;
}; };
struct cgroup_ops { struct cgroup_ops {
......
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