Voxia OS v0.0.1
Hobby Project Operating System Targeting x86-64
Loading...
Searching...
No Matches
vnode.c File Reference
#include "vfs/vnode.h"
#include "init/init.h"
#include "libk/serial.h"
#include "memory/slab.h"
#include <str.h>

Go to the source code of this file.

Functions

 INIT (Vnode)
 
vnode_ptr_t __attribute__ ((used, visibility("default"), section(".export")))
 This function handles memory allocation for a new dentry using the slab allocator.
 

Variables

static struct slab_cachevnode_cache = 0
 
static uint64_t vnode_id = 0
 

Function Documentation

◆ __attribute__()

vnode_ptr_t __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).

Note
This function performs lazy initialization of the dentry slab cache if it does not exist yet.
Parameters
nameThe name of the file or directory.
vnodePointer to the associated VNode (inode data). Pass NULL if the VNode is not yet available.
Returns
dentry_ptr A pointer to the newly allocated and initialized dentry.

Definition at line 15 of file vnode.c.

References vnode::id, ioapic_base_addr, IOAPICREDTBL, KERNEL_API, memset(), read_ioapic_register(), reg, vnode_cache, vnode_id, and vxSlabAlloc().

◆ INIT()

INIT ( Vnode )

Definition at line 10 of file vnode.c.

References LOG_INFO, vnode_cache, and vxCreateSlabCache().

Variable Documentation

◆ vnode_cache

struct slab_cache* vnode_cache = 0
static

Definition at line 7 of file vnode.c.

Referenced by __attribute__(), and INIT().

◆ vnode_id

uint64_t vnode_id = 0
static

Definition at line 8 of file vnode.c.

Referenced by __attribute__().