Skip to content

Commit 9067950

Browse files
committed
libcontainer/intelrdt: rename CAT and MBA enabled flags
Rename CAT and MBA enabled flags to be consistent with others. No functional change. Signed-off-by: Xiaochen Shen <[email protected]>
1 parent 3c4c811 commit 9067950

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

libcontainer/intelrdt/intelrdt.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -182,11 +182,11 @@ var (
182182
intelRdtRootLock sync.Mutex
183183

184184
// The flag to indicate if Intel RDT/CAT is enabled
185-
isCatEnabled bool
185+
catEnabled bool
186186
// The flag to indicate if Intel RDT/MBA is enabled
187-
isMbaEnabled bool
187+
mbaEnabled bool
188188
// The flag to indicate if Intel RDT/MBA Software Controller is enabled
189-
isMbaScEnabled bool
189+
mbaScEnabled bool
190190
)
191191

192192
type intelRdtData struct {
@@ -215,17 +215,17 @@ func init() {
215215
// (e.g., rdt=!l3cat,mba) in 4.14 and newer kernel
216216
if flagsSet.CAT {
217217
if _, err := os.Stat(filepath.Join(intelRdtRoot, "info", "L3")); err == nil {
218-
isCatEnabled = true
218+
catEnabled = true
219219
}
220220
}
221-
if isMbaScEnabled {
221+
if mbaScEnabled {
222222
// We confirm MBA Software Controller is enabled in step 2,
223223
// MBA should be enabled because MBA Software Controller
224224
// depends on MBA
225-
isMbaEnabled = true
225+
mbaEnabled = true
226226
} else if flagsSet.MBA {
227227
if _, err := os.Stat(filepath.Join(intelRdtRoot, "info", "MB")); err == nil {
228-
isMbaEnabled = true
228+
mbaEnabled = true
229229
}
230230
}
231231

@@ -263,7 +263,7 @@ func findIntelRdtMountpointDir(f io.Reader) (string, error) {
263263

264264
// Check if MBA Software Controller is enabled through mount option "-o mba_MBps"
265265
if strings.Contains(","+mi[0].VFSOptions+",", ",mba_MBps,") {
266-
isMbaScEnabled = true
266+
mbaScEnabled = true
267267
}
268268

269269
return mi[0].Mountpoint, nil
@@ -516,17 +516,17 @@ func WriteIntelRdtTasks(dir string, pid int) error {
516516

517517
// Check if Intel RDT/CAT is enabled
518518
func IsCatEnabled() bool {
519-
return isCatEnabled
519+
return catEnabled
520520
}
521521

522522
// Check if Intel RDT/MBA is enabled
523523
func IsMbaEnabled() bool {
524-
return isMbaEnabled
524+
return mbaEnabled
525525
}
526526

527527
// Check if Intel RDT/MBA Software Controller is enabled
528528
func IsMbaScEnabled() bool {
529-
return isMbaScEnabled
529+
return mbaScEnabled
530530
}
531531

532532
// Get the 'container_id' path in Intel RDT "resource control" filesystem

0 commit comments

Comments
 (0)