Creating A New Inode
To create a new inode, we have stamfs_inode_new_ino():
- Allocate a block for the inode, and a block for the inode's block index.
- Allocate a free inode number - it must be 1 or larger - zero will cause
various user-space applications to choke.
- Allocate a VFS inode struct.
- Set the inode's link-count to 1 (it will be in a directory, which will
point to it).
- Set the rest of the inode struct's fields.
- Attach STAMFS's meta-data to the inode's private data.
- Set the various VFS operations (inode-operations, file-operations,
address-space operations) based on the inode's type (dir, file...).
- Add the inode to the parent directory.
Originally written by
guy keren