allocmap

Name

allocmap -- Allocation Map operations

Synopsis



typedef     AllocMap_Block;
void        AMapReset                       (ALLOCMAP *a);
int         AMapRebuild                     (ALLOCMAP *a,
                                             AllocMap_Block blk,
                                             int n,
                                             AllocMap_Block prev);
void        AMapFinishRebuild               (ALLOCMAP *a);
int         AMapInput                       (ALLOCMAP *a,
                                             TOC_IOBuf *bf);
void        AMapOutput                      (ALLOCMAP *a,
                                             TOC_IOBuf *bf);
AllocMap_Block AMapAlloc                    (ALLOCMAP *a);
int         AMapFollowChain                 (ALLOCMAP *a,
                                             AllocMap_Block blk,
                                             AllocMap_Block *start,
                                             AllocMap_Block *nextSegTail);
int         AMapFreeChain                   (ALLOCMAP *a,
                                             AllocMap_Block end,
                                             AllocMap_Block start,
                                             int free_end,
                                             int free_start);
ALLOCMAP*   AMapCreate                      (long blks);
void        AMapDestroy                     (ALLOCMAP *a);
int         AMapFindBlockSize               (ALLOCMAP *a,
                                             AllocMap_Block start,
                                             AllocMap_Block end);
int         AMapOffsetToAddress             (ALLOCMAP *a,
                                             AllocMap_Block start,
                                             unsigned int offset,
                                             long *ret_block,
                                             int *ret_offset);

Description

This module contains code to calculate and manipulate the allocated space bitmap on the PJB's file system.

Details

AllocMap_Block

typedef long AllocMap_Block;


AMapReset ()

void        AMapReset                       (ALLOCMAP *a);

??

a : Allocation map to reset


AMapRebuild ()

int         AMapRebuild                     (ALLOCMAP *a,
                                             AllocMap_Block blk,
                                             int n,
                                             AllocMap_Block prev);

??

a : Allocation map to be rebuilt
blk : ???
n : ???
prev : ???
Returns : ??


AMapFinishRebuild ()

void        AMapFinishRebuild               (ALLOCMAP *a);

??

a : Allocation map


AMapInput ()

int         AMapInput                       (ALLOCMAP *a,
                                             TOC_IOBuf *bf);

??

a : Allocation map
bf : ???
Returns : ??


AMapOutput ()

void        AMapOutput                      (ALLOCMAP *a,
                                             TOC_IOBuf *bf);

??

a : Number of blocks to allocate
bf : Buffer


AMapAlloc ()

AllocMap_Block AMapAlloc                    (ALLOCMAP *a);

??

a : Allocation map
Returns : ??


AMapFollowChain ()

int         AMapFollowChain                 (ALLOCMAP *a,
                                             AllocMap_Block blk,
                                             AllocMap_Block *start,
                                             AllocMap_Block *nextSegTail);

??

a : Allocation map
blk : ??
start : ??
nextSegTail : ??
Returns : ??


AMapFreeChain ()

int         AMapFreeChain                   (ALLOCMAP *a,
                                             AllocMap_Block end,
                                             AllocMap_Block start,
                                             int free_end,
                                             int free_start);

??

a : Allocation map
end : ??
start : ??
free_end : ??
free_start : ??
Returns : ??


AMapCreate ()

ALLOCMAP*   AMapCreate                      (long blks);

Create the allocation map.

Param1 : 
Returns : ??


AMapDestroy ()

void        AMapDestroy                     (ALLOCMAP *a);

??

a : Allocation map to destroy


AMapFindBlockSize ()

int         AMapFindBlockSize               (ALLOCMAP *a,
                                             AllocMap_Block start,
                                             AllocMap_Block end);

Counts the number of blocks between start and end. This function traverses back link pointers in allocation chains and can be used to calculate number of blocks in track or rip unit

a : Allocation map
start : ??
end : ??
Returns :???


AMapOffsetToAddress ()

int         AMapOffsetToAddress             (ALLOCMAP *a,
                                             AllocMap_Block start,
                                             unsigned int offset,
                                             long *ret_block,
                                             int *ret_offset);

??

a : Allocation map
start : ??
offset : ??
ret_block : ??
ret_offset : ??
Returns : ??