Subject: (possibly) braindead suggestion, but, hey...
To: None <current-users@NetBSD.ORG>
From: Captech) <greywolf@tomcat.VAS.viewlogic.com (James Graham>
List: current-users
Date: 08/02/1995 11:28:44
[WARNING: I don't claim to be a kernel hacker, or even extremely
educated on precisely what happens in there, so bear with me even if I
seem a bit thick sometimes...]
Since NetBSD seems to be in one of its...um, innovative phases right now,
I have a suggestion, if it hasn't already been implemented.
The way I read the header file right now, with regard to symbolic links
(ufs/dinode.h) I find that if the symlink object name is less than or
equal to ((NDADDR + NIADDR) * sizeof(daddr_t)) in length, the object
name goes into the inode and no disk space is consumed.
How about doing the same thing for really short files? The ones
which contain pids in /var/run come to mind. I can't even count on my
hands the number of <60- (120?) byte files I have come across in my travels.
All they do is maintain some sort of trivial state, and yet they take
up an entire disk block. Never mind that disk space is cheaper these days :-)
But, still, think about it. If the file grows beyond a certain size,
you could always allocate the first block and toss the extant information
in there and proceed as normal.
I don't think it would break anything. Admittedly the gain is probably
smaller than the actual work involved, and reflecting back, it might be
a performance hit (unless, of course, you leave di_daddr[0]
zeroed out and use the rest of the block addresses, allocating a real block
when the file size exceeds the available space in the inode...)).
But the thought hit me. I'm sure there's a reason it hasn't been done,
but there's always possibilities...
--*greywolf;