]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
cgroups: s/container_limit_path/path_lim/g
authorChristian Brauner <christian.brauner@ubuntu.com>
Sun, 21 Feb 2021 10:18:29 +0000 (11:18 +0100)
committerChristian Brauner <christian.brauner@ubuntu.com>
Sun, 21 Feb 2021 10:26:30 +0000 (11:26 +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 3eabb32df6ebe05e4cbf50da942aa3d05f07df38..f6209a73edaaf1a40874578d8cab82b63df44852 100644 (file)
@@ -444,7 +444,7 @@ static int cgroup_tree_remove(struct hierarchy **hierarchies, const char *path_p
                else
                        TRACE("Removed cgroup tree %d(%s)", h->dfd_base, path_prune);
 
-               free_equal(h->container_limit_path, h->path_con);
+               free_equal(h->path_lim, h->path_con);
        }
 
        return 0;
@@ -810,9 +810,9 @@ static bool cgroup_tree_create(struct cgroup_ops *ops, struct lxc_conf *conf,
                        h->dfd_lim = move_fd(fd_limit);
 
                if (limit_path)
-                       h->container_limit_path = move_ptr(limit_path);
+                       h->path_lim = move_ptr(limit_path);
                else
-                       h->container_limit_path = h->path_con;
+                       h->path_lim = h->path_con;
        } else {
                h->dfd_mon = move_fd(fd_final);
        }
@@ -830,7 +830,7 @@ static void cgroup_tree_prune_leaf(struct hierarchy *h, const char *path_prune,
                if (h->dfd_lim < 0)
                        prune = false;
 
-               free_equal(h->path_con, h->container_limit_path);
+               free_equal(h->path_con, h->path_lim);
                close_equal(h->dfd_con, h->dfd_lim);
        } else {
                /* Check whether we actually created the cgroup to prune. */
@@ -2039,7 +2039,7 @@ static const char *cgfsng_get_cgroup_do(struct cgroup_ops *ops,
                                      "Failed to find hierarchy for controller \"%s\"", maybe_empty(controller));
 
        if (limiting)
-               path = h->container_limit_path;
+               path = h->path_lim;
        else
                path = h->path_con;
        if (!path)
@@ -2681,7 +2681,7 @@ static int cg_legacy_set_data(struct cgroup_ops *ops, const char *filename,
                if (ret)
                        return ret;
        }
-       return lxc_write_openat(h->container_limit_path, filename, value, strlen(value));
+       return lxc_write_openat(h->path_lim, filename, value, strlen(value));
 }
 
 __cgfsng_ops static bool cgfsng_setup_limits_legacy(struct cgroup_ops *ops,
@@ -2809,7 +2809,7 @@ __cgfsng_ops static bool cgfsng_setup_limits(struct cgroup_ops *ops,
                if (strnequal("devices", cg->subsystem, 7))
                        ret = bpf_device_cgroup_prepare(ops, conf, cg->subsystem, cg->value);
                else
-                       ret = lxc_write_openat(h->container_limit_path, cg->subsystem, cg->value, strlen(cg->value));
+                       ret = lxc_write_openat(h->path_lim, cg->subsystem, cg->value, strlen(cg->value));
                if (ret < 0)
                        return log_error_errno(false, errno, "Failed to set \"%s\" to \"%s\"", cg->subsystem, cg->value);
 
index 69a6cf70a0d0c8552e5892cd2bf976b2daf020ae..79fb2a1f9f5070801f73c7d88a6664c239b36661 100644 (file)
@@ -89,7 +89,7 @@ void cgroup_exit(struct cgroup_ops *ops)
                free((*it)->at_base);
 
                free_equal((*it)->path_con,
-                          (*it)->container_limit_path);
+                          (*it)->path_lim);
 
                close_equal((*it)->dfd_con, (*it)->dfd_lim);
 
index 7b6a63a67be531667df75f5f5e5b88e80e03c82d..8b34dff5b29191d74cb4503a5a1eaf2050d6d514 100644 (file)
@@ -64,7 +64,7 @@ typedef enum {
  * @path_con
  * - The full path to the container's cgroup.
  *
- * @container_limit_path
+ * @path_lim
  * - The full path to the container's limiting cgroup. May simply point to
  *   path_con.
  *
@@ -83,7 +83,6 @@ struct hierarchy {
         */
        char **cgroup2_chown;
        char **controllers;
-       char *container_limit_path;
        cgroupfs_type_magic_t fs_type;
 
        /* cgroup2 only */
@@ -96,10 +95,11 @@ struct hierarchy {
 
        /*
         * File descriptor for the container's limiting cgroup
-        * @container_limit_path.
+        * @path_lim.
         * Will be equal to @dfd_con if no limiting cgroup has been requested.
         */
        int dfd_lim;
+       char *path_lim;
 
        /* File descriptor for the monitor's cgroup. */
        int dfd_mon;