1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

tfix: modify internal variable name to be lower-case

Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
This commit is contained in:
Ma Shimiao 2015-12-15 09:50:16 +08:00
parent 8970337f60
commit 38797ca61b

View file

@ -46,17 +46,17 @@ const (
func getBlkioWeightDevices(config *runconfig.HostConfig) ([]*blkiodev.WeightDevice, error) { func getBlkioWeightDevices(config *runconfig.HostConfig) ([]*blkiodev.WeightDevice, error) {
var stat syscall.Stat_t var stat syscall.Stat_t
var BlkioWeightDevices []*blkiodev.WeightDevice var blkioWeightDevices []*blkiodev.WeightDevice
for _, weightDevice := range config.BlkioWeightDevice { for _, weightDevice := range config.BlkioWeightDevice {
if err := syscall.Stat(weightDevice.Path, &stat); err != nil { if err := syscall.Stat(weightDevice.Path, &stat); err != nil {
return nil, err return nil, err
} }
WeightDevice := blkiodev.NewWeightDevice(int64(stat.Rdev/256), int64(stat.Rdev%256), weightDevice.Weight, 0) weightDevice := blkiodev.NewWeightDevice(int64(stat.Rdev/256), int64(stat.Rdev%256), weightDevice.Weight, 0)
BlkioWeightDevices = append(BlkioWeightDevices, WeightDevice) blkioWeightDevices = append(blkioWeightDevices, weightDevice)
} }
return BlkioWeightDevices, nil return blkioWeightDevices, nil
} }
func parseSecurityOpt(container *container.Container, config *runconfig.HostConfig) error { func parseSecurityOpt(container *container.Container, config *runconfig.HostConfig) error {
@ -87,33 +87,33 @@ func parseSecurityOpt(container *container.Container, config *runconfig.HostConf
} }
func getBlkioReadBpsDevices(config *runconfig.HostConfig) ([]*blkiodev.ThrottleDevice, error) { func getBlkioReadBpsDevices(config *runconfig.HostConfig) ([]*blkiodev.ThrottleDevice, error) {
var BlkioReadBpsDevice []*blkiodev.ThrottleDevice var blkioReadBpsDevice []*blkiodev.ThrottleDevice
var stat syscall.Stat_t var stat syscall.Stat_t
for _, bpsDevice := range config.BlkioDeviceReadBps { for _, bpsDevice := range config.BlkioDeviceReadBps {
if err := syscall.Stat(bpsDevice.Path, &stat); err != nil { if err := syscall.Stat(bpsDevice.Path, &stat); err != nil {
return nil, err return nil, err
} }
ReadBpsDevice := blkiodev.NewThrottleDevice(int64(stat.Rdev/256), int64(stat.Rdev%256), bpsDevice.Rate) readBpsDevice := blkiodev.NewThrottleDevice(int64(stat.Rdev/256), int64(stat.Rdev%256), bpsDevice.Rate)
BlkioReadBpsDevice = append(BlkioReadBpsDevice, ReadBpsDevice) blkioReadBpsDevice = append(blkioReadBpsDevice, readBpsDevice)
} }
return BlkioReadBpsDevice, nil return blkioReadBpsDevice, nil
} }
func getBlkioWriteBpsDevices(config *runconfig.HostConfig) ([]*blkiodev.ThrottleDevice, error) { func getBlkioWriteBpsDevices(config *runconfig.HostConfig) ([]*blkiodev.ThrottleDevice, error) {
var BlkioWriteBpsDevice []*blkiodev.ThrottleDevice var blkioWriteBpsDevice []*blkiodev.ThrottleDevice
var stat syscall.Stat_t var stat syscall.Stat_t
for _, bpsDevice := range config.BlkioDeviceWriteBps { for _, bpsDevice := range config.BlkioDeviceWriteBps {
if err := syscall.Stat(bpsDevice.Path, &stat); err != nil { if err := syscall.Stat(bpsDevice.Path, &stat); err != nil {
return nil, err return nil, err
} }
WriteBpsDevice := blkiodev.NewThrottleDevice(int64(stat.Rdev/256), int64(stat.Rdev%256), bpsDevice.Rate) writeBpsDevice := blkiodev.NewThrottleDevice(int64(stat.Rdev/256), int64(stat.Rdev%256), bpsDevice.Rate)
BlkioWriteBpsDevice = append(BlkioWriteBpsDevice, WriteBpsDevice) blkioWriteBpsDevice = append(blkioWriteBpsDevice, writeBpsDevice)
} }
return BlkioWriteBpsDevice, nil return blkioWriteBpsDevice, nil
} }
func checkKernelVersion(k, major, minor int) bool { func checkKernelVersion(k, major, minor int) bool {