|
ProtoCore v1.0.16
Deterministic, zero-heap network stack for embedded targets
|
Bind the WAL store's ::WalDev block-device seam to a file on a mounted store (PROTOCORE_ENABLE_WAL). More...
#include "protocore_config.h"Go to the source code of this file.
Bind the WAL store's ::WalDev block-device seam to a file on a mounted store (PROTOCORE_ENABLE_WAL).
The store in wal_store.h does all I/O through three function pointers so its logic stays pure and host-testable; this header is the thin adapter that points those pointers at a preallocated file on any protocore_mnt_backend. Random access is the backend's seek, and the durability barrier is its sync.
Usage:
The backing file is preallocated to a fixed size so every store offset lands inside it and seek+write overwrites in place, rather than depending on past-EOF behavior that differs between FAT and littlefs. The ::protocore_wal_fs_ctx must outlive any ::WalDev bound to it.
A backend with no sync is refused at open. The WAL's checkpoint is an ordering guarantee built on that barrier, so a store that cannot promise it cannot carry a power-loss-safe log, and saying so at mount is the only honest answer: a barrier that returns true having done nothing makes an unsafe store look safe.
Definition in file wal_fs.h.