libct: align param type for mountCgroupV1/V2 functions

Signed-off-by: lifubang <lifubang@acmcoder.com>
This commit is contained in:
lifubang
2025-05-08 15:13:04 +00:00
committed by Aleksa Sarai
parent d61fd29d85
commit 4b37cd93f8
+5 -5
View File
@@ -297,8 +297,8 @@ func cleanupTmp(tmpdir string) {
_ = os.RemoveAll(tmpdir)
}
func mountCgroupV1(m *configs.Mount, c *mountConfig) error {
binds, err := getCgroupMounts(m)
func mountCgroupV1(m mountEntry, c *mountConfig) error {
binds, err := getCgroupMounts(m.Mount)
if err != nil {
return err
}
@@ -368,7 +368,7 @@ func mountCgroupV1(m *configs.Mount, c *mountConfig) error {
return nil
}
func mountCgroupV2(m *configs.Mount, c *mountConfig) error {
func mountCgroupV2(m mountEntry, c *mountConfig) error {
err := utils.WithProcfd(c.root, m.Destination, func(dstFd string) error {
return mountViaFds(m.Source, nil, m.Destination, dstFd, "cgroup2", uintptr(m.Flags), m.Data)
})
@@ -739,9 +739,9 @@ func mountToRootfs(c *mountConfig, m mountEntry) error {
return setRecAttr(m.Mount, rootfs)
case "cgroup":
if cgroups.IsCgroup2UnifiedMode() {
return mountCgroupV2(m.Mount, c)
return mountCgroupV2(m, c)
}
return mountCgroupV1(m.Mount, c)
return mountCgroupV1(m, c)
default:
return mountPropagate(m, rootfs, mountLabel)
}