|
#define | FD_TABLE_ENTRY_UNUSED (fd_table_t) { .permanent = false, .has_pending_close = false, .has_pending_select = false, .vfs_index = -1, .local_fd = -1 } |
|
#define | STATIC_ASSERT(EXPR, ...) extern char (*_do_assert(void)) [sizeof(char[1 - 2*!(EXPR)])] |
|
#define | _lock_acquire(lock) xf_lock_lock(lock) |
|
#define | _lock_release(lock) xf_lock_unlock(lock) |
|
#define | xf_strncpy(dst, src, len) strncpy((dst), (src), (len)) |
|
#define | _LOCAL_FD_T_ uint8_t |
|
#define | CHECK_AND_CALL(ret, r, pvfs, func, ...) |
|
#define | CHECK_AND_CALL_SUBCOMPONENT(ret, r, pvfs, component, func, ...) |
|
#define | CHECK_AND_CALLV(r, pvfs, func, ...) |
|
#define | CHECK_AND_CALL_SUBCOMPONENTV(r, pvfs, component, func, ...) |
|
#define | CHECK_AND_CALLP(ret, r, pvfs, func, ...) |
|
#define | CHECK_AND_CALL_SUBCOMPONENTP(ret, r, pvfs, component, func, ...) |
|
#define | CHECK_VFS_READONLY_FLAG(flags) |
|
|
| STATIC_ASSERT ((1<<(sizeof(local_fd_t) *8)) >=XF_VFS_FDS_MAX, "file descriptor type too small") |
|
| STATIC_ASSERT ((1<<(sizeof(vfs_index_t) *8)) >=XF_VFS_MAX_COUNT, "VFS index type too small") |
|
| STATIC_ASSERT (((vfs_index_t) -1)< 0, "vfs_index_t must be a signed type") |
|
static xf_vfs_ssize_t | xf_get_free_index (void) |
|
static void | xf_vfs_free_fs_ops (xf_vfs_fs_ops_t *vfs) |
|
static void | xf_vfs_free_entry (xf_vfs_entry_t *entry) |
|
static xf_vfs_fs_ops_t * | xf_minify_vfs (const xf_vfs_t *const vfs, vfs_component_proxy_t proxy) |
|
static void | free_proxy_members (vfs_component_proxy_t *proxy) |
|
static xf_vfs_fs_ops_t * | xf_vfs_duplicate_fs_ops (const xf_vfs_fs_ops_t *orig) |
|
static xf_err_t | xf_vfs_make_fs_ops (const xf_vfs_t *vfs, xf_vfs_fs_ops_t **min) |
|
static xf_err_t | xf_vfs_register_fs_common (const char *base_path, size_t len, const xf_vfs_fs_ops_t *vfs, int flags, void *ctx, int *vfs_index) |
|
static bool | fd_valid (int fd) |
|
static const xf_vfs_entry_t * | get_vfs_for_fd (int fd) |
|
static int | get_local_fd (const xf_vfs_entry_t *vfs, int fd) |
|
static const char * | translate_path (const xf_vfs_entry_t *vfs, const char *src_path) |
|
xf_err_t | xf_vfs_register_fs (const char *base_path, const xf_vfs_fs_ops_t *vfs, int flags, void *ctx) |
|
xf_err_t | xf_vfs_register_common (const char *base_path, size_t len, const xf_vfs_t *vfs, void *ctx, int *vfs_index) |
|
xf_err_t | xf_vfs_register (const char *base_path, const xf_vfs_t *vfs, void *ctx) |
|
xf_err_t | xf_vfs_register_fd_range (const xf_vfs_t *vfs, void *ctx, int min_fd, int max_fd) |
|
xf_err_t | xf_vfs_register_fs_with_id (const xf_vfs_fs_ops_t *vfs, int flags, void *ctx, xf_vfs_id_t *vfs_id) |
|
xf_err_t | xf_vfs_register_with_id (const xf_vfs_t *vfs, void *ctx, xf_vfs_id_t *vfs_id) |
|
xf_err_t | xf_vfs_unregister_with_id (xf_vfs_id_t vfs_id) |
|
xf_err_t | xf_vfs_unregister_fs_with_id (xf_vfs_id_t vfs_id) |
|
xf_err_t | xf_vfs_unregister (const char *base_path) |
|
xf_err_t | xf_vfs_unregister_fs (const char *base_path) |
|
xf_err_t | xf_vfs_register_fd (xf_vfs_id_t vfs_id, int *fd) |
|
xf_err_t | xf_vfs_register_fd_with_local_fd (xf_vfs_id_t vfs_id, int local_fd, bool permanent, int *fd) |
|
xf_err_t | xf_vfs_unregister_fd (xf_vfs_id_t vfs_id, int fd) |
|
void | xf_vfs_dump_fds (void) |
| Dump the existing VFS FDs data to FILE* fp
|
|
void | xf_vfs_dump_registered_paths (void) |
| Dump all registered FSs to the provided FILE*
|
|
xf_err_t | xf_vfs_set_readonly_flag (const char *base_path) |
|
const xf_vfs_entry_t * | xf_vfs_get_vfs_for_index (int index) |
|
const xf_vfs_entry_t * | xf_vfs_get_vfs_for_path (const char *path) |
|
int | xf_vfs_open (const char *path, int flags, int mode) |
|
xf_vfs_ssize_t | xf_vfs_write (int fd, const void *data, size_t size) |
|
xf_vfs_off_t | xf_vfs_lseek (int fd, xf_vfs_off_t size, int mode) |
|
xf_vfs_ssize_t | xf_vfs_read (int fd, void *dst, size_t size) |
|
xf_vfs_ssize_t | xf_vfs_pread (int fd, void *dst, size_t size, xf_vfs_off_t offset) |
| Implements the VFS layer of POSIX pread()
|
|
xf_vfs_ssize_t | xf_vfs_pwrite (int fd, const void *src, size_t size, xf_vfs_off_t offset) |
| Implements the VFS layer of POSIX pwrite()
|
|
int | xf_vfs_close (int fd) |
|
int | xf_vfs_fstat (int fd, xf_vfs_stat_t *st) |
|
int | xf_vfs_fcntl_r (int fd, int cmd, int arg) |
|
int | xf_vfs_ioctl (int fd, int cmd,...) |
|
int | xf_vfs_fsync (int fd) |
|
int | xf_vfs_stat (const char *path, xf_vfs_stat_t *st) |
|
int | xf_vfs_utime (const char *path, const xf_vfs_utimbuf_t *times) |
|
int | xf_vfs_link (const char *n1, const char *n2) |
|
int | xf_vfs_unlink (const char *path) |
|
int | xf_vfs_rename (const char *src, const char *dst) |
|
xf_vfs_dir_t * | xf_vfs_opendir (const char *name) |
|
xf_vfs_dirent_t * | xf_vfs_readdir (xf_vfs_dir_t *pdir) |
|
int | xf_vfs_readdir_r (xf_vfs_dir_t *pdir, xf_vfs_dirent_t *entry, xf_vfs_dirent_t **out_dirent) |
|
long | xf_vfs_telldir (xf_vfs_dir_t *pdir) |
|
void | xf_vfs_seekdir (xf_vfs_dir_t *pdir, long loc) |
|
void | xf_vfs_rewinddir (xf_vfs_dir_t *pdir) |
|
int | xf_vfs_closedir (xf_vfs_dir_t *pdir) |
|
int | xf_vfs_mkdir (const char *name, xf_vfs_mode_t mode) |
|
int | xf_vfs_rmdir (const char *name) |
|
int | xf_vfs_access (const char *path, int amode) |
|
int | xf_vfs_truncate (const char *path, xf_vfs_off_t length) |
|
int | xf_vfs_ftruncate (int fd, xf_vfs_off_t length) |
|
static void | call_end_selects (int end_index, const fds_triple_t *vfs_fds_triple, void **driver_args) |
|
static bool | xf_vfs_safe_fd_isset (int fd, const xf_fd_set *fds) |
|
static int | set_global_fd_sets (const fds_triple_t *vfs_fds_triple, int size, xf_fd_set *readfds, xf_fd_set *writefds, xf_fd_set *errorfds) |
|
static void | xf_vfs_log_fd_set (const char *fds_name, const xf_fd_set *fds) |
|
int | xf_vfs_select (int nfds, xf_fd_set *readfds, xf_fd_set *writefds, xf_fd_set *errorfds, xf_vfs_timeval_t *timeout) |
| Synchronous I/O multiplexing which implements the functionality of POSIX select() for VFS
|
|
void | xf_vfs_select_triggered (xf_vfs_select_sem_t sem) |
| Notification from a VFS driver about a read/write/error condition
|
|
void | xf_vfs_select_triggered_isr (xf_vfs_select_sem_t sem, int *woken) |
| Notification from a VFS driver about a read/write/error condition (ISR version)
|
|