> Read carefully: the majorstruct also has a field pointing to a
> function with a kdev_t argument that returns the name of the device.
>
> In C terms:
>
> struct major_struct {
> unsigned int major;
> char * (* namefn)(kdev_t dev);
> ...
> };
>
> If something is wrong, the function knows what device we are
> talking about, it got the device as an argument.
Ahh, now you're talkin my language...
> You see - you get arbitrarily complicated names, dynamically
> generated, and they cost you only 4 bytes per major - much
> better than when the struct would contain its own name.
Yes, very, VERY nice. :)
Stephen
-
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/