|
PatchworkOS
19e446b
A non-POSIX operating system.
|
vnode operations structure. More...
#include <vnode.h>
Data Fields | |
| uint64_t(* | lookup )(vnode_t *dir, dentry_t *target) |
| Look up a dentry in a directory vnode. | |
| uint64_t(* | create )(vnode_t *dir, dentry_t *target, mode_t mode) |
| Handles both directories and files depending on mode. | |
| void(* | truncate )(vnode_t *target) |
| Set the vnode size to zero. | |
| uint64_t(* | link )(vnode_t *dir, dentry_t *old, dentry_t *new) |
| Make the same file vnode appear twice in the filesystem. | |
| uint64_t(* | readlink )(vnode_t *vnode, char *buffer, uint64_t size) |
| Retrieve the path of the symbolic link. | |
| uint64_t(* | symlink )(vnode_t *dir, dentry_t *target, const char *dest) |
| Create a symbolic link. | |
| uint64_t(* | remove )(vnode_t *dir, dentry_t *target) |
| Remove a file or directory. | |
| void(* | cleanup )(vnode_t *vnode) |
| Cleanup function called when the vnode is being freed. | |
vnode operations structure.
Note that the vnodes mutex will be acquired by the vfs.
Look up a dentry in a directory vnode.
Should set the target dentry to be positive (give it an vnode), if the entry does not exist the operation should still return success but leave the dentry negative.
| dir | The directory vnode to look in. |
| target | The dentry to look up. |
0. On failure, returns ERR and errno is set. Handles both directories and files depending on mode.
Takes in a negative dentry and creates the corresponding vnode to make the dentry positive.
| dir | The directory vnode to create the entry in. |
| target | The negative dentry to create. |
| mode | The mode to create the entry with. |
0. On failure, returns ERR and errno is set. | void(* vnode_ops_t::truncate) (vnode_t *target) |
Make the same file vnode appear twice in the filesystem.
| dir | The directory vnode to create the link in. |
| old | The existing dentry containing the vnode to link to. |
| new | The negative dentry to store the same vnode as old. |
0. On failure, returns ERR and errno is set. | void(* vnode_ops_t::cleanup) (vnode_t *vnode) |