MCPcopy Create free account
hub / github.com/prometheus/procfs / SysBlockDeviceUnderlyingDevices

Method SysBlockDeviceUnderlyingDevices

blockdevice/stats.go:472–483  ·  view source on GitHub ↗
(device string)

Source from the content-addressed store, hash-verified

470}
471
472func (fs FS) SysBlockDeviceUnderlyingDevices(device string) (UnderlyingDeviceInfo, error) {
473 underlyingDir, err := os.Open(fs.sys.Path(sysBlockPath, device, sysUnderlyingDev))
474 if err != nil {
475 return UnderlyingDeviceInfo{}, err
476 }
477 underlying, err := underlyingDir.Readdirnames(0)
478 if err != nil {
479 return UnderlyingDeviceInfo{}, err
480 }
481 return UnderlyingDeviceInfo{DeviceNames: underlying}, nil
482
483}
484
485// SysBlockDeviceSize returns the size of the block device from /sys/block/<device>/size
486// in bytes by multiplying the value by the Linux sector length of 512.

Callers 1

Calls 1

PathMethod · 0.45

Tested by 1