Re: unsigned short for nlink_t

Matti Aarnio (matti.aarnio@sonera.fi)
Sun, 5 Dec 1999 22:05:05 +0200


On Fri, Dec 03, 1999 at 10:24:31PM +0100, Russell Coker wrote:
> Currently we have an unsigned short used for the number of hard
> links to a file. I have an application which uses 30,000 hard links
> and I had hoped to scale it to more than 64K hard links...
>
> Is there any possibility that this could be changed in future kernels?
> Or is POSIX forcing it to be only a 16bit number?

That thing depends mostly on filesystem internal data layouts.
EXT2 has 16-bits unsigned at the disk. So has Solaris UFS..

Most filesystems seem to have 16 bit count limit, or 8-bit..
(some signed, others unsigned) (minix: 8bit).
Some filesystems don't (at i-nodes) seem to support links at all
(or there are no i-nodes.)

In theory nothing prevents you from cooking up your own FS which
has different on-disk layout (or reuse some unused fields), and
support that. (Compare how 64-bit filesizes are encoded to EXT2.)
Call it something else that e.g. EXT2, say: EXT2RC
Remember to tweak/create FSCK tool for it, too.

Hmm... Of course a bit troublesome is that 'stat()' structure has
only 16-bit field for link count...

> Russell Coker

/Matti Aarnio

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/