mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-11 06:03:57 +08:00
libct/configs: rm IOPrioClassMapping
This is an internal implementation detail and should not be either
public or visible.
Amend setIOPriority to do own class conversion.
Fixes: bfbd0305 ("Add I/O priority")
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
@@ -286,12 +286,6 @@ func ToSchedAttr(scheduler *Scheduler) (*unix.SchedAttr, error) {
|
||||
}, nil
|
||||
}
|
||||
|
||||
var IOPrioClassMapping = map[specs.IOPriorityClass]int{
|
||||
specs.IOPRIO_CLASS_RT: 1,
|
||||
specs.IOPRIO_CLASS_BE: 2,
|
||||
specs.IOPRIO_CLASS_IDLE: 3,
|
||||
}
|
||||
|
||||
type IOPriority = specs.LinuxIOPriority
|
||||
|
||||
type (
|
||||
|
||||
@@ -685,8 +685,15 @@ func setupIOPriority(config *configs.Config) error {
|
||||
if ioprio == nil {
|
||||
return nil
|
||||
}
|
||||
class, ok := configs.IOPrioClassMapping[ioprio.Class]
|
||||
if !ok {
|
||||
class := 0
|
||||
switch ioprio.Class {
|
||||
case specs.IOPRIO_CLASS_RT:
|
||||
class = 1
|
||||
case specs.IOPRIO_CLASS_BE:
|
||||
class = 2
|
||||
case specs.IOPRIO_CLASS_IDLE:
|
||||
class = 3
|
||||
default:
|
||||
return fmt.Errorf("invalid io priority class: %s", ioprio.Class)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user