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 | BattFs |
| | Describe a BattFs file usign a KFile. More...
|
Defines |
| #define | BATTFS_HEADER_LEN 12 |
| | Size of the header once saved on disk.
|
|
#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 ((pgcnt_t)((1L << (CPU_BITS_PER_CHAR * sizeof(pgcnt_t))) - 1)) |
| | Sentinel used to keep trace of unset pages in disk->page_array.
|
|
#define | SPACE_OVER(disk) ((disk)->free_page_start >= (disk)->page_count) |
| | True if space on disk is over.
|
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 uint8_t | inode_t |
| | Type for file inodes.
|
|
typedef uint64_t | seq_t |
| | Type for page seq number, at least 40bits wide.
|
|
typedef rotating_t | fcs_t |
| | Type for header FCS.
|
| 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 bool(* | disk_page_load_t )(struct BattFsSuper *d, pgcnt_t page) |
| | Type interface for disk page load function.
|
| typedef size_t(* | disk_buffer_write_t )(struct BattFsSuper *d, pgaddr_t addr, const void *buf, size_t) |
| | Type interface for disk pagebuffer write function.
|
| typedef size_t(* | disk_buffer_read_t )(struct BattFsSuper *d, pgaddr_t addr, void *buf, size_t) |
| | Type interface for disk pagebuffer read function.
|
| typedef bool(* | disk_page_save_t )(struct BattFsSuper *d, pgcnt_t page) |
| | Type interface for disk page save 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 int32_t | file_size_t |
| | Type for file sizes.
|
| #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 | BATTFS_NEGATIVE_SEEK_ERR BV(0) |
| | File errors.
|
|
#define | BATTFS_DISK_READ_ERR BV(1) |
| | Error reading from disk driver.
|
|
#define | BATTFS_DISK_LOADPAGE_ERR BV(2) |
| | Error loading a disk page in the buffer.
|
|
#define | BATTFS_DISK_BUFFERWR_ERR BV(3) |
| | Error writing in the disk page buffer.
|
|
#define | BATTFS_DISK_GETNEWPAGE_ERR BV(4) |
| | Error getting a free page.
|
|
#define | BATTFS_DISK_BUFFERRD_ERR BV(6) |
| | Error reading from the disk page buffer.
|
|
#define | BATTFS_DISK_SPACEOVER_ERR BV(7) |
| | No more disk space available.
|
|
#define | BATTFS_DISK_FLUSHBUF_ERR BV(8) |
| | Error flushing (writing) the current page to disk.
|
|
#define | BATTFS_FILE_NOT_FOUND_ERR BV(9) |
| | File not found on disk.
|
|
#define | KFT_BATTFS MAKE_ID('B', 'T', 'F', 'S') |
| | Id for battfs file descriptors.
|
| BattFs * | BATTFS_CAST (KFile *fd) |
| | Macro used to cast a KFile to a BattFS.
|
| bool | battfs_mount (struct BattFsSuper *d) |
| | Initialize and mount disk described by disk.
|
| bool | battfs_fsck (struct BattFsSuper *disk) |
| | Check the filesystem.
|
|
bool | battfs_umount (struct BattFsSuper *disk) |
| | Umount disk.
|
| bool | battfs_fileExists (BattFsSuper *disk, inode_t inode) |
| bool | battfs_fileopen (BattFsSuper *disk, BattFs *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.