Merge pull request #6183 from crosbymichael/fix-freezer-fs

Don't rejoin the freezer cgroup each time
This commit is contained in:
Victor Vieux 2014-06-03 16:16:58 -07:00
commit 313ab78d1f

View file

@ -12,18 +12,20 @@ type freezerGroup struct {
} }
func (s *freezerGroup) Set(d *data) error { func (s *freezerGroup) Set(d *data) error {
dir, err := d.join("freezer") switch d.c.Freezer {
case cgroups.Frozen, cgroups.Thawed:
dir, err := d.path("freezer")
if err != nil { if err != nil {
if err != cgroups.ErrNotFound {
return err return err
} }
return nil
}
if d.c.Freezer != cgroups.Undefined {
if err := writeFile(dir, "freezer.state", string(d.c.Freezer)); err != nil { if err := writeFile(dir, "freezer.state", string(d.c.Freezer)); err != nil {
return err return err
} }
default:
if _, err := d.join("freezer"); err != nil && err != cgroups.ErrNotFound {
return err
}
} }
return nil return nil