59#define DENTRY_IS_ROOT(dentry) ((dentry)->parent == (dentry))
67#define DENTRY_IS_POSITIVE(dentry) ((dentry)->vnode != NULL)
75#define DENTRY_IS_REGULAR(dentry) (DENTRY_IS_POSITIVE(dentry) && (dentry)->vnode->type == VREG)
83#define DENTRY_IS_DIR(dentry) (DENTRY_IS_POSITIVE(dentry) && (dentry)->vnode->type == VDIR)
91#define DENTRY_IS_SYMLINK(dentry) (DENTRY_IS_POSITIVE(dentry) && (dentry)->vnode->type == VSYMLINK)
121typedef struct dentry_ops
239#define DENTRY_DOTS_AMOUNT 2
#define MAX_NAME
Maximum length of names.
dentry_t * dentry_new(superblock_t *superblock, dentry_t *parent, const char *name)
Create a new dentry.
uint64_t dentry_generic_iterate(dentry_t *dentry, dir_ctx_t *ctx)
Helper function for a basic iterate.
uint64_t dentry_id_t
Dentry ID type.
dentry_t * dentry_lookup(dentry_t *parent, const char *name, size_t length)
Lookup a dentry for the given name without traversing mountpoints.
void dentry_make_positive(dentry_t *dentry, vnode_t *vnode)
Make a dentry positive by associating it with an vnode.
void dentry_remove(dentry_t *dentry)
Remove a dentry from the dentry cache.
bool dentry_iterate_dots(dentry_t *dentry, dir_ctx_t *ctx)
Helper function to iterate over the special entries "." and "..".
dentry_t * dentry_rcu_get(const dentry_t *parent, const char *name, size_t length)
Get a dentry from the dentry cache in an RCU read-side critical section without traversing mountpoint...
Dentry operations structure.
Directory entry structure.
rcu_entry_t rcu
RCU entry for deferred cleanup.
_Atomic(uint64_t) mountCount
Number of mounts targeting this dentry.
list_entry_t otherEntry
Made available for use by any other subsystems for convenience.
dentry_t * parent
The parent dentry, will be itself if this is the root dentry, immutable after creation.
struct dentry * next
Next dentry in the dentry cache hash bucket.
vnode_t * vnode
Will be NULL if the dentry is negative, once positive it will never be modified.
superblock_t * superblock
list_entry_t siblingEntry
Directory context used to iterate over directory entries.
size_t index
An index that the filesystem can use for its own purposes.
void * data
Private data that the filesystem can use to conveniently pass data.
size_t pos
The current position in the directory, can be used to skip entries.
A entry in a doubly linked list.
Intrusive RCU head structure.
Reference counting structure.