By making d_ino long, aren't we shooting ourselves in the foot for when
we're running on systems with millions of terabytes of disk and need
shitloads of inodes? Yes, by that time we will probably have 128 or 256
bit longs, but we shouldn't be relying on that fact.
We need to be careful what we're talking about. There is the interface
between the user and libc (which is hard to change), the interface
between libc and the kernel (which is relatively easy to change) and
implementation of the filesystem as provided by the kernel (which is
relatively hard to change, since it has filesystem format implications).
The d_ino is the libc/kernel interface, which is relatively easy to
change. However, the use of 4 byte integers in the ext2 filesystem
format means that it will be relatively difficult to change the size of
an inode number without making serious changes to the ext2 filesystem
format.
However, before people get all hot and excited, please remember that
2**32 is a very large number. You can address four gigabytes of data
with an 2**32 address space. Since ext2 block pointers are also 2**32,
the maximum size of an ext2 filesystem is 4 terrabytes, and with 2**32
inodes, you can address up to 4 *trillion* files.
I know just how ridiculous it seems to ever want that many inodes, but
just think how big your hard drive was 10 years ago (if you had one at
all -- mine was 10MB). I expect Linux to still be around in another 10
years, and I expect similar or greater increases in storage capacities
(and decreases in physical size!).
Disk drives are doubling in size every 12-18 months; even if you assume
that disk drives are doubling every year, and will continue doing this
until 4 terrabyte drives are commonly in use, we still have a good
decade before this limitation in ext2 becomes a real problem. I
actually very much doubt that the doubling will continue indefinitely
--- almost by definition exponential increases don't go on forever!!
Also 10 years is a very long time as far as the timeline of the computer
industry are concerned. In 10 years, we went from DOS to Windows to
Windows NT. Linux went from nothing to its current prominence in five
years. By the time 10 years have rolled around, there will have been
plenty of time to completely rewrite Linux, if there's a good reason for
it.
- Ted