MOS Source Code
Loading...
Searching...
No Matches
vfs_utils.cpp File Reference
#include "mos/filesystem/vfs_utils.hpp"
#include "mos/filesystem/dentry.hpp"
#include "mos/filesystem/page_cache.hpp"
#include "mos/filesystem/vfs_types.hpp"
#include "mos/lib/sync/spinlock.hpp"
#include "mos/mm/physical/pmm.hpp"
#include <algorithm>
#include <memory>
#include <mos/lib/structures/hashmap_common.hpp>
#include <mos/types.hpp>
#include <mos_stdlib.hpp>
#include <mos_string.hpp>
+ Include dependency graph for vfs_utils.cpp:

Go to the source code of this file.

Functions

static dentry_tdentry_create (superblock_t *sb, dentry_t *parent, mos::string_view name)
 
dentry_tdentry_get_from_parent (superblock_t *sb, dentry_t *parent, mos::string_view name)
 Create a new dentry with the given name and parent.
 
bool simple_page_write_begin (inode_cache_t *icache, off_t offset, size_t size, phyframe_t **page, void **private_)
 
void simple_page_write_end (inode_cache_t *icache, off_t offset, size_t size, phyframe_t *page, void *private_)
 
long simple_flush_page_discard_data (inode_cache_t *icache, off_t pgoff, phyframe_t *page)
 
ssize_t vfs_generic_read (const file_t *file, void *buf, size_t size, off_t offset)
 
ssize_t vfs_generic_write (const file_t *file, const void *buf, size_t size, off_t offset)
 
bool vfs_simple_write_begin (inode_cache_t *icache, off_t offset, size_t size)
 
void vfs_generic_iterate_dir (const dentry_t *dir, vfs_listdir_state_t *state, dentry_iterator_op add_record)
 

Function Documentation

◆ dentry_create()

static dentry_t * dentry_create ( superblock_t * sb,
dentry_t * parent,
mos::string_view name )
static

Definition at line 18 of file vfs_utils.cpp.

Referenced by dentry_get_from_parent().

+ Here is the call graph for this function:

◆ dentry_get_from_parent()

dentry_t * dentry_get_from_parent ( superblock_t * sb,
dentry_t * parent,
mos::string_view name = "" )

Create a new dentry with the given name and parent.

Parameters
sbThe superblock of the dentry
parentThe parent dentry
nameThe name of the dentry
Returns
The new dentry, or NULL if the dentry could not be created
Note
The returned dentry will have its reference count of 0.

Definition at line 37 of file vfs_utils.cpp.

Referenced by cpio_mount(), dentry_lookup_child(), memfd_create(), MOS_INIT(), sysfs_do_register(), sysfs_register_file(), tmpfs_fsop_mount(), and userfs_fsop_mount().

+ Here is the call graph for this function:

◆ simple_page_write_begin()

bool simple_page_write_begin ( inode_cache_t * icache,
off_t offset,
size_t size,
phyframe_t ** page,
void ** private_ )

Definition at line 62 of file vfs_utils.cpp.

+ Here is the call graph for this function:

◆ simple_page_write_end()

void simple_page_write_end ( inode_cache_t * icache,
off_t offset,
size_t size,
phyframe_t * page,
void * private_ )

Definition at line 74 of file vfs_utils.cpp.

◆ simple_flush_page_discard_data()

long simple_flush_page_discard_data ( inode_cache_t * icache,
off_t pgoff,
phyframe_t * page )

Definition at line 84 of file vfs_utils.cpp.

Referenced by do_flush_and_drop_cached_page().

◆ vfs_generic_read()

ssize_t vfs_generic_read ( const file_t * file,
void * buf,
size_t size,
off_t offset )

Definition at line 93 of file vfs_utils.cpp.

+ Here is the call graph for this function:

◆ vfs_generic_write()

ssize_t vfs_generic_write ( const file_t * file,
const void * buf,
size_t size,
off_t offset )

Definition at line 103 of file vfs_utils.cpp.

+ Here is the call graph for this function:

◆ vfs_simple_write_begin()

bool vfs_simple_write_begin ( inode_cache_t * icache,
off_t offset,
size_t size )

Definition at line 110 of file vfs_utils.cpp.

◆ vfs_generic_iterate_dir()

void vfs_generic_iterate_dir ( const dentry_t * dir,
vfs_listdir_state_t * state,
dentry_iterator_op add_record )

Definition at line 118 of file vfs_utils.cpp.

Referenced by sysfs_iops_iterate_dir(), and vfs_populate_listdir_buf().

+ Here is the call graph for this function: