![]() |
MOS Source Code
|
#include "mos/filesystem/dentry.hpp"#include "mos/assert.hpp"#include "mos/filesystem/inode.hpp"#include "mos/filesystem/mount.hpp"#include "mos/filesystem/vfs.hpp"#include "mos/filesystem/vfs_types.hpp"#include "mos/filesystem/vfs_utils.hpp"#include "mos/io/io.hpp"#include "mos/lib/sync/spinlock.hpp"#include "mos/misc/kutils.hpp"#include "mos/tasks/process.hpp"#include "mos/tasks/task_types.hpp"#include <atomic>#include <mos/filesystem/fs_types.h>#include <mos/lib/structures/hashmap_common.hpp>#include <mos_stdio.hpp>#include <mos_stdlib.hpp>#include <mos_string.hpp>Go to the source code of this file.
Functions | |
| static PtrResult< dentry_t > | dentry_resolve_lastseg (dentry_t *parent, mos::string leaf, const LastSegmentResolveFlags flags, bool *is_symlink) |
| static PtrResult< dentry_t > | dentry_resolve_follow_symlink (dentry_t *dentry, LastSegmentResolveFlags flags) |
| static std::pair< PtrResult< dentry_t >, std::optional< mos::string > > | dentry_resolve_to_parent (dentry_t *base_dir, dentry_t *root_dir, mos::string_view path) |
| 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. | |
| PtrResult< dentry_t > | dentry_from_fd (fd_t fd) |
| Get the dentry from a file descriptor. | |
| PtrResult< dentry_t > | dentry_lookup_child (dentry_t *parent, mos::string_view name) |
| Get a child dentry from a parent dentry. | |
| PtrResult< dentry_t > | dentry_resolve (dentry_t *starting_dir, dentry_t *root_dir, mos::string_view path, LastSegmentResolveFlags flags) |
| Lookup a path in the filesystem. | |
| static void | dirter_add (vfs_listdir_state_t *state, u64 ino, mos::string_view name, file_type_t type) |
| void | vfs_populate_listdir_buf (dentry_t *dir, vfs_listdir_state_t *state) |
| List the contents of a directory. | |
|
static |
Definition at line 184 of file dentry.cpp.
Referenced by dentry_resolve(), and dentry_resolve_follow_symlink().
|
static |
Definition at line 142 of file dentry.cpp.
Referenced by dentry_resolve_lastseg(), and dentry_resolve_to_parent().
|
static |
Lookup the parent directory of a given path, and return the last segment of the path in last_seg_out.
| base_dir | A directory to start the lookup from |
| root_dir | The root directory of the filesystem, the lookup will not go above this directory |
| original_path | The path to lookup |
| last_seg_out | The last segment of the path will be returned in this parameter, the caller is responsible for freeing it |
Definition at line 48 of file dentry.cpp.
Referenced by dentry_resolve(), and dentry_resolve_follow_symlink().
|
static |
Definition at line 405 of file dentry.cpp.
Referenced by vfs_populate_listdir_buf().