Voxia OS v0.0.1
Hobby Project Operating System Targeting x86-64
Loading...
Searching...
No Matches
vnode.h File Reference
#include "vfs/dentry.h"
#include "vfs/dev.h"
#include "vfs/filesystem.h"
#include <llist.h>
#include <type.h>
#include <vector.h>

Go to the source code of this file.

Data Structures

struct  vops_file_t
 
struct  vops_lnk_t
 
struct  vops_blk
 
struct  device_id
 
struct  vnode
 

Typedefs

typedef struct vops_blk vops_blk_t
 
typedef uint64_t vnode_id_t
 
typedef struct vnodevnode_ptr_t
 

Enumerations

enum  {
  VNODE_TYPE_FILE = 1 , VNODE_TYPE_DIR = 2 , VNODE_TYPE_DEV = 3 , VNODE_TYPE_CHR = 4 ,
  VNODE_TYPE_BLK = 5 , VNODE_TYPE_FIFO = 6 , VNODE_TYPE_SOCK = 7 , VNODE_TYPE_LNK = 8
}
 

Functions

struct vnode __attribute__ ((aligned(64)))
 
vnode_ptr_t __attribute__ ((used, visibility("default"), section(".export"))) create_vnode()
 This function handles memory allocation for a new dentry using the slab allocator.
 
void vxFreeVnode (vnode_ptr_t vnode)
 

Variables

atomic_t refcount
 
vnode_id_t id
 
uint8_t type
 
size_t size
 
void * ops
 
uint16_t permission
 
struct fs_instance * fs_instance
 
cdev_ptr_t mountedhere
 
cdev_ptr_t mount
 
union { 
 
   void *   vnode_private 
 
   struct device_id   device 
 
};  
 

Typedef Documentation

◆ vnode_id_t

Definition at line 49 of file vnode.h.

◆ vnode_ptr_t

typedef struct vnode* vnode_ptr_t

Definition at line 77 of file vnode.h.

◆ vops_blk_t

typedef struct vops_blk vops_blk_t

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
VNODE_TYPE_FILE 
VNODE_TYPE_DIR 
VNODE_TYPE_DEV 
VNODE_TYPE_CHR 
VNODE_TYPE_BLK 
VNODE_TYPE_FIFO 
VNODE_TYPE_SOCK 
VNODE_TYPE_LNK 

Definition at line 11 of file vnode.h.

Function Documentation

◆ __attribute__() [1/2]

struct vnode __attribute__ ( (aligned(64)) )

Definition at line 1 of file core.h.

◆ __attribute__() [2/2]

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 31 of file ioapic.c.

References __initrd_data, __serial2_producer_lock, ALIGN_UP, alloc_minor(), base, ioforge_usb_device::base, block_device_cache, BLOCK_SIZE, kstring::c_str, cache_, cap, kstring::cap, dentry::child_list, ioforge_usb_device::class_code, atomic_t::counter, create_and_attach_vnode(), CREATE_MISSING_ENTRY, data, hlist_node::dentry, dentry_cache, dev_chain, ioforge_pci_device::device_id, ioforge_device::first_child, flags, foreach_block_device_by_type(), get_current_core_data(), get_kernel_vmm_page(), dentry::hash, hash_dentry(), dentry::hash_node, header, vnode::id, initrd_read(), ioapic_base_addr, IOAPICREDTBL, ioforge_attach(), ioforge_can_contain_block_device(), ioforge_can_contain_usb_device(), ioforge_get_root(), IOFORGE_NIC, IOFORGE_PCI, IOFORGE_USB_DEVICE, IOFORGE_VIRTIO, irq_restore(), irq_save(), kalloc(), kalloc_global_lock, KALLOC_REDZONE_MAGIC, KALLOC_REDZONE_SIZE, KALLOC_SLAB_ALLOC, KERNEL_API, kfree(), kstring::len, len, llist_init(), lock, lock_irqsave(), LOG2_DEBUG, LOG2_INFO, LOG_DEBUG, LOG_ERROR, LOG_WARN, kalloc_metadata_t::magic, cdev::major, major, MAX_USB_NODES, memcopy(), memset(), cdev::minor, minor, mount_cache, multicore_start, dentry::name, filesystem::name, ioforge_device::name, name, filesystem::next, hlist_node::next, ioforge_device::next_sibling, NIL, NULL, offset, cdev::ops, ops, vnode::ops, PAGE_PRESENT, PAGE_USER, PAGE_WRITABLE, paging_get_highest_page_map(), dentry::parent, parent, parse_before_multicore(), parse_multicore(), ioforge_virtio_device::pci, pci, pci_read16(), pci_write16(), pci_write32(), vnode::permission, phys_base_alloc(), hlist_node::prev, print_dentry_tree(), print_device_tree(), ptr, rbt_insert_node(), rbt_node_cache, vops_file_t::read, read_ioapic_register(), dentry::refcount, reg, registered_filesystems, resolve_dentry(), root, serial2_printf(), ioforge_usb_device::serial_number, serial_printf(), ioforge_nic_service::service, setup_redzone(), kalloc_metadata_t::size, size, vnode::size, slab_free(), spin_acquire(), spin_release(), stack, strlen(), strncmp(), ioforge_block_device::type, ioforge_device::type, type, vnode::type, unlock_irqrestore(), vaddr_alloc_locked(), vector, ioforge_pci_device::vendor_id, VFS_OK, vfs_tree, virtio_root, vma_register(), dentry::vnode, vnode_cache, vnode_id, vnode::vnode_private, VNODE_TYPE_DIR, VNODE_TYPE_FILE, vxCreateSlabCache(), vxMultipleMmap(), and vxSlabAlloc().

◆ vxFreeVnode()

void vxFreeVnode ( vnode_ptr_t vnode)

Variable Documentation

◆ [union]

union { ... }

◆ device

struct device_id device

Definition at line 13 of file vnode.h.

Referenced by for_each_virtio_device(), pci_readl(), pci_writel(), and vxPCIGatheringBusInfo().

◆ fs_instance

struct fs_instance* fs_instance

Definition at line 7 of file vnode.h.

◆ id

Definition at line 1 of file vnode.h.

◆ mount

cdev_ptr_t mount

Definition at line 9 of file vnode.h.

◆ mountedhere

cdev_ptr_t mountedhere

Definition at line 8 of file vnode.h.

◆ ops

void* ops

Definition at line 4 of file vnode.h.

◆ permission

uint16_t permission

Definition at line 5 of file vnode.h.

◆ refcount

atomic_t refcount

Definition at line 0 of file vnode.h.

◆ size

◆ type

◆ vnode_private

void* vnode_private

Definition at line 12 of file vnode.h.