12 if (superblock ==
NULL)
42 if (superblock ==
NULL)
#define assert(expression)
static dentry_ops_t dentryOps
void superblock_inc_mount_count(superblock_t *superblock)
Increment the mount count of a superblock.
superblock_t * superblock_new(filesystem_t *fs, const superblock_ops_t *ops, const dentry_ops_t *dentryOps)
Create a new superblock.
void superblock_dec_mount_count(superblock_t *superblock)
Decrement the mount count of a superblock.
static void rwlock_write_release(rwlock_t *lock)
Releases a rwlock from writing.
static void rwlock_write_acquire(rwlock_t *lock)
Acquires a rwlock for writing, blocking until it is available.
static void ref_init(ref_t *ref, void *callback)
Initialize a reference counter.
uint64_t vfs_id_get(void)
Generates a new unique ID, to be used for any VFS object.
#define EINVAL
Invalid argument.
#define ENOMEM
Out of memory.
#define errno
Error number variable.
static void list_remove(list_entry_t *entry)
Removes a list entry from its current list.
static void list_push_back(list_t *list, list_entry_t *entry)
Pushes an entry to the end of the list.
static void list_entry_init(list_entry_t *entry)
Initializes a list entry.
#define NULL
Pointer error value.
#define PAGE_SIZE
The size of a memory page in bytes.
#define atomic_fetch_sub(object, operand)
#define atomic_load(object)
#define atomic_fetch_add(object, operand)
#define atomic_init(obj, value)
_PUBLIC void * malloc(size_t size)
_PUBLIC void free(void *ptr)
Dentry operations structure.
Filesystem structure, represents a filesystem type, e.g. fat32, tmpfs, devfs, etc.
rwlock_t lock
Used internally.
list_t superblocks
Used internally.
Superblock operations structure.
void(* cleanup)(superblock_t *superblock)
void(* unmount)(superblock_t *superblock)
const superblock_ops_t * ops
atomic_uint64_t mountCount
dentry_t * root
Root dentry of the filesystem, should not take a reference.
const dentry_ops_t * dentryOps
const irp_vtable_t * vtable
static void superblock_free(superblock_t *superblock)