MOS Source Code
Loading...
Searching...
No Matches
vfs_utils.h File Reference
+ Include dependency graph for vfs_utils.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void inode_init (inode_t *inode, superblock_t *sb, u64 ino, file_type_t type)
 
inode_tinode_create (superblock_t *sb, u64 ino, file_type_t type)
 
dentry_tdentry_get_from_parent (superblock_t *sb, dentry_t *parent, const char *name)
 Create a new dentry with the given name and parent.
 
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)
 
ssize_t vfs_generic_lseek (const file_t *file, off_t offset, int whence)
 
int vfs_generic_close (const file_t *file)
 
phyframe_tsimple_fill_cache (inode_cache_t *cache, off_t pgoff)
 
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)
 
void vfs_generic_iterate_dir (const dentry_t *dir, vfs_listdir_state_t *state, dentry_iterator_op op)
 

Function Documentation

◆ inode_init()

void inode_init ( inode_t * inode,
superblock_t * sb,
u64 ino,
file_type_t type )

Definition at line 49 of file inode.c.

Referenced by cpio_inode_trycreate(), inode_create(), and tmpfs_create_inode().

+ Here is the call graph for this function:

◆ inode_create()

inode_t * inode_create ( superblock_t * sb,
u64 ino,
file_type_t type )

Definition at line 65 of file inode.c.

Referenced by i_from_pbfull(), MOS_INIT(), sysfs_create_inode(), sysfs_do_register(), and sysfs_register_file().

+ 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:

◆ 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_generic_lseek()

ssize_t vfs_generic_lseek ( const file_t * file,
off_t offset,
int whence )

◆ vfs_generic_close()

int vfs_generic_close ( const file_t * file)

◆ simple_fill_cache()

phyframe_t * simple_fill_cache ( inode_cache_t * cache,
off_t pgoff )

◆ 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_iterate_dir()

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

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: