From: Christian Brauner Date: Wed, 24 Feb 2021 09:58:43 +0000 (+0100) Subject: commands: s/_LIMITING_/_LIMIT_/g and s/_limiting_/_limit_/g X-Git-Tag: lxc-5.0.0~269^2~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a9b642ee5c63ebdabe6ed89ac4201dced32be0b8;p=thirdparty%2Flxc.git commands: s/_LIMITING_/_LIMIT_/g and s/_limiting_/_limit_/g Signed-off-by: Christian Brauner --- diff --git a/src/lxc/cgroups/cgfsng.c b/src/lxc/cgroups/cgfsng.c index 233367fa7..335e5b074 100644 --- a/src/lxc/cgroups/cgfsng.c +++ b/src/lxc/cgroups/cgfsng.c @@ -2058,8 +2058,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); } @@ -2370,7 +2370,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; @@ -2532,7 +2532,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; @@ -3337,7 +3337,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; @@ -3457,7 +3457,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); @@ -3479,7 +3479,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); @@ -3555,7 +3555,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); @@ -3580,7 +3580,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); diff --git a/src/lxc/cgroups/cgroup.h b/src/lxc/cgroups/cgroup.h index 1aeb8fbef..fb28648cc 100644 --- a/src/lxc/cgroups/cgroup.h +++ b/src/lxc/cgroups/cgroup.h @@ -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); diff --git a/src/lxc/commands.c b/src/lxc/commands.c index c2ec510c6..b94b94253 100644 --- a/src/lxc/commands.c +++ b/src/lxc/commands.c @@ -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 lxc_cmd_get_cgroup_callback_do(fd, req, handler, descr, true); } @@ -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 lxc_cmd_get_cgroup2_fd_callback_do(fd, req, handler, descr, true); @@ -1689,8 +1688,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, diff --git a/src/lxc/commands.h b/src/lxc/commands.h index 83eda38a5..0477a04de 100644 --- a/src/lxc/commands.h +++ b/src/lxc/commands.h @@ -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 */ diff --git a/src/lxc/criu.c b/src/lxc/criu.c index 6f0d10a0e..c630bf741 100644 --- a/src/lxc/criu.c +++ b/src/lxc/criu.c @@ -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");