Skip to content

Commit

Permalink
blockdevice/stats: uppercase initialisms.
Browse files Browse the repository at this point in the history
Signed-off-by: W. Andrew Denton <git@flying-snail.net>
  • Loading branch information
W. Andrew Denton committed Nov 19, 2021
1 parent 6d2fa38 commit ac393dc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
18 changes: 9 additions & 9 deletions blockdevice/stats.go
Expand Up @@ -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.
Expand All @@ -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"
)

Expand Down Expand Up @@ -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
}
Expand All @@ -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
}
Expand Down
4 changes: 2 additions & 2 deletions blockdevice/stats_test.go
Expand Up @@ -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)
Expand Down

0 comments on commit ac393dc

Please sign in to comment.