bool dentry_is_positive(dentry_t *dentry)
Check if a dentry is positive.
bool dentry_is_dir(dentry_t *dentry)
Check if the inode associated with a dentry is a directory.
bool dentry_is_file(dentry_t *dentry)
Check if the inode associated with a dentry is a file.
mount_t * mount_new(superblock_t *superblock, dentry_t *source, dentry_t *target, mount_t *parent, mode_t mode)
Create a new mount.
mode_t
Path flags and permissions.
void superblock_inc_mount_count(superblock_t *superblock)
Increment the mount count of a superblock.
void superblock_dec_mount_count(superblock_t *superblock)
Decrement the mount count of a superblock.
static void ref_init(ref_t *ref, void *free)
Initialize a reference counter.
#define REF(ptr)
Increment reference count.
#define UNREF(ptr)
Decrement reference count.
uint64_t vfs_id_get(void)
Generates a new unique ID, to be used for any VFS object.
#define ENOENT
No such file or directory.
#define EINVAL
Invalid argument.
#define ENOMEM
Out of memory.
#define ENOTDIR
Not a directory.
#define errno
Error number variable.
#define EISDIR
Is a directory.
#define NULL
Pointer error value.
static clock_source_t source
Structure to describe the HPET to the sys time subsystem.
static void mount_free(mount_t *mount)
#define atomic_fetch_add_explicit(object, operand, order)
#define atomic_fetch_sub_explicit(object, operand, order)
_PUBLIC void * malloc(size_t size)
_PUBLIC void free(void *ptr)
Directory entry structure.
superblock_t * superblock
The superblock of the mounted filesystem.
dentry_t * target
The dentry which the source is mounted to, can be NULL for the root filesystem.
mode_t mode
Specifies the maximum permissions for this mount and if it is a directory or a file.
mount_t * parent
The parent mount, can be NULL for the root filesystem.
dentry_t * source
The dentry to appear at target once mounted, usually the root dentry of the mounted filesystem.