PatchworkOS
Loading...
Searching...
No Matches
file_ops_t Struct Reference

File operations structure. More...

#include <file.h>

Data Fields

uint64_t(* open )(file_t *file)
 
uint64_t(* open2 )(file_t *files[2])
 
void(* close )(file_t *file)
 
uint64_t(* read )(file_t *file, void *buffer, uint64_t count, uint64_t *offset)
 
uint64_t(* write )(file_t *file, const void *buffer, uint64_t count, uint64_t *offset)
 
uint64_t(* seek )(file_t *file, int64_t offset, seek_origin_t origin)
 
uint64_t(* ioctl )(file_t *file, uint64_t request, void *argp, uint64_t size)
 
wait_queue_t *(* poll )(file_t *file, poll_events_t *revents)
 
void *(* mmap )(file_t *file, void *address, uint64_t length, uint64_t *offset, pml_flags_t flags)
 

Detailed Description

File operations structure.

Note that unlike inode or dentry ops, the files inode mutex will NOT be acquired by the vfs and that the filesystem is responsible for synchronization. To understand why consider a pipe, a pipe needs to be able to block when there is no data available and then wake up when there is data available, this is only possible if multiple threads can access the pipe without blocking each other.

Definition at line 56 of file file.h.

Field Documentation

◆ close

void(* file_ops_t::close) (file_t *file)

Definition at line 60 of file file.h.

◆ ioctl

uint64_t(* file_ops_t::ioctl) (file_t *file, uint64_t request, void *argp, uint64_t size)

Definition at line 64 of file file.h.

◆ mmap

void *(* file_ops_t::mmap) (file_t *file, void *address, uint64_t length, uint64_t *offset, pml_flags_t flags)

Definition at line 66 of file file.h.

◆ open

uint64_t(* file_ops_t::open) (file_t *file)

Definition at line 58 of file file.h.

◆ open2

uint64_t(* file_ops_t::open2) (file_t *files[2])

Definition at line 59 of file file.h.

◆ poll

wait_queue_t *(* file_ops_t::poll) (file_t *file, poll_events_t *revents)

Definition at line 65 of file file.h.

◆ read

uint64_t(* file_ops_t::read) (file_t *file, void *buffer, uint64_t count, uint64_t *offset)

Definition at line 61 of file file.h.

◆ seek

uint64_t(* file_ops_t::seek) (file_t *file, int64_t offset, seek_origin_t origin)

Definition at line 63 of file file.h.

◆ write

uint64_t(* file_ops_t::write) (file_t *file, const void *buffer, uint64_t count, uint64_t *offset)

Definition at line 62 of file file.h.


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