#define DENTRY_IS_POSITIVE(dentry)
Check if a dentry is positive.
size_t file_generic_seek(file_t *file, ssize_t offset, seek_origin_t origin)
Helper function for basic seeking.
file_t * file_new(const path_t *path, mode_t mode)
Create a new file structure.
mode_t
Path flags and permissions.
void path_put(path_t *path)
Put a path.
uint64_t mode_check(mode_t *mode, mode_t maxPerms)
Check and adjust mode permissions.
#define PATH_CREATE(inMount, inDentry)
Helper to create a path.
void cache_free(void *obj)
Free an object back to its cache.
#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.
#define MUTEX_SCOPE(mutex)
Acquires a mutex for the reminder of the current scope.
#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 ENOENT
No such file or directory.
#define EINVAL
Invalid argument.
#define ENOMEM
Out of memory.
#define errno
Error number variable.
uint8_t seek_origin_t
Type for the seek() origin argument.
#define NULL
Pointer error value.
__INT64_TYPE__ ssize_t
Signed size type.
#define ERR
Integer error value.
static void file_free(file_t *file)
vnode_t * vnode
Will be NULL if the dentry is negative, once positive it will never be modified.
void(* close)(file_t *file)
mode_t mode
Specifies the maximum permissions for this mount and if it is a directory or a file.
const file_ops_t * fileOps
uint64_t size
Used for convenience by certain filesystems, does not represent the file size.