Use unix.Major/unix.Minor instead of custom implementation
This commit is contained in:
parent
92b01ab4f9
commit
2118fbe78a
|
@ -35,8 +35,8 @@ func (s *DiskIO) diskInfo(devName string) (map[string]string, error) {
|
||||||
return ic.values, nil
|
return ic.values, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
major := stat.Rdev >> 8 & 0xff
|
major := unix.Major(stat.Rdev)
|
||||||
minor := (stat.Rdev & 0xff) | (stat.Rdev>>12)&^0xff
|
minor := unix.Minor(stat.Rdev)
|
||||||
udevDataPath := fmt.Sprintf("%s/b%d:%d", udevPath, major, minor)
|
udevDataPath := fmt.Sprintf("%s/b%d:%d", udevPath, major, minor)
|
||||||
|
|
||||||
di := map[string]string{}
|
di := map[string]string{}
|
||||||
|
|
Loading…
Reference in New Issue