From ac393dcfbadf1aa3ec920481731a46f37527dd3b Mon Sep 17 00:00:00 2001 From: "W. Andrew Denton" Date: Fri, 19 Nov 2021 11:07:08 -0800 Subject: [PATCH] blockdevice/stats: uppercase initialisms. Signed-off-by: W. Andrew Denton --- blockdevice/stats.go | 18 +++++++++--------- blockdevice/stats_test.go | 4 ++-- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/blockdevice/stats.go b/blockdevice/stats.go index 7e22a52f8..26b6f57cb 100644 --- a/blockdevice/stats.go +++ b/blockdevice/stats.go @@ -189,10 +189,10 @@ type DeviceMapperInfo struct { RqBasedSeqIOMergeDeadline uint64 // Suspended indicates if the device is suspended (1 is on, 0 is off). Suspended uint64 - // UseBlkMq indicates if the device is using the request-based blk-mq I/O path mode (1 is on, 0 is off). - UseBlkMq uint64 - // Uuid is the DM-UUID string or empty string if DM-UUID is not set. - Uuid string + // UseBlkMQ indicates if the device is using the request-based blk-mq I/O path mode (1 is on, 0 is off). + UseBlkMQ uint64 + // UUID is the DM-UUID string or empty string if DM-UUID is not set. + UUID string } // UnderlyingDevices models the list of devices that this device is built from. @@ -207,7 +207,7 @@ const ( sysBlockPath = "block" sysBlockStatFormat = "%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d" sysBlockQueue = "queue" - sysBlockDm = "dm" + sysBlockDM = "dm" sysUnderlyingDev = "slaves" ) @@ -430,9 +430,9 @@ func (fs FS) SysBlockDeviceMapperInfo(device string) (DeviceMapperInfo, error) { for file, p := range map[string]*uint64{ "rq_based_seq_io_merge_deadline": &info.RqBasedSeqIOMergeDeadline, "suspended": &info.Suspended, - "use_blk_mq": &info.UseBlkMq, + "use_blk_mq": &info.UseBlkMQ, } { - val, err := util.ReadUintFromFile(fs.sys.Path(sysBlockPath, device, sysBlockDm, file)) + val, err := util.ReadUintFromFile(fs.sys.Path(sysBlockPath, device, sysBlockDM, file)) if err != nil { return DeviceMapperInfo{}, err } @@ -441,9 +441,9 @@ func (fs FS) SysBlockDeviceMapperInfo(device string) (DeviceMapperInfo, error) { // files with string fields for file, p := range map[string]*string{ "name": &info.Name, - "uuid": &info.Uuid, + "uuid": &info.UUID, } { - val, err := util.SysReadFile(fs.sys.Path(sysBlockPath, device, sysBlockDm, file)) + val, err := util.SysReadFile(fs.sys.Path(sysBlockPath, device, sysBlockDM, file)) if err != nil { return DeviceMapperInfo{}, err } diff --git a/blockdevice/stats_test.go b/blockdevice/stats_test.go index c37011aaf..a701bcd2a 100644 --- a/blockdevice/stats_test.go +++ b/blockdevice/stats_test.go @@ -172,8 +172,8 @@ func TestBlockDmInfo(t *testing.T) { Name: "vg0--lv_root", RqBasedSeqIOMergeDeadline: 0, Suspended: 0, - UseBlkMq: 0, - Uuid: "LVM-3zSHSR5Nbf4j7g6auAAefWY2CMaX01theZYEvQyecVsm2WtX3iY5q51qq5dWWOq7", + UseBlkMQ: 0, + UUID: "LVM-3zSHSR5Nbf4j7g6auAAefWY2CMaX01theZYEvQyecVsm2WtX3iY5q51qq5dWWOq7", } if !reflect.DeepEqual(dm0Info, dm0InfoExpected) { t.Errorf("Incorrect BlockQueueStat, expected: \n%+v, got: \n%+v", dm0InfoExpected, dm0Info)