53 if (superblock ==
NULL)
#define assert(expression)
vnode_t * vnode_new(superblock_t *superblock, vtype_t type, const vnode_ops_t *ops, const file_ops_t *fileOps)
Create a new vnode.
void vnode_truncate(vnode_t *vnode)
Truncate the vnode.
#define CACHE_LINE
Cache line size in bytes.
void * cache_alloc(cache_t *cache)
Allocate an object from the cache.
#define CACHE_CREATE(_cache, _name, _size, _alignment, _ctor, _dtor)
Macro to create a cache initializer.
void mutex_init(mutex_t *mtx)
Initializes a mutex.
#define MUTEX_SCOPE(mutex)
Acquires a mutex for the reminder of the current scope.
void rcu_call_cache_free(void *arg)
Helper callback to free a cache object.
void rcu_call(rcu_entry_t *entry, rcu_callback_t func, void *arg)
Add a callback to be executed after a grace period.
#define REF(ptr)
Increment reference count.
static void ref_init(ref_t *ref, void *callback)
Initialize a reference counter.
#define UNREF(ptr)
Decrement reference count.
#define EINVAL
Invalid argument.
#define ENOMEM
Out of memory.
#define errno
Error number variable.
#define NULL
Pointer error value.
#define RFLAGS_INTERRUPT_ENABLE
static uint64_t rflags_read(void)
#define atomic_init(obj, value)
File operations structure.
Intrusive RCU head structure.
Reference counting structure.
vnode operations structure.
void(* cleanup)(vnode_t *vnode)
Cleanup function called when the vnode is being freed.
void(* truncate)(vnode_t *target)
Set the vnode size to zero.
superblock_t * superblock
const file_ops_t * fileOps
const irp_vtable_t * vtable
uint64_t size
Used for convenience by certain filesystems, does not represent the file size.
void * data
Filesystem defined data.
static file_ops_t fileOps
static void vnode_ctor(void *ptr)
static void vnode_free(vnode_t *vnode)