MOS Source Code
Loading...
Searching...
No Matches
vfs_utils.h
Go to the documentation of this file.
1// SPDX-License-Identifier: GPL-3.0-or-later
2
3#pragma once
4
6
7void inode_init(inode_t *inode, superblock_t *sb, u64 ino, file_type_t type);
9
20dentry_t *dentry_get_from_parent(superblock_t *sb, dentry_t *parent, const char *name);
21
22ssize_t vfs_generic_read(const file_t *file, void *buf, size_t size, off_t offset);
23ssize_t vfs_generic_write(const file_t *file, const void *buf, size_t size, off_t offset);
24ssize_t vfs_generic_lseek(const file_t *file, off_t offset, int whence);
25int vfs_generic_close(const file_t *file);
26
27// ! simple page cache functions
29bool simple_page_write_begin(inode_cache_t *icache, off_t offset, size_t size, phyframe_t **page, void **private);
30void simple_page_write_end(inode_cache_t *icache, off_t offset, size_t size, phyframe_t *page, void *private);
32
33// ! simple in-memory directory iterator
file_type_t
Definition fs_types.h:14
size_t size
Definition slab.c:30
const char * name
Definition slab.c:31
ssize_t off_t
Definition types.h:84
unsigned long long u64
Definition types.h:23
signed long ssize_t
Definition types.h:83
void dentry_iterator_op(vfs_listdir_state_t *state, u64 ino, const char *name, size_t name_len, file_type_t type)
Definition vfs_types.h:60
bool simple_page_write_begin(inode_cache_t *icache, off_t offset, size_t size, phyframe_t **page, void **private)
Definition vfs_utils.c:65
phyframe_t * simple_fill_cache(inode_cache_t *cache, off_t pgoff)
inode_t * inode_create(superblock_t *sb, u64 ino, file_type_t type)
Definition inode.c:65
ssize_t vfs_generic_write(const file_t *file, const void *buf, size_t size, off_t offset)
Definition vfs_utils.c:105
ssize_t vfs_generic_lseek(const file_t *file, off_t offset, int whence)
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.
Definition vfs_utils.c:40
void vfs_generic_iterate_dir(const dentry_t *dir, vfs_listdir_state_t *state, dentry_iterator_op op)
Definition vfs_utils.c:120
void simple_page_write_end(inode_cache_t *icache, off_t offset, size_t size, phyframe_t *page, void *private)
Definition vfs_utils.c:76
void inode_init(inode_t *inode, superblock_t *sb, u64 ino, file_type_t type)
Definition inode.c:49
int vfs_generic_close(const file_t *file)
ssize_t vfs_generic_read(const file_t *file, void *buf, size_t size, off_t offset)
Definition vfs_utils.c:95
long simple_flush_page_discard_data(inode_cache_t *icache, off_t pgoff, phyframe_t *page)
Definition vfs_utils.c:86