Re: Linux/Pro -- clusters

H. Peter Anvin
2001-12-08T03:43:18Z

Followup to: <UTC200112080150.BAA195557.aeb@cwi.nl>
By author: Andries.Brouwer@cwi.nl
In newsgroup: linux.dev.kernel
>
> Yes and no. If I am not mistaken there are three details:
>
> (i) Linus prefers to separate block and character devices.
> I agree that that makes the code a bit cleaner, but dislike
> the code duplication: the interface to user space, the allocation,
> deallocation, registering is completely identical for the two.
> But apparently Linus does not mind a little bloat if that avoids
> an ugly cast in two or three places.
>

I don't understand why you can't share this code. The main reason for
having different types is so you don't mix them up -- they are
separante namespaces, and shouldn't be mixed up. Having them be
different types makes the compiler enforce this.

If we were using C++ we could make a base class which contained the
common stuff. As it is, perhaps a substructure would do it.

-hpa
--
<hpa@transmeta.com> at work, <hpa@zytor.com> in private!
"Unix gives you enough rope to shoot yourself in the foot."
http://www.zytor.com/~hpa/puzzle.txt <amsp@zytor.com>