Skip to content

Commit

Permalink
cgroups: pass handler to cgroup mount() method
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
  • Loading branch information
Christian Brauner committed Feb 26, 2021
1 parent 9798822 commit c915eca
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/lxc/cgroups/cgfsng.c
Expand Up @@ -1866,11 +1866,12 @@ static inline int cg_mount_cgroup_full(int type, struct hierarchy *h,
}

__cgfsng_ops static bool cgfsng_mount(struct cgroup_ops *ops,
struct lxc_conf *conf, int type)
struct lxc_handler *handler, int type)
{
__do_close int dfd_mnt_cgroupfs = -EBADF, fd_fs = -EBADF;
__do_free char *cgroup_root = NULL;
bool has_cgns = false, wants_force_mount = false;
struct lxc_conf *conf = handler->conf;
struct lxc_rootfs *rootfs = &conf->rootfs;
const char *rootfs_mnt = get_rootfs_mnt(rootfs);
int ret;
Expand Down
2 changes: 1 addition & 1 deletion src/lxc/cgroups/cgroup.h
Expand Up @@ -172,7 +172,7 @@ struct cgroup_ops {
bool (*chown)(struct cgroup_ops *ops, struct lxc_conf *conf);
bool (*attach)(struct cgroup_ops *ops, const struct lxc_conf *conf,
const char *name, const char *lxcpath, pid_t pid);
bool (*mount)(struct cgroup_ops *ops, struct lxc_conf *conf, int type);
bool (*mount)(struct cgroup_ops *ops, struct lxc_handler *handler, int type);
bool (*devices_activate)(struct cgroup_ops *ops,
struct lxc_handler *handler);
bool (*monitor_delegate_controllers)(struct cgroup_ops *ops);
Expand Down
2 changes: 1 addition & 1 deletion src/lxc/conf.c
Expand Up @@ -704,7 +704,7 @@ static int lxc_mount_auto_mounts(struct lxc_handler *handler, int flags)
if (flags & LXC_AUTO_CGROUP_FORCE)
cg_flags |= LXC_AUTO_CGROUP_FORCE;

if (!handler->cgroup_ops->mount(handler->cgroup_ops, conf, cg_flags))
if (!handler->cgroup_ops->mount(handler->cgroup_ops, handler, cg_flags))
return log_error_errno(-1, errno, "Failed to mount \"/sys/fs/cgroup\"");
}

Expand Down

0 comments on commit c915eca

Please sign in to comment.