From 480bca91be6361f89d22a2005438a5c14c01bd06 Mon Sep 17 00:00:00 2001 From: Kir Kolyshkin Date: Sat, 4 Apr 2020 11:04:29 -0700 Subject: [PATCH] cgroups/fs2: move type decl to beginning It was weird having it somewhere in the middle. No code change, just moving it around. Signed-off-by: Kir Kolyshkin --- libcontainer/cgroups/fs2/fs2.go | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/libcontainer/cgroups/fs2/fs2.go b/libcontainer/cgroups/fs2/fs2.go index 8697e3c7..4ab291b1 100644 --- a/libcontainer/cgroups/fs2/fs2.go +++ b/libcontainer/cgroups/fs2/fs2.go @@ -13,6 +13,16 @@ import ( "github.com/pkg/errors" ) +type manager struct { + config *configs.Cgroup + // dirPath is like "/sys/fs/cgroup/user.slice/user-1001.slice/session-1.scope" + dirPath string + // controllers is content of "cgroup.controllers" file. + // excludes pseudo-controllers ("devices" and "freezer"). + controllers map[string]struct{} + rootless bool +} + // NewManager creates a manager for cgroup v2 unified hierarchy. // dirPath is like "/sys/fs/cgroup/user.slice/user-1001.slice/session-1.scope". // If dirPath is empty, it is automatically set using config. @@ -62,16 +72,6 @@ func detectControllers(dirPath string) (map[string]struct{}, error) { return controllers, nil } -type manager struct { - config *configs.Cgroup - // dirPath is like "/sys/fs/cgroup/user.slice/user-1001.slice/session-1.scope" - dirPath string - // controllers is content of "cgroup.controllers" file. - // excludes pseudo-controllers ("devices" and "freezer"). - controllers map[string]struct{} - rootless bool -} - func (m *manager) Apply(pid int) error { if err := cgroups.WriteCgroupProc(m.dirPath, pid); err != nil && !m.rootless { return err