commands: s/_LIMITING_/_LIMIT_/g and s/_limiting_/_limit_/g

parent dd65d42a
......@@ -2056,8 +2056,8 @@ __cgfsng_ops static const char *cgfsng_get_cgroup(struct cgroup_ops *ops,
return cgfsng_get_cgroup_do(ops, controller, false);
}
__cgfsng_ops static const char *cgfsng_get_limiting_cgroup(struct cgroup_ops *ops,
const char *controller)
__cgfsng_ops static const char *cgfsng_get_limit_cgroup(struct cgroup_ops *ops,
const char *controller)
{
return cgfsng_get_cgroup_do(ops, controller, true);
}
......@@ -2368,7 +2368,7 @@ __cgfsng_ops static int cgfsng_get(struct cgroup_ops *ops, const char *filename,
if (p)
*p = '\0';
path = lxc_cmd_get_limiting_cgroup_path(name, lxcpath, controller);
path = lxc_cmd_get_limit_cgroup_path(name, lxcpath, controller);
/* not running */
if (!path)
return -1;
......@@ -2530,7 +2530,7 @@ __cgfsng_ops static int cgfsng_set(struct cgroup_ops *ops,
return 0;
}
path = lxc_cmd_get_limiting_cgroup_path(name, lxcpath, controller);
path = lxc_cmd_get_limit_cgroup_path(name, lxcpath, controller);
/* not running */
if (!path)
return -1;
......@@ -3335,7 +3335,7 @@ struct cgroup_ops *cgroup_ops_init(struct lxc_conf *conf)
cgfsng_ops->chown = cgfsng_chown;
cgfsng_ops->mount = cgfsng_mount;
cgfsng_ops->devices_activate = cgfsng_devices_activate;
cgfsng_ops->get_limiting_cgroup = cgfsng_get_limiting_cgroup;
cgfsng_ops->get_limit_cgroup = cgfsng_get_limit_cgroup;
cgfsng_ops->criu_escape = cgfsng_criu_escape;
cgfsng_ops->criu_num_hierarchies = cgfsng_criu_num_hierarchies;
......@@ -3455,7 +3455,7 @@ int cgroup_get(const char *name, const char *lxcpath,
if ((buf && !len) || (len && !buf))
return ret_errno(EINVAL);
unified_fd = lxc_cmd_get_limiting_cgroup2_fd(name, lxcpath);
unified_fd = lxc_cmd_get_limit_cgroup2_fd(name, lxcpath);
if (unified_fd < 0)
return ret_errno(ENOSYS);
......@@ -3477,7 +3477,7 @@ int cgroup_set(const char *name, const char *lxcpath,
is_empty_string(name) || is_empty_string(lxcpath))
return ret_errno(EINVAL);
unified_fd = lxc_cmd_get_limiting_cgroup2_fd(name, lxcpath);
unified_fd = lxc_cmd_get_limit_cgroup2_fd(name, lxcpath);
if (unified_fd < 0)
return ret_errno(ENOSYS);
......@@ -3553,7 +3553,7 @@ int cgroup_freeze(const char *name, const char *lxcpath, int timeout)
if (is_empty_string(name) || is_empty_string(lxcpath))
return ret_errno(EINVAL);
unified_fd = lxc_cmd_get_limiting_cgroup2_fd(name, lxcpath);
unified_fd = lxc_cmd_get_limit_cgroup2_fd(name, lxcpath);
if (unified_fd < 0)
return ret_errno(ENOCGROUP2);
......@@ -3578,7 +3578,7 @@ int cgroup_unfreeze(const char *name, const char *lxcpath, int timeout)
if (is_empty_string(name) || is_empty_string(lxcpath))
return ret_errno(EINVAL);
unified_fd = lxc_cmd_get_limiting_cgroup2_fd(name, lxcpath);
unified_fd = lxc_cmd_get_limit_cgroup2_fd(name, lxcpath);
if (unified_fd < 0)
return ret_errno(ENOCGROUP2);
......
......@@ -248,7 +248,7 @@ struct cgroup_ops {
bool (*monitor_delegate_controllers)(struct cgroup_ops *ops);
bool (*payload_delegate_controllers)(struct cgroup_ops *ops);
void (*finalize)(struct cgroup_ops *ops);
const char *(*get_limiting_cgroup)(struct cgroup_ops *ops, const char *controller);
const char *(*get_limit_cgroup)(struct cgroup_ops *ops, const char *controller);
};
__hidden extern struct cgroup_ops *cgroup_init(struct lxc_conf *conf);
......
......@@ -84,8 +84,8 @@ static const char *lxc_cmd_str(lxc_cmd_t cmd)
[LXC_CMD_UNFREEZE] = "unfreeze",
[LXC_CMD_GET_CGROUP2_FD] = "get_cgroup2_fd",
[LXC_CMD_GET_INIT_PIDFD] = "get_init_pidfd",
[LXC_CMD_GET_LIMITING_CGROUP] = "get_limiting_cgroup",
[LXC_CMD_GET_LIMITING_CGROUP2_FD] = "get_limiting_cgroup2_fd",
[LXC_CMD_GET_LIMIT_CGROUP] = "get_limit_cgroup",
[LXC_CMD_GET_LIMIT_CGROUP2_FD] = "get_limit_cgroup2_fd",
[LXC_CMD_GET_DEVPTS_FD] = "get_devpts_fd",
[LXC_CMD_GET_SECCOMP_NOTIFY_FD] = "get_seccomp_notify_fd",
[LXC_CMD_GET_CGROUP_CTX] = "get_cgroup_ctx",
......@@ -140,7 +140,7 @@ static int lxc_cmd_rsp_recv(int sock, struct lxc_cmd_rr *cmd)
switch (cur_cmd) {
case LXC_CMD_GET_CGROUP2_FD:
__fallthrough;
case LXC_CMD_GET_LIMITING_CGROUP2_FD:
case LXC_CMD_GET_LIMIT_CGROUP2_FD:
__fallthrough;
case LXC_CMD_GET_INIT_PIDFD:
__fallthrough;
......@@ -190,7 +190,7 @@ static int lxc_cmd_rsp_recv(int sock, struct lxc_cmd_rr *cmd)
switch (cur_cmd) {
case LXC_CMD_GET_CGROUP2_FD:
__fallthrough;
case LXC_CMD_GET_LIMITING_CGROUP2_FD:
case LXC_CMD_GET_LIMIT_CGROUP2_FD:
__fallthrough;
case LXC_CMD_GET_INIT_PIDFD:
__fallthrough;
......@@ -738,7 +738,7 @@ static char *lxc_cmd_get_cgroup_path_do(const char *name, const char *lxcpath,
return NULL;
if (ret == 0) {
if (command == LXC_CMD_GET_LIMITING_CGROUP) {
if (command == LXC_CMD_GET_LIMIT_CGROUP) {
/*
* This may indicate that the container was started
* under an ealier version before
......@@ -779,10 +779,10 @@ char *lxc_cmd_get_cgroup_path(const char *name, const char *lxcpath,
}
/*
* lxc_cmd_get_limiting_cgroup_path: Calculate a container's limiting cgroup
* lxc_cmd_get_limit_cgroup_path: Calculate a container's limit cgroup
* path for a particular subsystem. This is the cgroup path relative to the
* root of the cgroup filesystem. This may be the same as the path returned by
* lxc_cmd_get_cgroup_path if the container doesn't have a limiting path prefix
* lxc_cmd_get_cgroup_path if the container doesn't have a limit path prefix
* set.
*
* @name : name of container to connect to
......@@ -792,11 +792,11 @@ char *lxc_cmd_get_cgroup_path(const char *name, const char *lxcpath,
* Returns the path on success, NULL on failure. The caller must free() the
* returned path.
*/
char *lxc_cmd_get_limiting_cgroup_path(const char *name, const char *lxcpath,
const char *subsystem)
char *lxc_cmd_get_limit_cgroup_path(const char *name, const char *lxcpath,
const char *subsystem)
{
return lxc_cmd_get_cgroup_path_do(name, lxcpath, subsystem,
LXC_CMD_GET_LIMITING_CGROUP);
LXC_CMD_GET_LIMIT_CGROUP);
}
static int lxc_cmd_get_cgroup_callback_do(int fd, struct lxc_cmd_req *req,
......@@ -820,7 +820,7 @@ static int lxc_cmd_get_cgroup_callback_do(int fd, struct lxc_cmd_req *req,
reqdata = NULL;
}
get_fn = (limiting_cgroup ? cgroup_ops->get_limiting_cgroup
get_fn = (limiting_cgroup ? cgroup_ops->get_limit_cgroup
: cgroup_ops->get_cgroup);
path = get_fn(cgroup_ops, reqdata);
......@@ -842,9 +842,9 @@ static int lxc_cmd_get_cgroup_callback(int fd, struct lxc_cmd_req *req,
return lxc_cmd_get_cgroup_callback_do(fd, req, handler, descr, false);
}
static int lxc_cmd_get_limiting_cgroup_callback(int fd, struct lxc_cmd_req *req,
struct lxc_handler *handler,
struct lxc_epoll_descr *descr)
static int lxc_cmd_get_limit_cgroup_callback(int fd, struct lxc_cmd_req *req,
struct lxc_handler *handler,
struct lxc_epoll_descr *descr)
{
return ret_errno(ENOSYS);
}
......@@ -1587,12 +1587,12 @@ int lxc_cmd_get_cgroup2_fd(const char *name, const char *lxcpath)
return PTR_TO_INT(cmd.rsp.data);
}
int lxc_cmd_get_limiting_cgroup2_fd(const char *name, const char *lxcpath)
int lxc_cmd_get_limit_cgroup2_fd(const char *name, const char *lxcpath)
{
int ret, stopped;
struct lxc_cmd_rr cmd = {
.req = {
.cmd = LXC_CMD_GET_LIMITING_CGROUP2_FD,
.cmd = LXC_CMD_GET_LIMIT_CGROUP2_FD,
},
.rsp = {
.ret = -ENOSYS,
......@@ -1643,10 +1643,9 @@ static int lxc_cmd_get_cgroup2_fd_callback(int fd, struct lxc_cmd_req *req,
false);
}
static int lxc_cmd_get_limiting_cgroup2_fd_callback(int fd,
struct lxc_cmd_req *req,
struct lxc_handler *handler,
struct lxc_epoll_descr *descr)
static int lxc_cmd_get_limit_cgroup2_fd_callback(int fd, struct lxc_cmd_req *req,
struct lxc_handler *handler,
struct lxc_epoll_descr *descr)
{
return ret_errno(ENOSYS);
}
......@@ -1688,8 +1687,8 @@ static int lxc_cmd_process(int fd, struct lxc_cmd_req *req,
[LXC_CMD_UNFREEZE] = lxc_cmd_unfreeze_callback,
[LXC_CMD_GET_CGROUP2_FD] = lxc_cmd_get_cgroup2_fd_callback,
[LXC_CMD_GET_INIT_PIDFD] = lxc_cmd_get_init_pidfd_callback,
[LXC_CMD_GET_LIMITING_CGROUP] = lxc_cmd_get_limiting_cgroup_callback,
[LXC_CMD_GET_LIMITING_CGROUP2_FD] = lxc_cmd_get_limiting_cgroup2_fd_callback,
[LXC_CMD_GET_LIMIT_CGROUP] = lxc_cmd_get_limit_cgroup_callback,
[LXC_CMD_GET_LIMIT_CGROUP2_FD] = lxc_cmd_get_limit_cgroup2_fd_callback,
[LXC_CMD_GET_DEVPTS_FD] = lxc_cmd_get_devpts_fd_callback,
[LXC_CMD_GET_SECCOMP_NOTIFY_FD] = lxc_cmd_get_seccomp_notify_fd_callback,
[LXC_CMD_GET_CGROUP_CTX] = lxc_cmd_get_cgroup_ctx_callback,
......
......@@ -40,8 +40,8 @@ typedef enum {
LXC_CMD_UNFREEZE = 16,
LXC_CMD_GET_CGROUP2_FD = 17,
LXC_CMD_GET_INIT_PIDFD = 18,
LXC_CMD_GET_LIMITING_CGROUP = 19,
LXC_CMD_GET_LIMITING_CGROUP2_FD = 20,
LXC_CMD_GET_LIMIT_CGROUP = 19,
LXC_CMD_GET_LIMIT_CGROUP2_FD = 20,
LXC_CMD_GET_DEVPTS_FD = 21,
LXC_CMD_GET_SECCOMP_NOTIFY_FD = 22,
LXC_CMD_GET_CGROUP_CTX = 23,
......@@ -137,9 +137,11 @@ __hidden extern int lxc_cmd_add_bpf_device_cgroup(const char *name, const char *
__hidden extern int lxc_cmd_freeze(const char *name, const char *lxcpath, int timeout);
__hidden extern int lxc_cmd_unfreeze(const char *name, const char *lxcpath, int timeout);
__hidden extern int lxc_cmd_get_cgroup2_fd(const char *name, const char *lxcpath);
__hidden extern char *lxc_cmd_get_limiting_cgroup_path(const char *name, const char *lxcpath,
const char *subsystem);
__hidden extern int lxc_cmd_get_limiting_cgroup2_fd(const char *name, const char *lxcpath);
__hidden extern char *lxc_cmd_get_limit_cgroup_path(const char *name,
const char *lxcpath,
const char *subsystem);
__hidden extern int lxc_cmd_get_limit_cgroup2_fd(const char *name,
const char *lxcpath);
__hidden extern int lxc_cmd_get_devpts_fd(const char *name, const char *lxcpath);
#endif /* __commands_h */
......@@ -304,19 +304,19 @@ static int exec_criu(struct cgroup_ops *cgroup_ops, struct lxc_conf *conf,
* the handler the restore task created.
*/
if (strequal(opts->action, "dump") || strequal(opts->action, "pre-dump")) {
cgroup_base_path = lxc_cmd_get_limiting_cgroup_path(opts->c->name, opts->c->config_path, controllers_list[0]);
cgroup_base_path = lxc_cmd_get_limit_cgroup_path(opts->c->name, opts->c->config_path, controllers_list[0]);
if (!cgroup_base_path)
return log_error_errno(-ENOENT, ENOENT, "Failed to retrieve limiting cgroup path for %s", controllers_list[0] ?: "(null)");
return log_error_errno(-ENOENT, ENOENT, "Failed to retrieve limit cgroup path for %s", controllers_list[0] ?: "(null)");
} else {
const char *p;
p = cgroup_ops->get_limiting_cgroup(cgroup_ops, controllers_list[0]);
p = cgroup_ops->get_limit_cgroup(cgroup_ops, controllers_list[0]);
if (!p)
return log_error_errno(-ENOENT, ENOENT, "Failed to retrieve limiting cgroup path for %s", controllers_list[0] ?: "(null)");
return log_error_errno(-ENOENT, ENOENT, "Failed to retrieve limit cgroup path for %s", controllers_list[0] ?: "(null)");
cgroup_base_path = strdup(p);
if (!cgroup_base_path)
return log_error_errno(-ENOMEM, ENOMEM, "Failed to duplicate limiting cgroup path");
return log_error_errno(-ENOMEM, ENOMEM, "Failed to duplicate limit cgroup path");
}
tmp = lxc_deslashify(cgroup_base_path);
......@@ -393,9 +393,9 @@ static int exec_criu(struct cgroup_ops *cgroup_ops, struct lxc_conf *conf,
DECLARE_ARG("-t");
DECLARE_ARG(init_pid_str);
freezer_relative = lxc_cmd_get_limiting_cgroup_path(opts->c->name,
opts->c->config_path,
"freezer");
freezer_relative = lxc_cmd_get_limit_cgroup_path(opts->c->name,
opts->c->config_path,
"freezer");
if (!freezer_relative)
return log_error_errno(-ENOENT, ENOENT, "Failed getting freezer path");
......
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