Re: PATCH for 2.3.29: block device setup cleanup.

Linus Torvalds (torvalds@transmeta.com)
Mon, 6 Dec 1999 10:56:18 -0800 (PST)


On Mon, 6 Dec 1999 Andries.Brouwer@cwi.nl wrote:
>
> And, Linus, of course my taste is not different from yours.
> On the other hand, you seem to be asking for all-or-nothing, and so far
> it has mainly been nothing. Now it is Marcin's turn, and perhaps he has
> so much time and energy that he can complete this in one go. But the kernel
> is in a perpetual state of flux, and this is a patch that touches a very
> large number of kernel files - it is not easy to do it all at once.
> But it is quite possible to go in stages, so that the final changeover is
> just changing #if 0 into #if 1, and people who want can test the intermediate
> stages.

I hate the staged approach too, because I think it becomes a maintenance
nightmare.

Compare this to the mm re-write: we broke just about every filesystem out
there, and we didn't much care. For example, as long as ext2 and NFS works
for me, I'm pretty happy, and being explicitly broken means that people
WILL fix them (unlike the "let's write ugly #ifdef infrastructure and hope
that other people will fix up _their_ stuff to be as ugly, and then switch
over in one big splash").

The device thing is going to be different, yet similar. Breaking things is
completely acceptable, if it is for a good reason, and if _enough_ things
are fixed up that many people can play with it and incrementally fix stuff
up until everything works again.

> Now I had as goal on the one hand creation of device structs, on the other
> hand allowing large minors, a bonus that comes for free. You seem to want
> block device structs only. That makes things a bit easier but of course
> reaches only one of the two goals.

I do want character devices too, but I think we should consider block
devices and character devices to be completely separate things.

Not only are the number mappings different: character device X,Y is NOT
necessarily the same as block device X,Y at all - it may be true that for
certain "raw" devices you'll find a 1:1 mapping, but for other things you
will not. For example, the ramdisk (block device) shares the major number
with the misc devices (character device), and that should cause no
confusion at all. In fact, they should be explicitly very different, I
think.

The other reason to do block devices separately is that that way you CAN
try to make this a staged process. Only break block devices (and most
people only care about IDE and SCSI - it's ok to temporarily even break
floppies etc), and not worry about breaking the tty layer. Then later, we
can do only the character devices, and now we don't need to worry about
ll_rw_block.c, for example.

In the end, we may actually end up using the same kind of structure: maybe
both the block and the character devices will be able to use a unified
structure after all. But I don't think that is necessarily true at all,
and I don't think we should design for it.

Linus

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