]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
cgroups: s/cgfd_limit/dfd_lim/g
authorChristian Brauner <christian.brauner@ubuntu.com>
Sun, 21 Feb 2021 10:16:30 +0000 (11:16 +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
src/lxc/cgroups/cgroup2_devices.c
src/lxc/commands.c

index b156a6bce269db40c4dac9c93573d0cb1f86e461..8bd9476a2b954740bb236116d4c7383358858775 100644 (file)
@@ -402,7 +402,7 @@ static int cgroup_hierarchy_add(struct cgroup_ops *ops, int dfd_mnt, char *mnt,
                return ret_errno(ENOMEM);
 
        new->dfd_con            = -EBADF;
-       new->cgfd_limit         = -EBADF;
+       new->dfd_lim            = -EBADF;
        new->dfd_mon            = -EBADF;
 
        new->fs_type            = fs_type;
@@ -805,9 +805,9 @@ static bool cgroup_tree_create(struct cgroup_ops *ops, struct lxc_conf *conf,
                h->container_full_path = move_ptr(path);
 
                if (fd_limit < 0)
-                       h->cgfd_limit = h->dfd_con;
+                       h->dfd_lim = h->dfd_con;
                else
-                       h->cgfd_limit = move_fd(fd_limit);
+                       h->dfd_lim = move_fd(fd_limit);
 
                if (limit_path)
                        h->container_limit_path = move_ptr(limit_path);
@@ -827,11 +827,11 @@ static void cgroup_tree_prune_leaf(struct hierarchy *h, const char *path_prune,
 
        if (payload) {
                /* Check whether we actually created the cgroup to prune. */
-               if (h->cgfd_limit < 0)
+               if (h->dfd_lim < 0)
                        prune = false;
 
                free_equal(h->container_full_path, h->container_limit_path);
-               close_equal(h->dfd_con, h->cgfd_limit);
+               close_equal(h->dfd_con, h->dfd_lim);
        } else {
                /* Check whether we actually created the cgroup to prune. */
                if (h->dfd_mon < 0)
index 7f0e7f8ca62ef268637eebf2a9c708acb0372b79..7a89f30f16d20ea3fb88f3710ac272d0a83a45bf 100644 (file)
@@ -91,7 +91,7 @@ void cgroup_exit(struct cgroup_ops *ops)
                free_equal((*it)->container_full_path,
                           (*it)->container_limit_path);
 
-               close_equal((*it)->dfd_con, (*it)->cgfd_limit);
+               close_equal((*it)->dfd_con, (*it)->dfd_lim);
 
                if ((*it)->dfd_mon >= 0)
                        close((*it)->dfd_mon);
index 9ed8395be0362443c1dd0805f5818be8f92b8618..f75fada48e8ea6c808bb0fb70bbc93f854dd7d27 100644 (file)
@@ -99,7 +99,7 @@ struct hierarchy {
         * @container_limit_path.
         * Will be equal to @dfd_con if no limiting cgroup has been requested.
         */
-       int cgfd_limit;
+       int dfd_lim;
 
        /* File descriptor for the monitor's cgroup. */
        int dfd_mon;
index 297eb9f85932c8364e8d780fc2876141c1393bf7..db9177f73cf6f72190bf56644ce2f76b9686cae2 100644 (file)
@@ -609,7 +609,7 @@ bool bpf_cgroup_devices_attach(struct cgroup_ops *ops,
                return syserrno(false, "Failed to create bpf program");
 
        ret = bpf_program_cgroup_attach(prog, BPF_CGROUP_DEVICE,
-                                       ops->unified->cgfd_limit,
+                                       ops->unified->dfd_lim,
                                        BPF_F_ALLOW_MULTI);
        if (ret)
                return syserrno(false, "Failed to attach bpf program");
@@ -635,7 +635,7 @@ bool bpf_cgroup_devices_update(struct cgroup_ops *ops,
        if (!pure_unified_layout(ops))
                return ret_set_errno(false, EINVAL);
 
-       if (ops->unified->cgfd_limit < 0)
+       if (ops->unified->dfd_lim < 0)
                return ret_set_errno(false, EBADF);
 
        /*
index 5de8c5468db35822d3b1fcda23f84eb33c2019a9..ccc5848e61567ba494eb2554e61cd2bb70ba9c33 100644 (file)
@@ -898,7 +898,7 @@ static int lxc_cmd_stop_callback(int fd, struct lxc_cmd_req *req,
                        TRACE("Sent signal %d to pidfd %d", stopsignal, handler->pid);
 
                if (pure_unified_layout(cgroup_ops))
-                       ret = __cgroup_unfreeze(cgroup_ops->unified->cgfd_limit, -1);
+                       ret = __cgroup_unfreeze(cgroup_ops->unified->dfd_lim, -1);
                else
                        ret = cgroup_ops->unfreeze(cgroup_ops, -1);
                if (ret)
@@ -1518,7 +1518,7 @@ static int lxc_cmd_get_cgroup2_fd_callback_do(int fd, struct lxc_cmd_req *req,
        if (!pure_unified_layout(ops) || !ops->unified)
                return lxc_cmd_rsp_send(fd, &rsp);
 
-       send_fd = limiting_cgroup ? ops->unified->cgfd_limit
+       send_fd = limiting_cgroup ? ops->unified->dfd_lim
                                  : ops->unified->dfd_con;
 
        rsp.ret = 0;