GetFileioUdev is getting the actual info to build up the FILEIO data and match with the enable target.
(fileioNumber string, objectName string)
| 133 | // GetFileioUdev is getting the actual info to build up |
| 134 | // the FILEIO data and match with the enable target. |
| 135 | func (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. |