]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
cgroups: s/container_base_path/at_base/g
authorChristian Brauner <christian.brauner@ubuntu.com>
Sun, 21 Feb 2021 10:09:27 +0000 (11:09 +0100)
committerChristian Brauner <christian.brauner@ubuntu.com>
Sun, 21 Feb 2021 10:25:41 +0000 (11:25 +0100)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/cgroups/cgfsng.c
src/lxc/cgroups/cgroup.c
src/lxc/cgroups/cgroup.h

index cb36abc5b1199a8a306972c399799333b929d8fe..feb559a6b4f4d5decaa32486e92b4f0ada977d25 100644 (file)
@@ -401,17 +401,17 @@ static int cgroup_hierarchy_add(struct cgroup_ops *ops, int dfd_mnt, char *mnt,
        if (!new)
                return ret_errno(ENOMEM);
 
-       new->cgfd_con                   = -EBADF;
-       new->cgfd_limit                 = -EBADF;
-       new->cgfd_mon                   = -EBADF;
+       new->cgfd_con           = -EBADF;
+       new->cgfd_limit         = -EBADF;
+       new->cgfd_mon           = -EBADF;
 
-       new->fs_type                    = fs_type;
-       new->controllers                = controllers;
-       new->mountpoint                 = mnt;
-       new->container_base_path        = base_cgroup;
+       new->fs_type            = fs_type;
+       new->controllers        = controllers;
+       new->mountpoint         = mnt;
+       new->at_base            = base_cgroup;
 
-       new->dfd_mnt                    = dfd_mnt;
-       new->dfd_base                   = dfd_base;
+       new->dfd_mnt            = dfd_mnt;
+       new->dfd_base           = dfd_base;
 
        TRACE("Adding cgroup hierarchy mounted at %s and base cgroup %s",
              mnt, maybe_empty(base_cgroup));
@@ -777,7 +777,7 @@ static bool cgroup_tree_create(struct cgroup_ops *ops, struct lxc_conf *conf,
                    !ops->setup_limits_legacy(ops, conf, true))
                        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);
 
                /*
@@ -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);
                }
        } 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);
        }
@@ -1452,7 +1452,7 @@ static int cg_legacy_mount_controllers(int cgroup_automount_type, struct hierarc
                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)
                flags |= MS_RDONLY;
 
@@ -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);
 
                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);
                ret = mkdir_p(path2, 0755);
                if (ret < 0 && (errno != EEXIST))
@@ -1843,7 +1843,7 @@ __cgfsng_ops static bool cgfsng_criu_escape(const struct cgroup_ops *ops,
                int ret;
 
                fullpath = make_cgroup_path(ops->hierarchies[i],
-                                           ops->hierarchies[i]->container_base_path,
+                                           ops->hierarchies[i]->at_base,
                                            "cgroup.procs", NULL);
                ret = lxc_write_to_file(fullpath, "0", 2, false, 0666);
                if (ret != 0)
index fa40fc8e6ac78326758df4cc1ba52c14bd6614e6..9965d6b4968efd3f1a5de81d946adc95e11b2a72 100644 (file)
@@ -86,7 +86,7 @@ void cgroup_exit(struct cgroup_ops *ops)
                free((*it)->cgroup2_chown);
 
                free((*it)->mountpoint);
-               free((*it)->container_base_path);
+               free((*it)->at_base);
 
                free_equal((*it)->container_full_path,
                           (*it)->container_limit_path);
index 47945781e33ef2c3af22f8a4e71822565a4261e8..fdc10e52646348b091eac9a4daa60d70f124df9e 100644 (file)
@@ -56,7 +56,7 @@ typedef enum {
  *   depending on whether this is a hybrid cgroup layout (mix of legacy and
  *   unified hierarchies) or a pure unified cgroup layout.
  *
- * @container_base_path
+ * @at_base
  * - 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).
@@ -84,7 +84,6 @@ struct hierarchy {
        char **cgroup2_chown;
        char **controllers;
        char *mountpoint;
-       char *container_base_path;
        char *container_full_path;
        char *container_limit_path;
        cgroupfs_type_magic_t fs_type;
@@ -109,8 +108,9 @@ struct hierarchy {
        /* File descriptor for the controller's mountpoint @mountpoint. */
        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;
+       char *at_base;
 };
 
 struct cgroup_ops {