dfs_getvolblockinfo

Returns the volume block usage bitmap for the requested volume.

Library:LibC
Classification:Novell
Service:Direct File System

Syntax

  #include <dfs.h>  
   
  int dfs_getvolblockinfo (
     int        volNum,
     uint32_t   startingBlockNum,
     int        blockCount,
     void      *buffer );
  

Parameters

volNum

(IN) Specifies the volume number for which the volume block information is desired.

startingBlockNum

(IN) Specifies volume logical block zero, or an even multiple of 8, up to the last block of the volume.

blockCount

(IN/OUT) Specifies the number of blocks for which allocation bit flags are to be transferred into the buffer. If startingBlockNum plus blockCount is greater than the total number of volume blocks, the number of volume blocks remaining starting from startingBlockNum is substituted here.

buffer

(OUT) Points to a pointer to a buffer area where the information is returned. The area required for the buffer is the number of blocks rounded up modulus 8. The format of the data in the buffer is bit array, with 1 bits indicating available blocks. The relative bit address of each bit is the block address relative to the beginning of the specified starting file block number.

Return Values

If successful, returns 0. Otherwise, returns a nonzero error code:

Decimal

Constant

Description

79

ENOTSUP

The NLM is loaded in protected address space. This operation is supported only in kernel address space.

For possible DFS errors, see Section 13.4.5, DFS Return Values.

Remarks

This function is used to determine which blocks on a volume are in use and that are available for allocation. This function returns a bitmap which has a bit for each block in the range specified in the calling parameters, beginning with the logical (zero-based) volume block indicated by startingBlockNum. This information is required if an application is attempting to do specific allocation for a file, in order to pick block ranges of contiguous free blocks to expand a file.

The data returned by this function is only valid until it is changed by some request, and the data can change dynamically before an application can successfully request allocation of the blocks selected. The application process must be designed to handle this exception, as well as the case where there is not a single contiguous free block area large enough to satisfy the file expansion request.

See Also