MOS Source Code
Loading...
Searching...
No Matches
dentry.c File Reference
+ Include dependency graph for dentry.c:

Go to the source code of this file.

Functions

static dentry_tdentry_resolve_lastseg (dentry_t *parent, char *leaf, lastseg_resolve_flags_t flags, bool *symlink_resolved)
 
static dentry_tdentry_resolve_follow_symlink (dentry_t *dentry, lastseg_resolve_flags_t flags)
 
static dentry_tdentry_resolve_to_parent (dentry_t *base_dir, dentry_t *root_dir, const char *original_path, char **last_seg_out)
 Lookup the parent directory of a given path, and return the last segment of the path in last_seg_out.
 
void dentry_attach (dentry_t *d, inode_t *inode)
 Attach an inode to a dentry.
 
void dentry_detach (dentry_t *d)
 Detach the inode from a dentry.
 
dentry_tdentry_from_fd (fd_t fd)
 Get the dentry from a file descriptor.
 
dentry_tdentry_lookup_child (dentry_t *parent, const char *name)
 Get a child dentry from a parent dentry.
 
dentry_tdentry_resolve (dentry_t *starting_dir, dentry_t *root_dir, const char *path, lastseg_resolve_flags_t flags)
 Lookup a path in the filesystem.
 
static void dirter_add (vfs_listdir_state_t *state, u64 ino, const char *name, size_t name_len, file_type_t type)
 
void vfs_populate_listdir_buf (dentry_t *dir, vfs_listdir_state_t *state)
 List the contents of a directory.
 

Function Documentation

◆ dentry_resolve_lastseg()

static dentry_t * dentry_resolve_lastseg ( dentry_t * parent,
char * leaf,
lastseg_resolve_flags_t flags,
bool * symlink_resolved )
static

Definition at line 210 of file dentry.c.

Referenced by dentry_resolve(), and dentry_resolve_follow_symlink().

+ Here is the call graph for this function:

◆ dentry_resolve_follow_symlink()

static dentry_t * dentry_resolve_follow_symlink ( dentry_t * dentry,
lastseg_resolve_flags_t flags )
static

Definition at line 166 of file dentry.c.

Referenced by dentry_resolve_lastseg(), and dentry_resolve_to_parent().

+ Here is the call graph for this function:

◆ dentry_resolve_to_parent()

static dentry_t * dentry_resolve_to_parent ( dentry_t * base_dir,
dentry_t * root_dir,
const char * original_path,
char ** last_seg_out )
static

Lookup the parent directory of a given path, and return the last segment of the path in last_seg_out.

Parameters
base_dirA directory to start the lookup from
root_dirThe root directory of the filesystem, the lookup will not go above this directory
original_pathThe path to lookup
last_seg_outThe last segment of the path will be returned in this parameter, the caller is responsible for freeing it
Returns
dentry_t* The parent directory of the path, or NULL if the path is invalid, the dentry will be referenced

Definition at line 47 of file dentry.c.

Referenced by dentry_resolve(), and dentry_resolve_follow_symlink().

+ Here is the call graph for this function:

◆ dirter_add()

static void dirter_add ( vfs_listdir_state_t * state,
u64 ino,
const char * name,
size_t name_len,
file_type_t type )
static

Definition at line 434 of file dentry.c.

Referenced by vfs_populate_listdir_buf().

+ Here is the call graph for this function: