diskmm.bas

Support code for disk access management

Author

Marcel Sondaar

License

Public Domain

Summary
diskmm.basSupport code for disk access management
Todo’s
concatenate fail to end if necessary
Functions
DiskMM_FoldTranslateTranslates an extent for a given mapping to a list of extents in the physical domain.
Todo’s
Recurse
Functions
DiskMM_InsertInserts a translation extent into a map
DiskMM_InsertNodeExPrimeInsert an extent into a mappings extent tree.
Todo’s
Balance
Functions
DiskMM_InsertNodeExInsert an extent into a mappings extent tree.

Todo’s

concatenate fail to end if necessary

Functions

DiskMM_FoldTranslate

Function DiskMM_FoldTranslate(
   ByVal node As DISKMM_EXTENTTREE Ptr,
   ByVal Requester As Integer,
   ByVal Extent as DISKMM_EXTENT Ptr,
   ByVal Validated As Integer
) As DISKMM_TRANSLATION Ptr

Translates an extent for a given mapping to a list of extents in the physical domain.

in

nodepointer to the root node of an extent tree to translate
requesterthe source making the request, used in determining validation
extentpointer to the input extent
validatednonzero if ownership was already established

out

returna linked list of translated extents

Todo’s

Recurse

Functions

DiskMM_Insert

Function DiskMM_Insert(ByVal map As Integer,
ByRef extent as DISKMM_EXTENT) As Integer

Inserts a translation extent into a map

in

mapthe map index to update
extentthe extent to insert

out return - zero on success, nonzero on failure

failures include non-present maps, extents overlapping existing extents, and extents (partially) falling outside of the map’s range

DiskMM_InsertNodeExPrime

Function DiskMM_InsertNodeExPrime(
   ByVal root As DISKMM_EXTENTTREE Ptr,
   ByVal newnode As DISKMM_EXTENTTREE Ptr
) As Integer

Insert an extent into a mappings extent tree.  This function will not update anything if the inserted node overlaps existing nodes.

in

rootcurrent root of the tree, must be nonzero
newnodenew node to insert, must be nonzero

out

returnzero on success, nonzero if there was any overlap

Todo’s

Balance

Functions

DiskMM_InsertNodeEx

Function DiskMM_InsertNodeEx(ByVal map As DISKMM_MAPPING Ptr,
ByVal newnode As DISKMM_EXTENTTREE Ptr) As Integer

Insert an extent into a mappings extent tree.  This function will not update anything if the inserted node overlaps existing nodes.

in

mapmap to modify
newnodenew node to insert

out

returnzero on success, nonzero if there was any overlap, any null argument, or if the extent is out of bounds
Function DiskMM_FoldTranslate(
   ByVal node As DISKMM_EXTENTTREE Ptr,
   ByVal Requester As Integer,
   ByVal Extent as DISKMM_EXTENT Ptr,
   ByVal Validated As Integer
) As DISKMM_TRANSLATION Ptr
Translates an extent for a given mapping to a list of extents in the physical domain.
Function DiskMM_Insert(ByVal map As Integer,
ByRef extent as DISKMM_EXTENT) As Integer
Inserts a translation extent into a map
Function DiskMM_InsertNodeExPrime(
   ByVal root As DISKMM_EXTENTTREE Ptr,
   ByVal newnode As DISKMM_EXTENTTREE Ptr
) As Integer
Insert an extent into a mappings extent tree.
Function DiskMM_InsertNodeEx(ByVal map As DISKMM_MAPPING Ptr,
ByVal newnode As DISKMM_EXTENTTREE Ptr) As Integer
Insert an extent into a mappings extent tree.