Subject: Re: major device numbers
To: Dr. Bill Studenmund <email@example.com>
From: Chris G. Demetriou <firstname.lastname@example.org>
Date: 01/27/1999 21:15:14
"Dr. Bill Studenmund" <email@example.com> writes:
> [ ... ]
> > what numbers it uses. There I can find the statement
> > wdstrategy = readdisklabel(MAKEWDDEV(0, wd->sc_dev.dv_unit, RAW_PART), ...
> > which implies that /dev/rwd0c uses major number 0. Ok, I give up. :-P
No, it doesn't.
I'm not sure where you got that code (it doesn't match anything in the
tree), but it doesn't make sense. A call to readdisklabel will
usually look somewhat like:
errstring = readdisklabel(dev, strategy, <other parameters>);
The interesting thing to note there is that 'dev' isn't used to look
up 'strategy', 'strategy' is passed as an argument.
since 'dev' is _not_ used to look up the strategy (or any other *devsw
routine), the major number isn't necessary, and so is passed as 0. (a
#defined constant indicating "not needed" might be better, but once
you understand the code... 8-) There's no point in going to the work
to track down the major number if it's not goign to be used.
Chris Demetriou - firstname.lastname@example.org - http://www.netbsd.org/People/Pages/cgd.html
Disclaimer: Not speaking for NetBSD, just expressing my own opinion.