Hacker News new | ask | show | jobs
by echoangle 583 days ago
For 1, the inode probably has a reference count that's incremented when creating a hard link and decremented when deleting one. If the count is 0, the inode can be deleted.
2 comments

This is correct, for ext2 at least. See [0], bytes 26 and 27

[0] https://wiki.osdev.org/Ext2#Inode_Data_Structure

I know its required to store this count such that the filesystem would know when it can actually delete the inode, but isn't this half-way to making the inode aware of the paths pointing to it?