<< Previous | Next >>

fs_get_lx_size (FS2)

long fs_get_lx_size( FSLXnum lxn, int all, word ls_shift );

Description

Returns the size of the specified logical extent, in bytes. This information is useful when initially partitioning an LX, or when estimating the capacity of an LX for user data. all is a flag which indicates whether to return the total data capacity (as if all current files were deleted) or whether to return just the available data capacity. The return value accounts for the packing efficiency which will be less than 100% because of the bookkeeping overhead. It does not account for the free space required when any updates are performed; however this free space may be shared by all files on the LX. It also does not account for the space required for file metadata. You can account for this by adding one logical sector for each file to be created on this LX. You can also specify that the metadata be stored on a different LX by use of fs_set_lx().

This function may be called either before or after fs_init(). If called before, then the ls_shift parameter must be set to the value to be used in fs_setup(), since the LS size is not known at this point. ls_shift can also be passed as zero, in which case the default size will be assumed. all must be non-zero if called before fs_init(), since the number of files in use is not yet known.

Parameters

lxn
Logical extent number to query.

all
Boolean: 0 for current free capacity only, 1 for total.
Must use 1 if calling before fs_init().


ls_shift
Logical sector shift i.e. log base 2 of LS size (6 to 13); may be zero to use default.

Return value

 0: The specified LX does not exist.
!0: Capacity of the LX in bytes.

Library

FS2.lib


Dynamic C Functions << Previous | Next >> rabbit.com