Voxia OS v0.0.1
Hobby Project Operating System Targeting x86-64
Loading...
Searching...
No Matches
filesystem.c File Reference
#include "vfs/enum.h"
#include <str.h>
#include <vfs/filesystem.h>

Go to the source code of this file.

Functions

int create_filesystem (char name[16], struct fs_data *fs_data)
 
 __attribute__ ((used, visibility("default"), section(".export")))
 This function handles memory allocation for a new dentry using the slab allocator.
 

Variables

static filesystem_tregistered_filesystems = 0
 

Function Documentation

◆ __attribute__()

__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 26 of file filesystem.c.

References KERNEL_API, filesystem::name, name, filesystem::next, registered_filesystems, strlen(), and strncmp().

◆ create_filesystem()

int create_filesystem ( char name[16],
struct fs_data * fs_data )

Definition at line 7 of file filesystem.c.

References kalloc(), memcopy(), memset(), name, fs_data::ops, registered_filesystems, strncpy(), VFS_ERR, and VFS_OK.

Referenced by INIT().

Variable Documentation

◆ registered_filesystems

filesystem_t* registered_filesystems = 0
static

Definition at line 5 of file filesystem.c.

Referenced by __attribute__(), and create_filesystem().