Reputation: 1065
I had the following question on an exam:
In a ext3 filesystem the number of dentries is higher than the number of i-nodes.
I had to answer with True or False and explain.
My answer:
It is false because dentries are links between directories, and basically everything is an i-node ( even a directory ) so # i-nodes > # dentries.
However i haven't taken into cosideration the ext3 file-system. Is there something I missed or my answer is correct ?
Upvotes: 2
Views: 1377
Reputation: 41
We'll probably have more dentries due to the following:
Upvotes: 4
Reputation: 231063
The number of dentries is always higher than the number of inodes in a cleanly unmounted filesystem.
Consider: Every inode (excluding unlinked files that are kept alive through open file handles - these are purged in a clean unmount, or during recovery after an unclean unmount) has at least one dentry associated with it. Every directory inode has at least two - a link from its parent (or its own ..
for the root) and from .
. Additionally directories have an additional dentry associated with them for each subdirectory's ..
dentry.
Thus, at an absolute minimum, there is one more dentry than inode (for a FS with only the root directory). Additional directories and hardlinks inflate this further.
Upvotes: 1
Reputation: 182619
But you can have hardlinks. So you can reasonably have many dentries pointing at the same inode.
Upvotes: 1