|
ginnOS
The reference: libc, the libraries and the kernel
|
a filesystem that keeps its files in kernel memory. More...
#include "tmpfs.h"#include "common/memory.h"#include "common/string.h"#include "kernel/errno.h"#include "kernel/memory/heap.h"#include "kernel/sync/mutex.h"#include "kernel/time/clock.h"#include "kernel/vfs/stat.h"Macros | |
| #define | TMPFS_NAME_MAX 64 |
| #define | TMPFS_MAX_BYTES (8u * 1024u * 1024u) |
Typedefs | |
| typedef struct tmpfs_node | tmpfs_node_t |
Functions | |
| kerr_t | tmpfs_mount (fs_mount_t *mount) |
| set up the tmpfs (empty) on a mount. | |
a filesystem that keeps its files in kernel memory.
every file and directory is a node on the kernel heap; a file's bytes are one heap buffer that grows as it is written. nothing survives a reboot.
an open file keeps its node in fs_data and its offset in fs_pos (for a directory, fs_pos is the index of the next entry). a node removed while it is open stays alive until its last close.
a symbolic link is a node whose bytes are its target. there are no hard links: a node is one name.
locking: one mutex for the whole filesystem (there is one tmpfs).
| #define TMPFS_NAME_MAX 64 |
| #define TMPFS_MAX_BYTES (8u * 1024u * 1024u) |
| typedef struct tmpfs_node tmpfs_node_t |
| kerr_t tmpfs_mount | ( | fs_mount_t * | mount | ) |
set up the tmpfs (empty) on a mount.
hand it to vfs_mount afterwards.
| mount | filesystem mount object to initialize. |