Re: PATCH for 2.3.29: block device setup cleanup.

Marcin Dalecki (dalecki@dacotec.net)
Mon, 06 Dec 1999 20:13:13 +0100


Linus Torvalds wrote:
>
> 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.

Where it's cheap for me in terms of testig I'm already trying to put the
changes in place where they are needed. Basically the only thing I didn't
care about are the amiga specific parts.... (Fortunately I have a RAID
DACxxx at hand to test this part out.) Even if I don't get it right there
one can at least look at the patch and will see where changes will be needed.

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

Basically what I see from the code yes. On the low level part the
difference line is much exactly like what I have already explained
in a preivous message about fundamental UNIX device handling design:
block devices are mass storage and char devices are for all the other
garbage around there which can be attached to a computer.

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

Hey! nice to see that Linus is basically seeing from the code what I'm just too
lazy to explain in full length with my inferior english ;-).

--Marcin

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