Re: new dentry feature in 2.1.78

Linus Torvalds (torvalds@transmeta.com)
10 Jan 1998 23:10:18 GMT


In article <199801100935.CAA01382@nyx10.nyx.net>,
Colin Plumb <colin@nyx.net> wrote:
>
>You know, this, and the way that Linux does inodes, always seemed silly
>to me. Why make all dentries and all iniodes the same size? Why not
>do it like C++, where there is a common leading part (the base class)
>and a type-dependent following part (for the derived class)?

Umm, having a constant-sized inode may seem like a waste of memory, but
- it's a lot faster
- it allows changing a type of the inode (ie reclaiming one inode for
another type of filesystem)
- you tend to win back anything you lose in unused space by having less
allocation overhead.

Finally, the sizes tend to be fairly close to each other (compared to
the total size of an inode), and the largest inode type is also the most
common.

In short, having different sizes for inodes only makes the code a lot
more complex for almost no gain.

Linus