MCPcopy Create free account
hub / github.com/containerd/cgroups / initializeSubsystem

Function initializeSubsystem

cgroup1/utils.go:250–270  ·  view source on GitHub ↗
(s Subsystem, path Path, resources *specs.LinuxResources)

Source from the content-addressed store, hash-verified

248}
249
250func initializeSubsystem(s Subsystem, path Path, resources *specs.LinuxResources) error {
251 if c, ok := s.(creator); ok {
252 p, err := path(s.Name())
253 if err != nil {
254 return err
255 }
256 if err := c.Create(p, resources); err != nil {
257 return err
258 }
259 } else if c, ok := s.(pather); ok {
260 p, err := path(s.Name())
261 if err != nil {
262 return err
263 }
264 // do the default create if the group does not have a custom one
265 if err := os.MkdirAll(c.Path(p), defaultDirPerm); err != nil {
266 return err
267 }
268 }
269 return nil
270}
271
272func cleanPath(path string) string {
273 if path == "" {

Callers 3

mockNewNotInRdmaFunction · 0.85
NewFunction · 0.85
NewMethod · 0.85

Calls 3

NameMethod · 0.65
CreateMethod · 0.65
PathMethod · 0.65

Tested by 1

mockNewNotInRdmaFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…