Subject: Re: dev_t changes & partitions
To: Scott Reynolds <>
From: Todd Vierling <tv@NetBSD.ORG>
List: tech-kern
Date: 01/15/1998 12:51:35
On Thu, 15 Jan 1998, Scott Reynolds wrote:

: > The problem with the minor-split proposal you had was that it would require
: > devices, once renumbered, to handle two different kinds of minor numbers. 
: Um, what?  There are going to be `new' minor numbers and `old' minor
: numbers regardless, right?

Yes, but why have the device function calls figure out how to get its minor
number (whether new, 20 bits wide, or old, 8 bits wide)?

: > That, on top of the extra work to shuffle the bits, is more than is really
: > needed.
: Are you sure that this `extra work' will be actually measurable, or are
: you operating on the assumption that it will be?  A little bit of bit
: manipulation is a lot less expensive than e.g. a direct -- or indirect --
: function call.

There will _always_ be translation involved whether it is a split minor or
not; after all, once `sd' is renumbered, there has to be some way to
determine 'unit 6, parition 4' from both types of minor bits, right? 

The cheapest way is to translate upwards before the kernel starts calling
device functions--then the device only checks the new minor bits.  The
translation happens only once, when the device vnode is created, and never
happens again.  In that arrangement, it is faster (and lends itself better
to future expansion to, e.g., 64 bits) to use a single bitfield for minor
number.  You *don't*need* the extra work of shuffling two pieces around. 

===== Todd Vierling (Personal =====
== "There's a myth that there is a scarcity of justice to go around, so
== that if we extend justice to 'those people,' it will somehow erode the
== quality of justice everyone else receives."  -- Maria Price