VFS layer API declarations.
- Author
- Joakim NohlgÄrd joaki.nosp@m.m.no.nosp@m.hlgar.nosp@m.d@ei.nosp@m.stec..nosp@m.se
Definition in file vfs.h.
|
#define | MAX6(a, b, c, d, e, f) MAX(MAX(MAX(MAX((a), (b)), MAX((c), (d))), (e)), (f)) |
| MAX6 Function to get the largest of 6 values.
|
|
#define | VFS_MAX_OPEN_FILES (16) |
| Maximum number of simultaneous open files.
|
|
#define | VFS_DIR_BUFFER_SIZE |
| Size of buffer space in vfs_DIR.
|
|
#define | VFS_FILE_BUFFER_SIZE |
| Size of buffer space in vfs_file_t.
|
|
#define | VFS_NAME_MAX (31) |
| Maximum length of the name in a vfs_dirent_t (not including terminating null)
|
|
#define | VFS_ANY_FD (-1) |
| Used with vfs_bind to bind to any available fd number.
|
|
#define | VFS_MTD(mtd) { .dev = &mtd.base } |
| Helper macro for VFS_AUTO_MOUNT.
|
|
#define | VFS_AUTO_MOUNT(type, mtd, path, idx) |
| Define an automatic mountpoint.
|
|
#define | VFS_FS_FLAG_WANT_ABS_PATH (1 << 0) |
| File system always wants the full VFS path.
|
|
|
void | vfs_bind_stdio (void) |
| Allocate and bind file descriptors for STDIN, STDERR, and STDOUT.
|
|
int | vfs_close (int fd) |
| Close an open file.
|
|
int | vfs_fcntl (int fd, int cmd, int arg) |
| Query/set options on an open file.
|
|
int | vfs_fstat (int fd, struct stat *buf) |
| Get status of an open file.
|
|
int | vfs_fstatvfs (int fd, struct statvfs *buf) |
| Get file system status of the file system containing an open file.
|
|
int | vfs_dstatvfs (vfs_DIR *dirp, struct statvfs *buf) |
| Get file system status of the file system containing an open directory.
|
|
off_t | vfs_lseek (int fd, off_t off, int whence) |
| Seek to position in file.
|
|
int | vfs_open (const char *name, int flags, mode_t mode) |
| Open a file.
|
|
ssize_t | vfs_read (int fd, void *dest, size_t count) |
| Read bytes from an open file.
|
|
ssize_t | vfs_readline (int fd, char *dest, size_t count) |
| Read a line from an open text file.
|
|
ssize_t | vfs_write (int fd, const void *src, size_t count) |
| Write bytes to an open file.
|
|
ssize_t | vfs_write_iol (int fd, const iolist_t *iolist) |
| Write bytes from an iolist to an open file.
|
|
int | vfs_fsync (int fd) |
| Synchronize a file on storage Any pending writes are written out to storage.
|
|
int | vfs_opendir (vfs_DIR *dirp, const char *dirname) |
| Open a directory for reading with readdir.
|
|
int | vfs_readdir (vfs_DIR *dirp, vfs_dirent_t *entry) |
| Read a single entry from the open directory dirp and advance the read position by one.
|
|
int | vfs_closedir (vfs_DIR *dirp) |
| Close an open directory.
|
|
int | vfs_format (vfs_mount_t *mountp) |
| Format a file system.
|
|
int | vfs_format_by_path (const char *path) |
| Format a file system.
|
|
int | vfs_mount (vfs_mount_t *mountp) |
| Mount a file system.
|
|
int | vfs_mount_by_path (const char *path) |
| Mount a file system with a pre-configured mount path.
|
|
int | vfs_unmount_by_path (const char *path, bool force) |
| Unmount a file system with a pre-configured mount path.
|
|
int | vfs_rename (const char *from_path, const char *to_path) |
| Rename a file.
|
|
int | vfs_umount (vfs_mount_t *mountp, bool force) |
| Unmount a mounted file system.
|
|
int | vfs_unlink (const char *name) |
| Unlink (delete) a file from a mounted file system.
|
|
int | vfs_mkdir (const char *name, mode_t mode) |
| Create a directory on the file system.
|
|
int | vfs_rmdir (const char *name) |
| Remove a directory from the file system.
|
|
int | vfs_stat (const char *restrict path, struct stat *restrict buf) |
| Get file status.
|
|
int | vfs_statvfs (const char *restrict path, struct statvfs *restrict buf) |
| Get file system status.
|
|
int | vfs_bind (int fd, int flags, const vfs_file_ops_t *f_op, void *private_data) |
| Allocate a new file descriptor and give it file operations.
|
|
int | vfs_normalize_path (char *buf, const char *path, size_t buflen) |
| Normalize a path.
|
|
const vfs_mount_t * | vfs_iterate_mounts (const vfs_mount_t *cur) |
| Iterate through all mounted file systems.
|
|
bool | vfs_iterate_mount_dirs (vfs_DIR *dir) |
| Iterate through all mounted file systems by their root directories.
|
|
const vfs_file_t * | vfs_file_get (int fd) |
| Get information about the file for internal purposes.
|
|
int | vfs_sysop_stat_from_fstat (vfs_mount_t *mountp, const char *restrict path, struct stat *restrict buf) |
| Implementation of stat using fstat
|
|