|
PatchworkOS
966e257
A non-POSIX operating system.
|
Inode operations structure. More...
#include <inode.h>
Data Fields | |
| uint64_t(* | lookup )(inode_t *dir, dentry_t *target) |
| Look up a dentry in a directory inode. | |
| uint64_t(* | create )(inode_t *dir, dentry_t *target, mode_t mode) |
| Handles both directories and files depending on mode. | |
| void(* | truncate )(inode_t *target) |
| Set the inode size to zero. | |
| uint64_t(* | link )(inode_t *dir, dentry_t *old, dentry_t *new) |
| Make the same file inode appear twice in the filesystem. | |
| uint64_t(* | remove )(inode_t *dir, dentry_t *target, mode_t mode) |
| Remove a file or directory. | |
| void(* | cleanup )(inode_t *inode) |
| Cleanup function called when the inode is being freed. | |
Inode operations structure.
Note that the inodes mutex will be acquired by the vfs.
Look up a dentry in a directory inode.
Should set the target dentry to be positive (give it an inode), if the entry does not exist the operation should still return success but leave the dentry negative.
| dir | The directory inode 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 inode to make the dentry positive.
| dir | The directory inode 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(* inode_ops_t::truncate) (inode_t *target) |
Make the same file inode appear twice in the filesystem.
| dir | The directory inode to create the link in. |
| old | The existing dentry containing the inode to link to. |
| new | The negative dentry to store the same inode as old. |
0. On failure, returns ERR and errno is set. | void(* inode_ops_t::cleanup) (inode_t *inode) |