Subject: Re: partition bookkeeping
To: None <tech-kern@netbsd.org>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
List: tech-kern
Date: 09/22/1999 17:56:53
>>> Yeah...but I still don't see any need for a "raw partition" with
>>> wedges.  Just access the underlying device directly rather than
>>> doing anything with the wedge partition devices.
> So you're sugegsting that the major number for the wedges will not be
> the same as the major number for the device itself?

That's certainly what I was expecting; until you said this, it had
never occurred to me to question it.  Just like vnd and ccd and raid
devices, wedge devices would have wedge driver majors.

> That's not something I took out of the initial wedge proposal, and is
> something I'd object to.

Why do you object to it?

> While the major numbers for the devices with wedges will be different
> from our current major numbers for the same type of device,

I don't see how this follows from anything.  It might be a good idea
for various reasons, but I certainly don't see it as anything more.

> I think the major number for the wedges should be the same as for the
> device.

> Given that, the minor number for the whole-disk has to be one of the
> minor numbers for the drive. :-)

Well, yes.  But it doesn't have to have a partition number.

I could imagine, for example...

sd0 at scsibus0 ....
-> sd0 raw partition at sd major, minor 0
-> label shows three partitions, #0, #1, #5
sd1 at scsibus0 ....
-> sd1 raw partition at sd major, minor 1
-> label shows two partitions, #4, #7
....
wedge covering sd0:
partition 0 ("sd0a") at sd major, minor 2
partition 1 ("sd0b") at sd major, minor 3
partition 5 ("sd0f") at sd major, minor 4
wedge covering sd1:
partition 4 ("sd1e") at sd major, minor 5
partition 7 ("sd1h") at sd major, minor 6

You can still access "raw" sd0 by accessing minor 0 instead of minors
2, 3, or 4.

Not that I'm saying this is the only, or even best, way to do wedges
that share their major numbers with their underlying devices - indeed,
I can see some fairly obvious potential problems with it.  But it
serves as an example of a major-sharing scheme in which underlying
devices can be accessed directly rather than having to appear as a
partition.

>> Remember, with wedges you're not talking about "disklabels" anymore,
>> you're talking about some wedge-bookkeeping structure for a disk,
>> which should contain *no* knowledge itself about what a "raw" device
>> is.
> The wedge-bookkeeping structure you talk about above is the same
> thing as the in-core disklabel Leo was talking about.

Only if you insist on sharing major numbers.  I still don't see what
that buys you, aside from complicating every disk driver with wedges
instead of isolating the wedge layer cleanly off in its own driver.

> The one thing I didn't like about the wedge proposal is it handed a
> lot off to the userland daemon.

This is one of the things I *do* like about it - it gets all the
disklabel-interpreting hair out of the kernel.  (Well, most of it;
depending on the port, it may have to have a little in order to find
its root filesystem.)

> I'd like to be able to configure into the kernel support for a few
> different partitioning scheme readers into the kernel.

As long as it doesn't excessively complicate the rest of it, I have no
problem with this.  I just don't want to *have* to do that.

> I think we should only move away from sd & wd names

And rd, and rz, and ra, and xy, and xd, and hp, etc....

> when we merge the drivers together.

I entirely agree.

					der Mouse

			       mouse@rodents.montreal.qc.ca
		     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B