PatchworkOS
Loading...
Searching...
No Matches
dentry_t Struct Reference

Directory entry structure. More...

#include <dentry.h>

Public Member Functions

 _Atomic (dentry_flags_t) flags
 

Data Fields

ref_t ref
 
dentry_id_t id
 
char name [MAX_NAME]
 
inode_tinode
 
dentry_tparent
 
list_entry_t siblingEntry
 
list_t children
 
mutex_t childrenMutex
 
superblock_tsuperblock
 
const dentry_ops_tops
 
void * private
 
map_entry_t mapEntry
 
atomic_uint64_t mountCount
 

Detailed Description

Directory entry structure.

Definition at line 82 of file dentry.h.

Member Function Documentation

◆ _Atomic()

dentry_t::_Atomic ( dentry_flags_t  )

Field Documentation

◆ children

◆ childrenMutex

mutex_t dentry_t::childrenMutex

◆ id

◆ inode

◆ mapEntry

map_entry_t dentry_t::mapEntry

Definition at line 95 of file dentry.h.

Referenced by dentry_new(), and vfs_add_dentry().

◆ mountCount

atomic_uint64_t dentry_t::mountCount

The number of mounts on this dentry.

If greater then 0 and a mountpoint mounted here is in a accessible namespace, we can traverse from this dentry to the root dentry of the mounted filesystem.

The difference between a mountpoint dentry and a root dentry can be a bit confusing, so here is a quick explanation. When a filesystem is mounted the dentry that it gets mounted to becomes a mountpoint, any data that was there before becomes hidden and when we traverse to that dentry we "jump" over to the root dentry of the mounted filesystem. The root dentry of the mounted filesystem is simply the root directory of that filesystem.

This means that the mountpoint does not "become" the root of the mounted filesystem, it simply points to it.

Finally, note that just becouse a dentry is a mountpoint does not mean that it can be traversed by the current process, a process can only traverse a mountpoint if it is visible in its namespace, if its not visible the dentry acts exactly like a normal dentry.

Definition at line 114 of file dentry.h.

Referenced by dentry_dec_mount_count(), dentry_inc_mount_count(), dentry_new(), path_walk(), and path_walk_single_step().

◆ name

◆ ops

◆ parent

◆ private

◆ ref

ref_t dentry_t::ref

Definition at line 84 of file dentry.h.

Referenced by dentry_new(), file_new(), and vfs_get_dentry_internal().

◆ siblingEntry

list_entry_t dentry_t::siblingEntry

Definition at line 89 of file dentry.h.

Referenced by dentry_free(), dentry_make_positive(), and dentry_new().

◆ superblock


The documentation for this struct was generated from the following file: