> Here's my final attempt. blockstatdirect-2.1.64 doesn't have to search
> for the device. I'm not happy with this because it allocates an array of
> 128 (MAX_BLKDEV) pointers. After that, it allocates a 2d array for each
> major for 8 devices and 5 stats. Thus on my 3-disk computer (sda, hda,
> hdc), I get basically 125+3*(7*5)=230 unused ints.
So, on a small system it wastes about 1kB, less so on a larger system.
And it is very fast code, and fixes the current buggy stuff.
Nice!
> I included blockstatarray-2.1.64 because it's a little cleaner than
> before. In my 3 disk computer, it has 1*6 unused ints. This patch
> linearly searches a sorted array of used devices. This should be changed
> to binary search for n>8 or so. I'd rather see this one used instead of
> the 'direct' patch.
Mmm.. still not too keen on adding search loops to mainline code,
especially when a faster good solution exists (above).
Anybody else following this thread?
-- mlord@pobox.com The Linux IDE guy