|
miniOS
x86_64 hobby kernel with SMP, VFS, and POSIX process model
|
#include <miniOS/fs/vfs.h>

Go to the source code of this file.
Functions | |
| void | tmpfs_init (void) |
| vfs_ops_t * | tmpfs_get_ops (void) |
| uint32_t | tmpfs_alloc_root (void) |
: Filename (not full path; no '/' allowed). | |
tmpfs_create() - Create a new regular file in a tmpfs directory. @parent_ino: Inode number of the parent directory (must be a directory). @new_ino_out: Set to the new inode number on success. Allocates a new inode with EXT2_S_IFREG | (mode & 0777); 0 mode defaults to 0644. Appends an ext2_dirent_t entry to the parent directory's data block.
| |
| int | tmpfs_create (uint32_t parent_ino, const char *name, uint16_t mode, uint32_t *new_ino_out) |
| int | tmpfs_create_device (uint32_t parent_ino, const char *name, uint8_t device_type, uint32_t *new_ino_out) |
: Filename (no '/' allowed). | |
tmpfs_mknod() - Create a device special file (char or block device node). @parent_ino: Inode number of the parent directory. @mode: EXT2_S_IFCHR|perms or EXT2_S_IFBLK|perms. @dev: Device number (major<<8)|minor; stored in i_rdev. @new_ino_out: Set to the new inode number on success. Maps well-known (major,minor) pairs to VFS_DEVICE_* constants so that open/read/write dispatch works for TTY (5,0) and null (1,3) devices.
| |
| int | tmpfs_mknod (uint32_t parent_ino, const char *name, uint16_t mode, uint32_t dev, uint32_t *new_ino_out) |
: Directory name (no '/' allowed). | |
tmpfs_mkdir() - Create a new directory in a tmpfs directory. @parent_ino: Inode number of the parent directory. @new_ino_out: Set to the new inode number on success. Allocates a new inode (EXT2_S_IFDIR | 0755), adds "." and ".." entries, links the new directory into parent.
| |
| int | tmpfs_mkdir (uint32_t parent_ino, const char *name, uint32_t *new_ino_out) |
: Name of the file to remove (regular file only). | |
tmpfs_unlink() - Remove a file from its parent directory and free its inode. @parent_ino: Inode number of the parent directory. Removes the directory entry from the parent. Frees all data blocks and clears the inode slot. Immediate deletion (no open-file keep-alive).
| |
| int | tmpfs_unlink (uint32_t parent_ino, const char *name) |
: Name of the subdirectory to remove. | |
tmpfs_rmdir() - Remove an empty directory. @parent_ino: Inode number of the parent directory. Only succeeds if the directory contains only "." and ".." entries.
| |
| int | tmpfs_rmdir (uint32_t parent_ino, const char *name) |
| uint32_t tmpfs_alloc_root | ( | void | ) |
tmpfs_alloc_root() - Allocate a fresh root directory inode for a new mount.
Each call to mount tmpfs <target> should call this to get an isolated root directory. The returned inode number is stored in vfs_mount_t.root_ino and activated via set_root() before each path lookup on that mount.



| int tmpfs_create_device | ( | uint32_t | parent_ino, |
| const char * | name, | ||
| uint8_t | device_type, | ||
| uint32_t * | new_ino_out ) |

| vfs_ops_t * tmpfs_get_ops | ( | void | ) |
tmpfs_get_ops() - Return a pointer to the static tmpfs vfs_ops_t table.
The returned pointer is valid for the lifetime of the kernel.
| void tmpfs_init | ( | void | ) |
tmpfs_init() - Initialise the tmpfs inode pool and register the "tmpfs" type.
Initialises the shared inode table (inode 1 = internal sentinel root) and calls register_filesystem("tmpfs", ...) so that vfs_mount_fstype("tmpfs", ...) works. Safe to call multiple times — subsequent calls are no-ops. Must be called before any vfs_mount_fstype("tmpfs", ...) invocation.



| int tmpfs_mknod | ( | uint32_t | parent_ino, |
| const char * | name, | ||
| uint16_t | mode, | ||
| uint32_t | dev, | ||
| uint32_t * | new_ino_out ) |

| int tmpfs_rmdir | ( | uint32_t | parent_ino, |
| const char * | name ) |

| int tmpfs_unlink | ( | uint32_t | parent_ino, |
| const char * | name ) |
