cgroups: remove unused conf argument

parent 281c3645
...@@ -3496,14 +3496,13 @@ struct cgroup_ops *cgfsng_ops_init(struct lxc_conf *conf) ...@@ -3496,14 +3496,13 @@ struct cgroup_ops *cgfsng_ops_init(struct lxc_conf *conf)
} }
/* Connects to command socket therefore isn't callable from command handler. */ /* Connects to command socket therefore isn't callable from command handler. */
int cgroup_get(struct lxc_conf *conf, int cgroup_get(const char *name, const char *lxcpath,
const char *name, const char *lxcpath,
const char *filename, char *buf, size_t len) const char *filename, char *buf, size_t len)
{ {
__do_close int unified_fd = -EBADF; __do_close int unified_fd = -EBADF;
ssize_t ret; ssize_t ret;
if (!conf || is_empty_string(filename) || is_empty_string(name) || if (is_empty_string(filename) || is_empty_string(name) ||
is_empty_string(lxcpath)) is_empty_string(lxcpath))
return ret_errno(EINVAL); return ret_errno(EINVAL);
...@@ -3522,13 +3521,13 @@ int cgroup_get(struct lxc_conf *conf, ...@@ -3522,13 +3521,13 @@ int cgroup_get(struct lxc_conf *conf,
} }
/* Connects to command socket therefore isn't callable from command handler. */ /* Connects to command socket therefore isn't callable from command handler. */
int cgroup_set(struct lxc_conf *conf, const char *name, const char *lxcpath, int cgroup_set(const char *name, const char *lxcpath,
const char *filename, const char *value) const char *filename, const char *value)
{ {
__do_close int unified_fd = -EBADF; __do_close int unified_fd = -EBADF;
ssize_t ret; ssize_t ret;
if (!conf || is_empty_string(filename) || is_empty_string(value) || if (is_empty_string(filename) || is_empty_string(value) ||
is_empty_string(name) || is_empty_string(lxcpath)) is_empty_string(name) || is_empty_string(lxcpath))
return ret_errno(EINVAL); return ret_errno(EINVAL);
...@@ -3593,7 +3592,7 @@ static int __cgroup_freeze(int unified_fd, ...@@ -3593,7 +3592,7 @@ static int __cgroup_freeze(int unified_fd,
return log_trace(0, "Container now %s", (state_num == 1) ? "frozen" : "unfrozen"); return log_trace(0, "Container now %s", (state_num == 1) ? "frozen" : "unfrozen");
} }
bool cgroup_freeze(struct lxc_conf *conf, const char *name, const char *lxcpath, int timeout) bool cgroup_freeze(const char *name, const char *lxcpath, int timeout)
{ {
__do_close int unified_fd = -EBADF; __do_close int unified_fd = -EBADF;
int ret; int ret;
...@@ -3610,7 +3609,7 @@ bool cgroup_freeze(struct lxc_conf *conf, const char *name, const char *lxcpath, ...@@ -3610,7 +3609,7 @@ bool cgroup_freeze(struct lxc_conf *conf, const char *name, const char *lxcpath,
return ret == 0; return ret == 0;
} }
bool cgroup_unfreeze(struct lxc_conf *conf, const char *name, const char *lxcpath, int timeout) bool cgroup_unfreeze(const char *name, const char *lxcpath, int timeout)
{ {
__do_close int unified_fd = -EBADF; __do_close int unified_fd = -EBADF;
int ret; int ret;
......
...@@ -191,16 +191,12 @@ __hidden extern void prune_init_scope(char *cg); ...@@ -191,16 +191,12 @@ __hidden extern void prune_init_scope(char *cg);
__hidden extern int cgroup_attach(const struct lxc_conf *conf, const char *name, __hidden extern int cgroup_attach(const struct lxc_conf *conf, const char *name,
const char *lxcpath, pid_t pid); const char *lxcpath, pid_t pid);
__hidden extern int cgroup_get(struct lxc_conf *conf, const char *name, __hidden extern int cgroup_get(const char *name, const char *lxcpath,
const char *lxcpath, const char *filename, const char *filename, char *buf, size_t len);
char *buf, size_t len); __hidden extern int cgroup_set(const char *name, const char *lxcpath,
__hidden extern int cgroup_set(struct lxc_conf *conf, const char *name, const char *filename, const char *value);
const char *lxcpath, const char *filename, __hidden extern bool cgroup_freeze(const char *name, const char *lxcpath, int timeout);
const char *value); __hidden extern bool cgroup_unfreeze(const char *name, const char *lxcpath, int timeout);
__hidden extern bool cgroup_freeze(struct lxc_conf *conf, const char *name,
const char *lxcpath, int timeout);
__hidden extern bool cgroup_unfreeze(struct lxc_conf *conf, const char *name,
const char *lxcpath, int timeout);
static inline bool pure_unified_layout(const struct cgroup_ops *ops) static inline bool pure_unified_layout(const struct cgroup_ops *ops)
{ {
......
...@@ -515,7 +515,7 @@ static bool do_lxcapi_freeze(struct lxc_container *c) ...@@ -515,7 +515,7 @@ static bool do_lxcapi_freeze(struct lxc_container *c)
s = lxc_getstate(c->name, c->config_path); s = lxc_getstate(c->name, c->config_path);
if (s != FROZEN) { if (s != FROZEN) {
bret = cgroup_freeze(c->lxc_conf, c->name, c->config_path, -1); bret = cgroup_freeze(c->name, c->config_path, -1);
if (!bret && errno == ENOCGROUP2) if (!bret && errno == ENOCGROUP2)
bret = lxc_freeze(c->lxc_conf, c->name, c->config_path); bret = lxc_freeze(c->lxc_conf, c->name, c->config_path);
} }
...@@ -535,7 +535,7 @@ static bool do_lxcapi_unfreeze(struct lxc_container *c) ...@@ -535,7 +535,7 @@ static bool do_lxcapi_unfreeze(struct lxc_container *c)
s = lxc_getstate(c->name, c->config_path); s = lxc_getstate(c->name, c->config_path);
if (s == FROZEN) { if (s == FROZEN) {
bret = cgroup_unfreeze(c->lxc_conf, c->name, c->config_path, -1); bret = cgroup_unfreeze(c->name, c->config_path, -1);
if (!bret && errno == ENOCGROUP2) if (!bret && errno == ENOCGROUP2)
bret = lxc_unfreeze(c->lxc_conf, c->name, c->config_path); bret = lxc_unfreeze(c->lxc_conf, c->name, c->config_path);
} }
...@@ -3294,7 +3294,7 @@ static bool do_lxcapi_set_cgroup_item(struct lxc_container *c, const char *subsy ...@@ -3294,7 +3294,7 @@ static bool do_lxcapi_set_cgroup_item(struct lxc_container *c, const char *subsy
if (is_stopped(c)) if (is_stopped(c))
return false; return false;
ret = cgroup_set(c->lxc_conf, c->name, c->config_path, subsys, value); ret = cgroup_set(c->name, c->config_path, subsys, value);
if (ret == ENOCGROUP2) { if (ret == ENOCGROUP2) {
cgroup_ops = cgroup_init(c->lxc_conf); cgroup_ops = cgroup_init(c->lxc_conf);
if (!cgroup_ops) if (!cgroup_ops)
...@@ -3319,7 +3319,7 @@ static int do_lxcapi_get_cgroup_item(struct lxc_container *c, const char *subsys ...@@ -3319,7 +3319,7 @@ static int do_lxcapi_get_cgroup_item(struct lxc_container *c, const char *subsys
if (is_stopped(c)) if (is_stopped(c))
return -1; return -1;
ret = cgroup_get(c->lxc_conf, c->name, c->config_path, subsys, retv, inlen); ret = cgroup_get(c->name, c->config_path, subsys, retv, inlen);
if (ret == ENOCGROUP2) { if (ret == ENOCGROUP2) {
cgroup_ops = cgroup_init(c->lxc_conf); cgroup_ops = cgroup_init(c->lxc_conf);
if (!cgroup_ops) if (!cgroup_ops)
......
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