From: Christian Brauner Date: Sun, 21 Feb 2021 10:16:30 +0000 (+0100) Subject: cgroups: s/cgfd_limit/dfd_lim/g X-Git-Tag: lxc-5.0.0~274^2~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c0af7b1c96b4d906d0bd897940acee59b5f23bfb;p=thirdparty%2Flxc.git cgroups: s/cgfd_limit/dfd_lim/g Signed-off-by: Christian Brauner --- diff --git a/src/lxc/cgroups/cgfsng.c b/src/lxc/cgroups/cgfsng.c index b156a6bce..8bd9476a2 100644 --- a/src/lxc/cgroups/cgfsng.c +++ b/src/lxc/cgroups/cgfsng.c @@ -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) diff --git a/src/lxc/cgroups/cgroup.c b/src/lxc/cgroups/cgroup.c index 7f0e7f8ca..7a89f30f1 100644 --- a/src/lxc/cgroups/cgroup.c +++ b/src/lxc/cgroups/cgroup.c @@ -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); diff --git a/src/lxc/cgroups/cgroup.h b/src/lxc/cgroups/cgroup.h index 9ed8395be..f75fada48 100644 --- a/src/lxc/cgroups/cgroup.h +++ b/src/lxc/cgroups/cgroup.h @@ -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; diff --git a/src/lxc/cgroups/cgroup2_devices.c b/src/lxc/cgroups/cgroup2_devices.c index 297eb9f85..db9177f73 100644 --- a/src/lxc/cgroups/cgroup2_devices.c +++ b/src/lxc/cgroups/cgroup2_devices.c @@ -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); /* diff --git a/src/lxc/commands.c b/src/lxc/commands.c index 5de8c5468..ccc5848e6 100644 --- a/src/lxc/commands.c +++ b/src/lxc/commands.c @@ -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;