supraffi

package
v1.24.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 24, 2025 License: Apache-2.0, MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	WarningSpareSpace       = 1 << 0
	WarningTemperature      = 1 << 1
	WarningReliability      = 1 << 2
	WarningReadOnly         = 1 << 3
	WarningVolatileMemory   = 1 << 4
	WarningPersistentMemory = 1 << 5
)

Helper methods for interpreting critical warning flags

Variables

This section is empty.

Functions

func C1

func C1(blockOffset uint64, numSectors, sectorSlot int, replicaID, seed, ticket []byte, cachePath, parentsFilename, replicaPath string, sectorSize uint64) int

C1 performs the c1 operation.

func GenerateMultiString

func GenerateMultiString(paths []Path) (string, error)

GenerateMultiString generates a //multi// string from an array of Path structs

func GetCCCommD

func GetCCCommD(commD []byte, sectorSize int) bool

GetCCCommD returns comm_d for a cc sector.

func GetCommC

func GetCommC(commC []byte, cachePath string) bool

GetCommC returns comm_c from p_aux file.

func GetCommCFromTree

func GetCommCFromTree(commC []byte, cachePath string, sectorSize uint64) bool

GetCommCFromTree returns comm_c after calculating from tree file(s).

func GetCommD

func GetCommD(commD []byte, cachePath string) bool

GetCommD returns comm_d from tree_d file.

func GetCommR

func GetCommR(commR []byte, cachePath string) bool

GetCommR returns comm_r after calculating from p_aux file.

func GetCommRLast

func GetCommRLast(commRLast []byte, cachePath string) bool

GetCommRLast returns comm_r_last from p_aux file.

func GetCommRLastFromTree

func GetCommRLastFromTree(commRLast []byte, cachePath string, sectorSize uint64) bool

GetCommRLastFromTree returns comm_r_last after calculating from tree file(s).

func GetMaxBlockOffset

func GetMaxBlockOffset(sectorSize uint64) uint64

GetMaxBlockOffset returns the highest available block offset.

func GetSlotSize

func GetSlotSize(numSectors int, sectorSize uint64) uint64

GetSlotSize returns the size in blocks required for the given number of sectors.

func Pc1

func Pc1(blockOffset uint64, replicaIDs [][32]byte, parentsFilename string, sectorSize uint64) int

Pc1 performs the pc1 operation.

func Pc2

func Pc2(blockOffset uint64, numSectors int, outputDir string, sectorSize uint64) int

Pc2 performs the pc2 operation.

func Pc2Cleanup

func Pc2Cleanup(numSectors int, outputDir string, sectorSize uint64) int

Pc2Cleanup deletes files associated with pc2.

func SetCommC

func SetCommC(commC []byte, cachePath string) bool

SetCommC sets comm_c in the p_aux file.

func SetCommRLast

func SetCommRLast(commRLast []byte, cachePath string) bool

SetCommRLast sets comm_r_last in the p_aux file.

func SupraSealInit

func SupraSealInit(sectorSize uint64, configFile string)

SupraSealInit initializes the supra seal with a sector size and optional config file.

Types

type HealthInfo added in v1.24.3

type HealthInfo struct {
	// Critical warning flags
	CriticalWarning byte

	// Temperature information in Celsius
	Temperature        float64
	TemperatureSensors []float64
	WarningTempTime    time.Duration
	CriticalTempTime   time.Duration

	// Reliability metrics
	AvailableSpare          uint8
	AvailableSpareThreshold uint8
	PercentageUsed          uint8

	// Usage statistics
	DataUnitsRead      uint64 // in 512-byte units
	DataUnitsWritten   uint64 // in 512-byte units
	HostReadCommands   uint64
	HostWriteCommands  uint64
	ControllerBusyTime time.Duration

	// Power and error statistics
	PowerCycles     uint64
	PowerOnHours    time.Duration
	UnsafeShutdowns uint64
	MediaErrors     uint64
	ErrorLogEntries uint64
}

HealthInfo represents NVMe device health information in a more Go-friendly format

func GetHealthInfo added in v1.24.3

func GetHealthInfo() ([]HealthInfo, error)

func (*HealthInfo) GetWarnings added in v1.24.3

func (h *HealthInfo) GetWarnings() []string

GetWarnings returns a slice of active warning descriptions

func (*HealthInfo) HasWarning added in v1.24.3

func (h *HealthInfo) HasWarning(flag byte) bool

HasWarning checks if a specific warning flag is set

type Path

type Path struct {
	Replica string
	Cache   string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL