Re: memory waste in fs/devices.c/kdevname()

Guest section DW (dwguest@win.tue.nl)
Sat, 19 Dec 1998 21:00:19 +0100 (MET)


From: Riley Williams <rhw@bigfoot.com>

My analysis goes like this: kdev_t is a bitfield

NO!!

kdev_t is the kernel device type.

It is (on some machines, like mine) a pointer to a structure
with certain fields
[like int major, minor; a bit indicating char/block device;
values for size, blocksize, hardsect_size, read_ahead;
a routine that produces a name, etc.]
On certain more old-fashioned machines it may be an integral type.

No part of the kernel today is supposed to know anything
about this type - it is completely opaque - except for kdev_t.h .

Unfortunately, not everybody keeps the distinction between
dev_t and kdev_t. In Jan or Feb this year I submitted some patches
to make the kernel ready for switching to a pointer kdev_t type
and most were applied, but not the last one.
(Maybe rightly so - the other patches were clear improvements
of the code; the last patch was just the introduction of a layer
of defines to hide the NFS problems behind.)
Will try one of these days to see how kdev_t cleanliness has
survived the past year.

Andries

-
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/