|
2 | 2 |
|
3 | 3 | package supraffi |
4 | 4 |
|
| 5 | +import "fmt" |
| 6 | + |
5 | 7 | // TreeRFile builds tree-r from a last-layer file (optionally with a staged data file). |
6 | 8 | // Used for snap updates, does not require NVMe devices. |
7 | 9 | // This is a stub implementation for non-Linux platforms. |
8 | 10 | func TreeRFile(lastLayerFilename, dataFilename, outputDir string, sectorSize uint64) int { |
9 | 11 | panic("TreeRFile: supraseal is only available on Linux") |
10 | 12 | } |
| 13 | + |
| 14 | +// GetHealthInfo retrieves health information for all NVMe devices. |
| 15 | +// This is a stub implementation for non-Linux platforms. |
| 16 | +func GetHealthInfo() ([]HealthInfo, error) { |
| 17 | + return nil, fmt.Errorf("GetHealthInfo: supraseal is only available on Linux") |
| 18 | +} |
| 19 | + |
| 20 | +// SupraSealInit initializes the supra seal with a sector size and optional config file. |
| 21 | +// This is a stub implementation for non-Linux platforms. |
| 22 | +func SupraSealInit(sectorSize uint64, configFile string) { |
| 23 | + panic("SupraSealInit: supraseal is only available on Linux") |
| 24 | +} |
| 25 | + |
| 26 | +// Pc1 performs the pc1 operation for batch sealing. |
| 27 | +// This is a stub implementation for non-Linux platforms. |
| 28 | +func Pc1(blockOffset uint64, replicaIDs [][32]byte, parentsFilename string, sectorSize uint64) int { |
| 29 | + panic("Pc1: supraseal is only available on Linux") |
| 30 | +} |
| 31 | + |
| 32 | +type Path struct { |
| 33 | + Replica string |
| 34 | + Cache string |
| 35 | +} |
| 36 | + |
| 37 | +// GenerateMultiString generates a //multi// string from an array of Path structs. |
| 38 | +// This is a stub implementation for non-Linux platforms. |
| 39 | +func GenerateMultiString(paths []Path) (string, error) { |
| 40 | + return "", fmt.Errorf("GenerateMultiString: supraseal is only available on Linux") |
| 41 | +} |
| 42 | + |
| 43 | +// Pc2 performs the pc2 operation for batch sealing. |
| 44 | +// This is a stub implementation for non-Linux platforms. |
| 45 | +func Pc2(blockOffset uint64, numSectors int, outputDir string, sectorSize uint64) int { |
| 46 | + panic("Pc2: supraseal is only available on Linux") |
| 47 | +} |
| 48 | + |
| 49 | +// C1 performs the c1 operation for batch sealing. |
| 50 | +// This is a stub implementation for non-Linux platforms. |
| 51 | +func C1(blockOffset uint64, numSectors, sectorSlot int, replicaID, seed, ticket []byte, cachePath, parentsFilename, replicaPath string, sectorSize uint64) int { |
| 52 | + panic("C1: supraseal is only available on Linux") |
| 53 | +} |
| 54 | + |
| 55 | +// GetMaxBlockOffset returns the highest available block offset from NVMe devices. |
| 56 | +// This is a stub implementation for non-Linux platforms. |
| 57 | +func GetMaxBlockOffset(sectorSize uint64) uint64 { |
| 58 | + panic("GetMaxBlockOffset: supraseal is only available on Linux") |
| 59 | +} |
| 60 | + |
| 61 | +// GetSlotSize returns the size in blocks required for the given number of sectors. |
| 62 | +// This is a stub implementation for non-Linux platforms. |
| 63 | +func GetSlotSize(numSectors int, sectorSize uint64) uint64 { |
| 64 | + panic("GetSlotSize: supraseal is only available on Linux") |
| 65 | +} |
| 66 | + |
| 67 | +// GetCommR returns comm_r after calculating from p_aux file. Returns true on success. |
| 68 | +// This is a stub implementation for non-Linux platforms. |
| 69 | +func GetCommR(commR []byte, cachePath string) bool { |
| 70 | + panic("GetCommR: supraseal is only available on Linux") |
| 71 | +} |
| 72 | + |
| 73 | +// CheckAndSetupSPDK prepares SPDK hugepages and environment. |
| 74 | +// This is a stub implementation for non-Linux platforms. |
| 75 | +func CheckAndSetupSPDK(nrHuge int, minPages int) error { |
| 76 | + return fmt.Errorf("CheckAndSetupSPDK: supraseal/SPDK is only available on Linux") |
| 77 | +} |
0 commit comments