PebbleOS v4.44.0-105-g1dd754433
Loading...
Searching...
No Matches
Pebble File System

PFS, the wear-leveled file system on the external NOR flash. More...

Macros

#define PBL_FS_O_PFS_SKIP_HDR_CRC_CHECK   PBL_FS_O_FORMAT(0)
 Skip checking the on-flash header CRCs, for files opened thousands of times.
 
#define PBL_FS_O_PFS_USE_PAGE_CACHE   PBL_FS_O_FORMAT(1)
 Cache the translation from file pages to flash pages.
 

Functions

int pbl_fs_pfs_optimal_size (const char *path, size_t min_size)
 Get the optimal size of a file that can use space beyond a minimum.
 

Variables

const struct pbl_fs_ops pbl_fs_pfs_ops
 PFS format, for struct pbl_fs_mount::ops.
 

Detailed Description

PFS, the wear-leveled file system on the external NOR flash.

Macro Definition Documentation

◆ PBL_FS_O_PFS_SKIP_HDR_CRC_CHECK

#define PBL_FS_O_PFS_SKIP_HDR_CRC_CHECK   PBL_FS_O_FORMAT(0)

Skip checking the on-flash header CRCs, for files opened thousands of times.

◆ PBL_FS_O_PFS_USE_PAGE_CACHE

#define PBL_FS_O_PFS_USE_PAGE_CACHE   PBL_FS_O_FORMAT(1)

Cache the translation from file pages to flash pages.

Speeds up random access to large files. Best limited to reads, so that heap corruption cannot corrupt the file.

Function Documentation

◆ pbl_fs_pfs_optimal_size()

int pbl_fs_pfs_optimal_size ( const char *  path,
size_t  min_size 
)

Get the optimal size of a file that can use space beyond a minimum.

Rounds min_size up to use all the space of the flash pages the file takes anyway.

Parameters
pathAbsolute path of the file.
min_sizeMinimum size in bytes.
Returns
Optimal size in bytes, or negative errno if path is not on a PFS mount.

Variable Documentation

◆ pbl_fs_pfs_ops

const struct pbl_fs_ops pbl_fs_pfs_ops
extern

PFS format, for struct pbl_fs_mount::ops.