Skip to content

TMPFS

include/fs/tmpfs.h View source View on GitHub
struct tmpfs_node {
    enum tmpfs_type    type;
    char               *name;
    void               **pages;
    uint64_t           num_pages;
    uint64_t           size;
    char               *symlink_target;
    mode_t             mode;
    uid_t              uid;
    gid_t              gid;
    uint64_t           mtime;
    uint64_t           atime;
    struct tmpfs_node  *parent;
    struct tmpfs_node  **children;
    uint64_t           child_count;
    struct mutex       lock;
};
struct tmpfs_fs {
    struct tmpfs_node  *root;
};
enum tmpfs_type {
    TMPFS_FILE,
    TMPFS_DIR,
    TMPFS_SYMLINK,
};
struct vfs_node * tmpfs_mkroot(const char *mount_point);
#define TMPFS_PAGE_SIZE 4096
#define TMPFS_PAGE_SHIFT 12
#define TMPFS_PAGE_MASK (TMPFS_PAGE_SIZE - 1)