From 6a32c81772172e609eccf4500c3efda64a2a6fee Mon Sep 17 00:00:00 2001 From: Christian Brauner Date: Sun, 21 Feb 2021 11:15:37 +0100 Subject: [PATCH] cgroups: s/cgfd_mon/dfd_mon/g Signed-off-by: Christian Brauner --- src/lxc/cgroups/cgfsng.c | 22 +++++++++++----------- src/lxc/cgroups/cgroup.c | 4 ++-- src/lxc/cgroups/cgroup.h | 2 +- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/lxc/cgroups/cgfsng.c b/src/lxc/cgroups/cgfsng.c index efa7afbf3..b156a6bce 100644 --- a/src/lxc/cgroups/cgfsng.c +++ b/src/lxc/cgroups/cgfsng.c @@ -403,7 +403,7 @@ static int cgroup_hierarchy_add(struct cgroup_ops *ops, int dfd_mnt, char *mnt, new->dfd_con = -EBADF; new->cgfd_limit = -EBADF; - new->cgfd_mon = -EBADF; + new->dfd_mon = -EBADF; new->fs_type = fs_type; new->controllers = controllers; @@ -814,7 +814,7 @@ static bool cgroup_tree_create(struct cgroup_ops *ops, struct lxc_conf *conf, else h->container_limit_path = h->container_full_path; } else { - h->cgfd_mon = move_fd(fd_final); + h->dfd_mon = move_fd(fd_final); } return true; @@ -834,10 +834,10 @@ static void cgroup_tree_prune_leaf(struct hierarchy *h, const char *path_prune, close_equal(h->dfd_con, h->cgfd_limit); } else { /* Check whether we actually created the cgroup to prune. */ - if (h->cgfd_mon < 0) + if (h->dfd_mon < 0) prune = false; - close_prot_errno_disarm(h->cgfd_mon); + close_prot_errno_disarm(h->dfd_mon); } /* We didn't create this cgroup. */ @@ -1183,20 +1183,20 @@ __cgfsng_ops static bool cgfsng_monitor_enter(struct cgroup_ops *ops, struct hierarchy *h = ops->hierarchies[i]; int ret; - ret = lxc_writeat(h->cgfd_mon, "cgroup.procs", monitor, monitor_len); + ret = lxc_writeat(h->dfd_mon, "cgroup.procs", monitor, monitor_len); if (ret) - return log_error_errno(false, errno, "Failed to enter cgroup %d", h->cgfd_mon); + return log_error_errno(false, errno, "Failed to enter cgroup %d", h->dfd_mon); - TRACE("Moved monitor into cgroup %d", h->cgfd_mon); + TRACE("Moved monitor into cgroup %d", h->dfd_mon); if (handler->transient_pid <= 0) continue; - ret = lxc_writeat(h->cgfd_mon, "cgroup.procs", transient, transient_len); + ret = lxc_writeat(h->dfd_mon, "cgroup.procs", transient, transient_len); if (ret) - return log_error_errno(false, errno, "Failed to enter cgroup %d", h->cgfd_mon); + return log_error_errno(false, errno, "Failed to enter cgroup %d", h->dfd_mon); - TRACE("Moved transient process into cgroup %d", h->cgfd_mon); + TRACE("Moved transient process into cgroup %d", h->dfd_mon); /* * we don't keep the fds for non-unified hierarchies around @@ -1205,7 +1205,7 @@ __cgfsng_ops static bool cgfsng_monitor_enter(struct cgroup_ops *ops, * lot of them. */ if (!is_unified_hierarchy(h)) - close_prot_errno_disarm(h->cgfd_mon); + close_prot_errno_disarm(h->dfd_mon); } handler->transient_pid = -1; diff --git a/src/lxc/cgroups/cgroup.c b/src/lxc/cgroups/cgroup.c index d523b5845..7f0e7f8ca 100644 --- a/src/lxc/cgroups/cgroup.c +++ b/src/lxc/cgroups/cgroup.c @@ -93,8 +93,8 @@ void cgroup_exit(struct cgroup_ops *ops) close_equal((*it)->dfd_con, (*it)->cgfd_limit); - if ((*it)->cgfd_mon >= 0) - close((*it)->cgfd_mon); + if ((*it)->dfd_mon >= 0) + close((*it)->dfd_mon); close_equal((*it)->dfd_base, (*it)->dfd_mnt); diff --git a/src/lxc/cgroups/cgroup.h b/src/lxc/cgroups/cgroup.h index 3ad83e003..9ed8395be 100644 --- a/src/lxc/cgroups/cgroup.h +++ b/src/lxc/cgroups/cgroup.h @@ -102,7 +102,7 @@ struct hierarchy { int cgfd_limit; /* File descriptor for the monitor's cgroup. */ - int cgfd_mon; + int dfd_mon; /* File descriptor for the controller's mountpoint @at_mnt. */ int dfd_mnt; -- 2.47.2