![]() |
|
| << Previous | Next >> | |
| | |
FSLXnum fs_setup( FSLXnum lxn, word ls_shift, int reserve_it, void * rfu, int partition_it, word part, word part_ls_shift, int part_reserve, void * part_rfu );
Description
- To modify or add to the default extents, this function must be called before calling
fs_init(). If called afterfs_init(), the filesystem will be corrupted.
fs_setup()runs in one of two basic modes, determined by thepartition_itparameter. Ifpartition_itis non-zero, then the specified extent (lxn, which must exist), is split into two extents according to the given proportions. Ifpartition_itis zero, then the specified extent must not exist; it is created. This use is beyond the scope of this note, since it involves filesystem internals. The paritioning usage is described here.
partition_itmay beFS_MODIFY_EXTENTin which case the base extent,lxn, is modified to use the specifiedls_shiftandreserve_itparameters (the other parameters are ignored).
partition_itmay be set toFS_PARTITION_FRACTION(other values reserved). This causes extent numberlxnto be split. The first half is still referred to as extentlxn, and the other half is assigned a new extent number, which is returned.
- The base extent number may itself have been previously partitioned, or it should be 1 for the 2nd flash device, or possibly 2 for the NVRAM device.
Parameters
- lxn
- Base extent number to partition or modify.
- ls_shift
- New logical sector size to assign to base partition, or zero to not alter it. This is expressed as the log base 2 of the desired size, and must be a number between 6 and 13 inclusive.
- reserve_it
TRUEif base partition is to be marked reserved.
- rfu
- A pointer reserved for future use. Pass as null.
- partition_it
- Must be set to
FS_PARTITION_FRACTIONorFS_MODIFY_EXTENT. The following parameters are ignored if this parameter is notFS_PARTITION_FRACTION.
- part
- The fraction of the existing base extent to assign to the new extent. This number is expressed as a fixed-point binary number with the binary point to the left of the MSB e.g. 0x3000 assigns 3/16 of the base extent to the new partition, updating the base extent to 13/16 of its original size. The nearest whole number of physical sectors is used for each extent.
- part_ls_shift
- Logical sector size to assign to the new extent, or zero to use the same LS size as the base extent. Expressed in same units as parameter 2.
- part_reserve
TRUEif the new extent is to be reserved.
- part_rfu
- A pointer reserved for future use. Pass as null.
Return value
0: Failure, extent could not be partitioned.
!0: Success, number of the new extent, or same aslxdfor existing extent modification.ERRNO values
ENOSPC- one or other half would contain an unusably small number of logical sectors, or the extent table is full. In the latter case,#define FS_MAX_LXto a larger value.
EINVAL-partition_itset to an invalid value, or other parameter invalid.
ENODEV- specified base extent number not defined.Library
- FS2.LIB
See also
- fs_init (FS2)
| Dynamic C Functions | << Previous | Next >> | rabbit.com |