MOS Source Code
Loading...
Searching...
No Matches
file_ops_t Struct Reference

#include <vfs_types.h>

Public Attributes

bool(* open )(inode_t *inode, file_t *file, bool created)
 called when a file is opened, or created
 
ssize_t(* read )(const file_t *file, void *buf, size_t size, off_t offset)
 read from the file
 
ssize_t(* write )(const file_t *file, const void *buf, size_t size, off_t offset)
 write to the file
 
void(* release )(file_t *file)
 called when the last reference to the file is dropped
 
off_t(* seek )(file_t *file, off_t offset, io_seek_whence_t whence)
 seek to a new position in the file
 
bool(* mmap )(file_t *file, vmap_t *vmap, off_t offset)
 map the file into memory
 
bool(* munmap )(file_t *file, vmap_t *vmap, bool *unmapped)
 unmap the file from memory
 

Detailed Description

Definition at line 88 of file vfs_types.h.

Member Data Documentation

◆ open

bool(* open) (inode_t *inode, file_t *file, bool created)

called when a file is opened, or created

Definition at line 90 of file vfs_types.h.

Referenced by vfs_do_open_dentry().

◆ read

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

read from the file

Definition at line 91 of file vfs_types.h.

Referenced by vfs_io_ops_read().

◆ write

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

write to the file

Definition at line 92 of file vfs_types.h.

Referenced by vfs_io_ops_write().

◆ release

void(* release) (file_t *file)

called when the last reference to the file is dropped

Definition at line 93 of file vfs_types.h.

Referenced by vfs_io_ops_close().

◆ seek

off_t(* seek) (file_t *file, off_t offset, io_seek_whence_t whence)

seek to a new position in the file

Definition at line 94 of file vfs_types.h.

Referenced by vfs_io_ops_seek().

◆ mmap

bool(* mmap) (file_t *file, vmap_t *vmap, off_t offset)

map the file into memory

Definition at line 95 of file vfs_types.h.

Referenced by vfs_io_ops_mmap().

◆ munmap

bool(* munmap) (file_t *file, vmap_t *vmap, bool *unmapped)

unmap the file from memory

Definition at line 96 of file vfs_types.h.

Referenced by vfs_io_ops_munmap().


The documentation for this struct was generated from the following file: