|
Voxia OS v0.0.1
Hobby Project Operating System Targeting x86-64
|
#include "console/console.h"#include "init/init.h"#include "ioforge/ioforge_block.h"#include "libk/debug/debug.h"#include "libk/fs/iso9660.h"#include "libk/serial.h"#include "llist.h"#include "memory/slab.h"#include "notify.h"#include "str.h"#include "vfs/vnode.h"#include <string.h>#include <type.h>#include <vector.h>#include <vfs/dentry.h>#include <vfs/dev.h>#include <vfs/enum.h>#include <vfs/filesystem.h>#include <vfs/mount.h>#include <vfs/vfs.h>#include <libk/tree/rbt.h>Go to the source code of this file.
Macros | |
| #define | RBT_TYPE vnode_t |
| #define | RBT_ID_NAME id |
| #define | VFS_DEBUG 1 |
| #define | PATH_MAX 4096 |
| #define | NAME_MAX 255 |
| #define | VFS_MAX_FS 512 |
| #define | VFS_MAX_PATH_CACHE 512 |
| #define | CALC_PATH_HASH_LEN(path, curr_depth) |
Functions | |
| static void | vfs_event_handler (uint32_t event, void *data, void *ctx) |
| __attribute__ ((used, visibility("default"), section(".export"))) | |
| This function handles memory allocation for a new dentry using the slab allocator. | |
| INIT (Vfs) | |
| static int | vfs_umount_recursive (dentry_t *dentry) |
| int | vfs_umount (dentry_ptr dentry) |
| __attribute__ ((unused)) | |
Variables | |
| static rbt_node * | NIL |
| static rbt_node * | vfs_tree |
| static struct slab_cache * | rbt_node_cache |
| #define CALC_PATH_HASH_LEN | ( | path, | |
| curr_depth ) |
| __attribute__ | ( | (unused) | ) |
Definition at line 255 of file vfs.c.
References data, dentry_put(), vnode::device, get_full_path_from_dentry(), iso9660_pvd::id, kalloc(), kfree2(), LOG2_INFO, device_id::major, memset(), device_id::minor, notify_call(), ops, vnode::ops, resolve_dentry(), retrieve_dev(), serial2_printf(), str_release(), strncmp(), UNUSED, vfs_mount(), VFS_NOTIFY_ROOT_FOUND, VFS_OK, vfs_umount(), dentry::vnode, and vxnamei().
| __attribute__ | ( | (used, visibility("default"), section(".export")) | ) |
This function handles memory allocation for a new dentry using the slab allocator.
It also links the dentry to its corresponding VNode (if provided).
| name | The name of the file or directory. |
| vnode | Pointer to the associated VNode (inode data). Pass NULL if the VNode is not yet available. |
Definition at line 42 of file vfs.c.
References KERNEL_API, memset(), NIL, rbt_insert_node(), rbt_node_cache, vfs_tree, and vxSlabAlloc().
| INIT | ( | Vfs | ) |
Definition at line 52 of file vfs.c.
References create_and_attach_vnode(), create_filesystem(), iso9660_fs_operations(), kalloc(), LOG_INFO, memset(), NIL, notify_dev_create(), NOTIFY_HIGHT, notify_register(), rbt_node_cache, str(), vfs_event_handler(), vfs_tree, VNODE_TYPE_DIR, vxCreateSlabCache(), vxSetDentryAsRoot(), and vxSlabAlloc().
|
static |
Definition at line 362 of file vfs.c.
References data, DEBUG_LEVEL_OK, KDEBUG, LOG2_DEBUG, UNUSED, and VFS_NOTIFY_PROBE.
Referenced by INIT().
| int vfs_umount | ( | dentry_ptr | dentry | ) |
Definition at line 217 of file vfs.c.
References fs_instance::block_dentry, kstring::c_str, DEBUG_LEVEL_OK, dentry_get(), dentry_put(), vnode::fs_instance, KDEBUG, LOG2_DEBUG, LOG2_WARN, cdev::major, cdev::minor, vnode::mount, vnode::mountedhere, dentry::name, vnode::type, VFS_ERR, VFS_OK, vfs_umount_recursive(), dentry::vnode, VNODE_TYPE_BLK, and VNODE_TYPE_DIR.
Referenced by __attribute__().
|
static |
Definition at line 175 of file vfs.c.
References kstring::c_str, cache_remove(), ch, dentry::child_list, container_of, atomic_t::counter, dentry_put(), get_reffcount(), get_root_cache(), llist_del(), LOG2_WARN, dentry::name, llist_head::next, next, dentry::refcount, VFS_ERR_BUSY, VFS_OK, and vfs_umount_recursive().
Referenced by vfs_umount(), and vfs_umount_recursive().
|
static |
Definition at line 37 of file vfs.c.
Referenced by __attribute__(), INIT(), rbt_fix_delete(), rbt_fix_insert(), rbt_insert_node(), rbt_remove_node(), rbt_rotate_left(), rbt_rotate_right(), and rbt_search_node().
|
static |
|
static |
Definition at line 38 of file vfs.c.
Referenced by __attribute__(), and INIT().