|
ProtoCore v1.0.16
Deterministic, zero-heap network stack for embedded targets
|
The built-in RAM filesystem backend (PROTOCORE_ENABLE_MNT). More...
Go to the source code of this file.
Classes | |
| struct | MntRamNs |
| Dispatch table. Addressed by offset, so the layout is asserted below. More... | |
Functions | |
| PROTOCORE_NS_LAYOUT (MntRamNs, backend, format) | |
| const protocore_mnt_backend * | protocore_mnt_ram_backend (uint8_t *work) |
| Publish the vtable, for the caller to mount. | |
| void | protocore_mnt_ram_format (uint8_t *work) |
| Empty the pool and close every handle. | |
Variables | |
| PROTOCORE_NS MntRamNs MntRam | PROTOCORE_UNUSED |
| Module namespace. | |
The built-in RAM filesystem backend (PROTOCORE_ENABLE_MNT).
A fixed pool of named in-BSS files and a fixed handle table: bounded, zero-heap, and host-identical, which is what lets the file-transfer servers run under a native test. It implements the protocore_mnt_backend contract that server/storage/mnt registers, and it is one of several things that can - a board layer wraps a real fs::FS the same way.
Directories are a flag on a name-table entry rather than a tree: the table already holds whole paths, so "what is in this directory" is a prefix scan of names that are already there. A tree would add nodes, links, and a second lifetime to maintain in order to answer a question the flat table already answers.
The module publishes its vtable rather than mounting itself, so the mount stays one decision in one place:
MntRam.backend(work); MntV.args.backend = MntRamV.backend; Mnt.mount(work);
Pool dimensions are PROTOCORE_MNT_RAM_FILES, PROTOCORE_MNT_RAM_FILE_SIZE, PROTOCORE_MNT_MAX_OPEN and PROTOCORE_MNT_NAME_MAX in protocore_config.h.
Definition in file mnt_ram.h.
| PROTOCORE_NS_LAYOUT | ( | MntRamNs | , |
| backend | , | ||
| format | |||
| ) |
| const protocore_mnt_backend * protocore_mnt_ram_backend | ( | uint8_t * | work | ) |
Publish the vtable, for the caller to mount.
| work | PROTOCORE_MNT_RAM_BORROW bytes the caller took. Not held past the call. |
| void protocore_mnt_ram_format | ( | uint8_t * | work | ) |
Empty the pool and close every handle.
| work | PROTOCORE_MNT_RAM_BORROW bytes the caller took. Not held past the call. |
| PROTOCORE_NS MntRamNs MntRam PROTOCORE_UNUSED |
Module namespace.