<< Previous | Next >> | |
|
int lx_format( FSLXnum lxn, long wearlevel );
Description
- Format a specified file system extent. This must not be called before calling
fs_init()
. All files which have either or both metadata and data on this extent are deleted. Formatting can be quite slow (depending on hardware) so it is best performed after power-up, if at all.Parameters
- lxn
- Logical extent number (1..
_fs.num_lx
inclusive).
- wearlevel
- Initial wearlevel value. This should be 1 if you have a new flash, and some larger number if the flash is used. If you are reformatting a flash, you can use 0 to use the old flash wear levels.
Return value
0
: Success.
!0
: Failure.ERRNO values
ENODEV
- no such extent number, or extent is reserved.
EBUSY
- one or more files were open on this extent.
EIO
- I/O error during format. If this occurs, retry the format operation. If it fails again, there is probably a hardware error.Library
- FS2.LIB
See also
- fs_init, fs_format
Dynamic C Functions | << Previous | Next >> | rabbit.com |