|
PatchworkOS
966e257
A non-POSIX operating system.
|
Index node. More...
Index node.
A inode represents the actual data and metadata of a file. It is referenced by dentries, which represent the name or "location" of the file but a inode can appear in multiple dentries due to hardlinks or mounts.
Inodes have an additional purpose within the Virtual File System (VFS) as they act as the primary means of synchronization. All dentries synchronize upon their inodes mutex, open files synchronize upon the mutex of the underlying inode and operations like create, remove, etc synchronize upon the inode mutex of the parent directory.
Data Structures | |
| struct | inode_t |
| Inode structure. More... | |
| struct | inode_ops_t |
| Inode operations structure. More... | |
Enumerations | |
| enum | inode_flags_t { INODE_NONE = 0 } |
| Inode flags. More... | |
Functions | |
| inode_t * | inode_new (superblock_t *superblock, inode_number_t number, inode_type_t type, const inode_ops_t *ops, const file_ops_t *fileOps) |
| Create a new inode. | |
| void | inode_notify_access (inode_t *inode) |
| Notify the inode that it has been accessed. | |
| void | inode_notify_modify (inode_t *inode) |
| Notify the inode that its content has been modified. | |
| void | inode_notify_change (inode_t *inode) |
| Notify the inode that its metadata has changed. | |
| void | inode_truncate (inode_t *inode) |
| Truncate the inode. | |
| enum inode_flags_t |
| inode_t * inode_new | ( | superblock_t * | superblock, |
| inode_number_t | number, | ||
| inode_type_t | type, | ||
| const inode_ops_t * | ops, | ||
| const file_ops_t * | fileOps | ||
| ) |
Create a new inode.
This DOES add the inode to the inode cache. It also does not associate the inode with a dentry, that is done when a dentry is made positive with dentry_make_positive().
There is no inode_free() instead use UNREF().
| superblock | The superblock the inode belongs to. |
| number | The inode number, for a generic filesystem vfs_id_get() can be used. |
| type | The inode type. |
| ops | The inode operations. |
| fileOps | The file operations for files opened on this inode. |
NULL and errno is set. Definition at line 41 of file inode.c.
| void inode_notify_access | ( | inode_t * | inode | ) |
| void inode_notify_modify | ( | inode_t * | inode | ) |
| void inode_notify_change | ( | inode_t * | inode | ) |
| void inode_truncate | ( | inode_t * | inode | ) |
Truncate the inode.
The filesystem should implement the actual truncation in the inode ops truncate function, this is just a helper to call it.
| inode | The inode to truncate. |
Definition at line 120 of file inode.c.