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

Method GetFileioUdev

iscsi/get.go:135–153  ·  view source on GitHub ↗

GetFileioUdev is getting the actual info to build up the FILEIO data and match with the enable target.

(fileioNumber string, objectName string)

Source from the content-addressed store, hash-verified

133// GetFileioUdev is getting the actual info to build up
134// the FILEIO data and match with the enable target.
135func (fs FS) GetFileioUdev(fileioNumber string, objectName string) (*FILEIO, error) {
136 fileio := FILEIO{
137 Name: "fileio_" + fileioNumber,
138 Fnumber: fileioNumber,
139 ObjectName: objectName,
140 }
141 udevPath := fs.configfs.Path(targetCore, fileio.Name, fileio.ObjectName, "udev_path")
142
143 if _, err := os.Stat(udevPath); os.IsNotExist(err) {
144 return nil, fmt.Errorf("iscsi: GetFileioUdev: fileio_%s is missing file name", fileio.Fnumber)
145 }
146 filename, err := os.ReadFile(udevPath)
147 if err != nil {
148 return nil, fmt.Errorf("iscsi: GetFileioUdev: Cannot read filename from udev link %q", udevPath)
149 }
150 fileio.Filename = strings.TrimSpace(string(filename))
151
152 return &fileio, nil
153}
154
155// GetIblockUdev is getting the actual info to build up
156// the IBLOCK data and match with the enable target.

Callers 1

TestGetStatsFunction · 0.95

Calls 2

PathMethod · 0.45
StatMethod · 0.45

Tested by 1

TestGetStatsFunction · 0.76