cgroups: s/cgfd_mon/dfd_mon/g

parent e33870e5
...@@ -403,7 +403,7 @@ static int cgroup_hierarchy_add(struct cgroup_ops *ops, int dfd_mnt, char *mnt, ...@@ -403,7 +403,7 @@ static int cgroup_hierarchy_add(struct cgroup_ops *ops, int dfd_mnt, char *mnt,
new->dfd_con = -EBADF; new->dfd_con = -EBADF;
new->cgfd_limit = -EBADF; new->cgfd_limit = -EBADF;
new->cgfd_mon = -EBADF; new->dfd_mon = -EBADF;
new->fs_type = fs_type; new->fs_type = fs_type;
new->controllers = controllers; new->controllers = controllers;
...@@ -814,7 +814,7 @@ static bool cgroup_tree_create(struct cgroup_ops *ops, struct lxc_conf *conf, ...@@ -814,7 +814,7 @@ static bool cgroup_tree_create(struct cgroup_ops *ops, struct lxc_conf *conf,
else else
h->container_limit_path = h->container_full_path; h->container_limit_path = h->container_full_path;
} else { } else {
h->cgfd_mon = move_fd(fd_final); h->dfd_mon = move_fd(fd_final);
} }
return true; return true;
...@@ -834,10 +834,10 @@ static void cgroup_tree_prune_leaf(struct hierarchy *h, const char *path_prune, ...@@ -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); close_equal(h->dfd_con, h->cgfd_limit);
} else { } else {
/* Check whether we actually created the cgroup to prune. */ /* Check whether we actually created the cgroup to prune. */
if (h->cgfd_mon < 0) if (h->dfd_mon < 0)
prune = false; prune = false;
close_prot_errno_disarm(h->cgfd_mon); close_prot_errno_disarm(h->dfd_mon);
} }
/* We didn't create this cgroup. */ /* We didn't create this cgroup. */
...@@ -1183,20 +1183,20 @@ __cgfsng_ops static bool cgfsng_monitor_enter(struct cgroup_ops *ops, ...@@ -1183,20 +1183,20 @@ __cgfsng_ops static bool cgfsng_monitor_enter(struct cgroup_ops *ops,
struct hierarchy *h = ops->hierarchies[i]; struct hierarchy *h = ops->hierarchies[i];
int ret; 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) 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) if (handler->transient_pid <= 0)
continue; 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) 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 * 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, ...@@ -1205,7 +1205,7 @@ __cgfsng_ops static bool cgfsng_monitor_enter(struct cgroup_ops *ops,
* lot of them. * lot of them.
*/ */
if (!is_unified_hierarchy(h)) if (!is_unified_hierarchy(h))
close_prot_errno_disarm(h->cgfd_mon); close_prot_errno_disarm(h->dfd_mon);
} }
handler->transient_pid = -1; handler->transient_pid = -1;
......
...@@ -93,8 +93,8 @@ void cgroup_exit(struct cgroup_ops *ops) ...@@ -93,8 +93,8 @@ void cgroup_exit(struct cgroup_ops *ops)
close_equal((*it)->dfd_con, (*it)->cgfd_limit); close_equal((*it)->dfd_con, (*it)->cgfd_limit);
if ((*it)->cgfd_mon >= 0) if ((*it)->dfd_mon >= 0)
close((*it)->cgfd_mon); close((*it)->dfd_mon);
close_equal((*it)->dfd_base, (*it)->dfd_mnt); close_equal((*it)->dfd_base, (*it)->dfd_mnt);
......
...@@ -102,7 +102,7 @@ struct hierarchy { ...@@ -102,7 +102,7 @@ struct hierarchy {
int cgfd_limit; int cgfd_limit;
/* File descriptor for the monitor's cgroup. */ /* File descriptor for the monitor's cgroup. */
int cgfd_mon; int dfd_mon;
/* File descriptor for the controller's mountpoint @at_mnt. */ /* File descriptor for the controller's mountpoint @at_mnt. */
int dfd_mnt; int dfd_mnt;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment