<< Previous | Next >> | |
|
int fs_init( long reserveblocks, int num_blocks );
Description
- Initialize the filesystem. The static structure
_fs
contains information that defines the number and parameters associated with each extent or "partition." This function must be called before any of the other functions in this library, except forfs_setup()
,fs_get_*_lx()
andfs_get_lx_size()
.
- Pre-main initialization will create up to 3 devices:
- The LX numbers of the default devices can be obtained using the
fs_get_flash_lx()
,fs_get_ram_lx()
andfs_get_other_lx()
calls. If none of these devices can be set up successfully,fs_init()
will returnENOSPC
when called.
- This function performs complete consistency checks and, if necessary, fixups for each LX. It may take up to several seconds to run. It should only be called once at application initialization time.
NOTE When using µC/OS-II, fs_init()
must be called beforeOSInit()
.Parameters
- reserveblocks
- Must be zero. Retained for backward compatibility.
- num_blocks
- Ignored (backward compatibility).
Return value
0
: Success.
!0
: Failure.ERRNO values
EINVAL
- the reserveblocks parameter was non-zero.
EIO
- I/O error. This indicates a hardware problem.
ENOMEM
- Insufficient memory for required buffers.
ENOSPC
- No valid extents obtained e.g. there is no recognized flash or RAM memory device available.Library
- fs2.lib
See also
- fs_setup (FS2), fs_get_flash_lx (FS2)
Dynamic C Functions | << Previous | Next >> | rabbit.com |