]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
cgroups: remove unused conf argument
authorChristian Brauner <christian.brauner@ubuntu.com>
Tue, 2 Feb 2021 20:56:32 +0000 (21:56 +0100)
committerChristian Brauner <christian.brauner@ubuntu.com>
Tue, 2 Feb 2021 20:58:09 +0000 (21:58 +0100)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/cgroups/cgfsng.c
src/lxc/cgroups/cgroup.h
src/lxc/lxccontainer.c

index 78802ac76dee41eee848812071fa10a1b3be5201..638e2f3c152440bca70c63db857701075ad093ea 100644 (file)
@@ -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. */
-int cgroup_get(struct lxc_conf *conf,
-              const char *name, const char *lxcpath,
+int cgroup_get(const char *name, const char *lxcpath,
               const char *filename, char *buf, size_t len)
 {
        __do_close int unified_fd = -EBADF;
        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))
                return ret_errno(EINVAL);
 
@@ -3522,13 +3521,13 @@ int cgroup_get(struct lxc_conf *conf,
 }
 
 /* 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)
 {
        __do_close int unified_fd = -EBADF;
        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))
                return ret_errno(EINVAL);
 
@@ -3593,7 +3592,7 @@ static int __cgroup_freeze(int unified_fd,
        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;
        int ret;
@@ -3610,7 +3609,7 @@ bool cgroup_freeze(struct lxc_conf *conf, const char *name, const char *lxcpath,
        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;
        int ret;
index 4566f52176b13c85450d73ff2cb2aef63cf58157..ac702aeb928b31e591f862350120646183263423 100644 (file)
@@ -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,
                                  const char *lxcpath, pid_t pid);
-__hidden extern int cgroup_get(struct lxc_conf *conf, const char *name,
-                               const char *lxcpath, const char *filename,
-                               char *buf, size_t len);
-__hidden extern int cgroup_set(struct lxc_conf *conf, const char *name,
-                               const char *lxcpath, const char *filename,
-                               const char *value);
-__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);
+__hidden extern int cgroup_get(const char *name, const char *lxcpath,
+                               const char *filename, char *buf, size_t len);
+__hidden extern int cgroup_set(const char *name, const char *lxcpath,
+                               const char *filename, const char *value);
+__hidden extern bool cgroup_freeze(const char *name, const char *lxcpath, int timeout);
+__hidden extern bool cgroup_unfreeze(const char *name, const char *lxcpath, int timeout);
 
 static inline bool pure_unified_layout(const struct cgroup_ops *ops)
 {
index c309319d648d65a82f811ca66df62c68c98a7409..6879a1765b4f3c56eec892cc326e8f23a6b1c8e6 100644 (file)
@@ -515,7 +515,7 @@ static bool do_lxcapi_freeze(struct lxc_container *c)
 
        s = lxc_getstate(c->name, c->config_path);
        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)
                        bret = lxc_freeze(c->lxc_conf, c->name, c->config_path);
        }
@@ -535,7 +535,7 @@ static bool do_lxcapi_unfreeze(struct lxc_container *c)
 
        s = lxc_getstate(c->name, c->config_path);
        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)
                        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
        if (is_stopped(c))
                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) {
                cgroup_ops = cgroup_init(c->lxc_conf);
                if (!cgroup_ops)
@@ -3319,7 +3319,7 @@ static int do_lxcapi_get_cgroup_item(struct lxc_container *c, const char *subsys
        if (is_stopped(c))
                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) {
                cgroup_ops = cgroup_init(c->lxc_conf);
                if (!cgroup_ops)