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

Go to the source code of this file.

Functions

 SLAB_AUTOINIT ("dentry", dentry_cache, dentry_t)
 
static dentry_tdentry_create (superblock_t *sb, dentry_t *parent, const char *name)
 
dentry_tdentry_get_from_parent (superblock_t *sb, dentry_t *parent, const char *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)
 

Variables

slab_tdentry_cache
 

Function Documentation

◆ SLAB_AUTOINIT()

SLAB_AUTOINIT ( "dentry" ,
dentry_cache ,
dentry_t  )

◆ dentry_create()

static dentry_t * dentry_create ( superblock_t * sb,
dentry_t * parent,
const char * name )
static

Definition at line 21 of file vfs_utils.c.

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,
const char * 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 40 of file vfs_utils.c.

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 65 of file vfs_utils.c.

+ 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 76 of file vfs_utils.c.

◆ simple_flush_page_discard_data()

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

Definition at line 86 of file vfs_utils.c.

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 95 of file vfs_utils.c.

+ 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 105 of file vfs_utils.c.

+ 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 112 of file vfs_utils.c.

◆ 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 120 of file vfs_utils.c.

Referenced by sysfs_iops_iterate_dir(), and vfs_populate_listdir_buf().

+ Here is the call graph for this function:

Variable Documentation

◆ dentry_cache

slab_t* dentry_cache

Definition at line 18 of file vfs_utils.c.

Referenced by dentry_create().