BattFS: a filesystem for embedded platforms (interface). TODO: Add detailed filesystem description.
|
Data Structures |
| struct | BattFsPageHeader |
| | BattFS page header, used to represent a page header in memory. More...
|
| struct | BattFsSuper |
| | Context used to describe a disk. More...
|
| struct | KFileBattFs |
| | Describe a BattFs file usign a KFile. More...
|
Defines |
| #define | BATTFS_HEADER_LEN 12 |
| | Size of the header once saved on disk.
|
| #define | MARK_HALF_SIZE (1 << (CPU_BITS_PER_CHAR * sizeof(pgcnt_t) + 1)) |
| | Half-size of free page marker.
|
|
#define | MAX_PAGE_ADDR ((1 << (CPU_BITS_PER_CHAR * sizeof(pgcnt_t))) - 1) |
| | Maximum page address.
|
|
#define | BATTFS_MAX_FILES (1 << (CPU_BITS_PER_CHAR * sizeof(inode_t))) |
| | Max number of files.
|
|
#define | PAGE_UNSET_SENTINEL ((1 << (CPU_BITS_PER_CHAR * sizeof(pgcnt_t))) - 1) |
| | Sentinel used to keep trace of unset pages in disk->page_array.
|
|
| #define | MARK_PAGE_VALID ((1 << (CPU_BITS_PER_CHAR * sizeof(pgcnt_t) + 1)) - 1) |
| | Marks for valid pages.
|
Typedefs |
|
typedef uint16_t | fill_t |
| | Type for keeping trace of space filled inside a page.
|
|
typedef fill_t | pgaddr_t |
| | Type for addressing space inside a page.
|
|
typedef uint16_t | pgcnt_t |
| | Type for counting pages on disk.
|
|
typedef pgcnt_t | pgoff_t |
| | Type for counting pages inside a file.
|
|
typedef uint32_t | mark_t |
| | Type for marking pages as free.
|
|
typedef uint8_t | inode_t |
| | Type for file inodes.
|
|
typedef uint8_t | seq_t |
| | Type for page seq number.
|
|
typedef rotating_t | fcs_t |
| | Type for header FCS.
|
| typedef bool(* | disk_open_t )(struct BattFsSuper *d) |
| | Type interface for disk init function.
|
| typedef size_t(* | disk_page_read_t )(struct BattFsSuper *d, pgcnt_t page, pgaddr_t addr, void *buf, size_t) |
| | Type interface for disk page read function.
|
| typedef size_t(* | disk_page_write_t )(struct BattFsSuper *d, pgcnt_t page, pgaddr_t addr, const void *buf, size_t) |
| | Type interface for disk page write function.
|
| typedef bool(* | disk_page_erase_t )(struct BattFsSuper *d, pgcnt_t page) |
| | Type interface for disk page erase function.
|
| typedef bool(* | disk_close_t )(struct BattFsSuper *d) |
| | Type interface for disk deinit function.
|
|
typedef uint32_t | disk_size_t |
| | Type for disk sizes.
|
|
typedef uint8_t | filemode_t |
| | Type for file open modes.
|
|
typedef uint32_t | file_size_t |
| | Type for file sizes.
|
Functions |
|
| STATIC_ASSERT (sizeof(mark_t) > sizeof(pgcnt_t)) |
| | Size required for free block allocation is at least 1 bit more than page addressing.
|
| #define | BATTFS_CREATE BV(0) |
| | Modes for battfs_fileopen.
|
|
#define | BATTFS_RD BV(1) |
| | Open file for reading.
|
|
#define | BATTFS_WR BV(2) |
| | Open file fir writing.
|
|
#define | KFT_BATTFS MAKE_ID('B', 'T', 'F', 'S') |
| | Id for battfs file descriptors.
|
| KFileBattFs * | KFILEBATTFS (KFile *fd) |
| | Macro used to cast a KFile to a KFileBattFs.
|
| bool | battfs_init (struct BattFsSuper *d) |
| | Initialize and mount disk described by disk.
|
|
bool | battfs_close (struct BattFsSuper *disk) |
| | Close disk.
|
| bool | battfs_fileExists (BattFsSuper *disk, inode_t inode) |
| bool | battfs_fileopen (BattFsSuper *disk, KFileBattFs *fd, inode_t inode, filemode_t mode) |
| | Open file inode from disk in mode.
|
BattFS: a filesystem for embedded platforms (interface). TODO: Add detailed filesystem description.