|
TARFS 0.1.5
Read-only TAR filesystem for ESP32
|
#include <stdint.h>#include <stddef.h>#include <stdbool.h>#include <string.h>#include "config.h"Go to the source code of this file.
Functions | |
| void | tarfs_os_init () |
| Create a recursive sync object. | |
| void | tarfs_os_acquire_mutex () |
| Lock access to s_tarfs[] table and to the s_numfs counter only. | |
| void | tarfs_os_release_mutex () |
| Unlock access to s_tarfs[] table and to the s_numfs counter only. | |
| void const * | tarfs_os_map_tarfile (const char *name, void **os_handle_out, size_t *size_out) |
| Map a ESP32 flash partition to a virtual address space. | |
| void | tarfs_os_unmap_tarfile (void *os_handle, const void *ptr, size_t size) |
| Opposite of tarfs_os_map_tarfile(). | |
| bool | tarfs_os_register_fs (const char *prefix, void *context) |
| Tell the VFS that TARFS is now handle all the paths starting from 'prefix'. | |
| bool | tarfs_os_unregister_fs (const char *prefix) |
| Tell the VFS that path 'prefix' is not handled by tarfs anymore. | |
| size_t | tarfs_os_mp_maxlen () |
| Return the maximum mount point name length supported by the platform. | |
| void * | tarfs_os_malloc (size_t size) |
| Memory allocation backend. | |
| void | tarfs_os_free (void *buffer) |
| void tarfs_os_acquire_mutex | ( | ) |
Lock access to s_tarfs[] table and to the s_numfs counter only.
Definition at line 156 of file os_esp32.c.
| void tarfs_os_free | ( | void * | buffer | ) |
Definition at line 207 of file os_esp32.c.
Referenced by inode_free(), inode_resolve(), tard_closedir(), tard_fdopendir(), tarf_open(), and tarfs_mount_memory().
| void tarfs_os_init | ( | ) |
Create a recursive sync object.
Definition at line 147 of file os_esp32.c.
| void * tarfs_os_malloc | ( | size_t | size | ) |
Memory allocation backend.
By default, these functions map directly to malloc() and free(). Platform-specific implementations may override them to use a custom allocator.
Note that default implementation sets errno to ENOMEM if allocation fails The same behavior is expected for a custom allocator
Definition at line 187 of file os_esp32.c.
References size.
Referenced by tar_strdup1(), tarfs_calloc(), and tarfs_strdup().
| void const * tarfs_os_map_tarfile | ( | const char * | label, |
| void ** | os_handle_out, | ||
| size_t * | size_out ) |
Map a ESP32 flash partition to a virtual address space.
| label | esp32 partition label |
| os_handle_out | a pointer to an opaque OS-specific mapping handle. MUST NOT be NULL |
| size_out | a pointer to a size_t var where total mapped region size will be stored. Can be NULL |
Definition at line 222 of file os_esp32.c.
References log.
Referenced by tarfs_fsck(), and tarfs_mount().
| size_t tarfs_os_mp_maxlen | ( | ) |
Return the maximum mount point name length supported by the platform.
Some operating systems impose a limit on mount point names. TARFS uses this value when validating the archive root directory before mounting.
For platforms without such a restriction, return SIZE_MAX.
Example:
Definition at line 175 of file os_esp32.c.
Referenced by tar_rootdir().
| bool tarfs_os_register_fs | ( | const char * | prefix, |
| void * | context ) |
Tell the VFS that TARFS is now handle all the paths starting from 'prefix'.
VFS in turn promises that it will pass the 'context' in every handler function later (e.g. tarf_open(context,) etc)
Definition at line 319 of file os_esp32.c.
References prefix.
Referenced by tarfs_mount_memory().
| void tarfs_os_release_mutex | ( | ) |
Unlock access to s_tarfs[] table and to the s_numfs counter only.
Definition at line 166 of file os_esp32.c.
| void tarfs_os_unmap_tarfile | ( | void * | os_handle, |
| const void * | map, | ||
| size_t | size ) |
Opposite of tarfs_os_map_tarfile().
| label | esp32 partition label |
| os_handle | an opaque value as returned by tarfs_os_map_tarfile() |
| size | total mapped region size |
Definition at line 279 of file os_esp32.c.
References size.
Referenced by tarfs_fsck(), and tarfs_mount().
| bool tarfs_os_unregister_fs | ( | const char * | prefix | ) |
Tell the VFS that path 'prefix' is not handled by tarfs anymore.
Called by commit_unmoount()
Definition at line 306 of file os_esp32.c.
References prefix.