mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-11 06:03:57 +08:00
libct/cg/fs: rename join to apply
As this is called from the Apply() method, it's a natural name. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
@@ -21,7 +21,7 @@ func (s *BlkioGroup) Name() string {
|
||||
}
|
||||
|
||||
func (s *BlkioGroup) Apply(path string, d *cgroupData) error {
|
||||
return join(path, d.pid)
|
||||
return apply(path, d.pid)
|
||||
}
|
||||
|
||||
func (s *BlkioGroup) Set(path string, r *configs.Resources) error {
|
||||
|
||||
@@ -35,7 +35,7 @@ func (s *CpuacctGroup) Name() string {
|
||||
}
|
||||
|
||||
func (s *CpuacctGroup) Apply(path string, d *cgroupData) error {
|
||||
return join(path, d.pid)
|
||||
return apply(path, d.pid)
|
||||
}
|
||||
|
||||
func (s *CpuacctGroup) Set(_ string, _ *configs.Resources) error {
|
||||
|
||||
@@ -29,7 +29,7 @@ func (s *DevicesGroup) Apply(path string, d *cgroupData) error {
|
||||
// is a hard requirement for container's security.
|
||||
return errSubsystemDoesNotExist
|
||||
}
|
||||
return join(path, d.pid)
|
||||
return apply(path, d.pid)
|
||||
}
|
||||
|
||||
func loadEmulator(path string) (*cgroupdevices.Emulator, error) {
|
||||
|
||||
@@ -20,7 +20,7 @@ func (s *FreezerGroup) Name() string {
|
||||
}
|
||||
|
||||
func (s *FreezerGroup) Apply(path string, d *cgroupData) error {
|
||||
return join(path, d.pid)
|
||||
return apply(path, d.pid)
|
||||
}
|
||||
|
||||
func (s *FreezerGroup) Set(path string, r *configs.Resources) (Err error) {
|
||||
|
||||
@@ -15,7 +15,7 @@ func (s *HugetlbGroup) Name() string {
|
||||
}
|
||||
|
||||
func (s *HugetlbGroup) Apply(path string, d *cgroupData) error {
|
||||
return join(path, d.pid)
|
||||
return apply(path, d.pid)
|
||||
}
|
||||
|
||||
func (s *HugetlbGroup) Set(path string, r *configs.Resources) error {
|
||||
|
||||
@@ -31,7 +31,7 @@ func (s *MemoryGroup) Name() string {
|
||||
}
|
||||
|
||||
func (s *MemoryGroup) Apply(path string, d *cgroupData) (err error) {
|
||||
return join(path, d.pid)
|
||||
return apply(path, d.pid)
|
||||
}
|
||||
|
||||
func setMemory(path string, val int64) error {
|
||||
|
||||
@@ -17,7 +17,7 @@ func (s *NameGroup) Name() string {
|
||||
func (s *NameGroup) Apply(path string, d *cgroupData) error {
|
||||
if s.Join {
|
||||
// ignore errors if the named cgroup does not exist
|
||||
_ = join(path, d.pid)
|
||||
_ = apply(path, d.pid)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ func (s *NetClsGroup) Name() string {
|
||||
}
|
||||
|
||||
func (s *NetClsGroup) Apply(path string, d *cgroupData) error {
|
||||
return join(path, d.pid)
|
||||
return apply(path, d.pid)
|
||||
}
|
||||
|
||||
func (s *NetClsGroup) Set(path string, r *configs.Resources) error {
|
||||
|
||||
@@ -12,7 +12,7 @@ func (s *NetPrioGroup) Name() string {
|
||||
}
|
||||
|
||||
func (s *NetPrioGroup) Apply(path string, d *cgroupData) error {
|
||||
return join(path, d.pid)
|
||||
return apply(path, d.pid)
|
||||
}
|
||||
|
||||
func (s *NetPrioGroup) Set(path string, r *configs.Resources) error {
|
||||
|
||||
@@ -162,7 +162,7 @@ func (raw *cgroupData) path(subsystem string) (string, error) {
|
||||
return filepath.Join(parentPath, raw.innerPath), nil
|
||||
}
|
||||
|
||||
func join(path string, pid int) error {
|
||||
func apply(path string, pid int) error {
|
||||
if path == "" {
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ func (s *PerfEventGroup) Name() string {
|
||||
}
|
||||
|
||||
func (s *PerfEventGroup) Apply(path string, d *cgroupData) error {
|
||||
return join(path, d.pid)
|
||||
return apply(path, d.pid)
|
||||
}
|
||||
|
||||
func (s *PerfEventGroup) Set(_ string, _ *configs.Resources) error {
|
||||
|
||||
@@ -16,7 +16,7 @@ func (s *PidsGroup) Name() string {
|
||||
}
|
||||
|
||||
func (s *PidsGroup) Apply(path string, d *cgroupData) error {
|
||||
return join(path, d.pid)
|
||||
return apply(path, d.pid)
|
||||
}
|
||||
|
||||
func (s *PidsGroup) Set(path string, r *configs.Resources) error {
|
||||
|
||||
@@ -13,7 +13,7 @@ func (s *RdmaGroup) Name() string {
|
||||
}
|
||||
|
||||
func (s *RdmaGroup) Apply(path string, d *cgroupData) error {
|
||||
return join(path, d.pid)
|
||||
return apply(path, d.pid)
|
||||
}
|
||||
|
||||
func (s *RdmaGroup) Set(path string, r *configs.Resources) error {
|
||||
|
||||
Reference in New Issue
Block a user