[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [RFC] translators



On Wed, May 31, 2000 at 10:29:51AM -0500, Neal H Walfield wrote:
> Having written several translators myself, I find that the hardest
> part is discovering the functions that I need to override and the
> correct prototypes.

Have you considered that this might be a consequence from inherent design
complexities?

>  To solve this (other than better documentation),
> I believe that rather than leaving the linker to do the function
> overriding, the hurd should be more device driver'ish whereby the main
> function makes a register file operations type call, for instance:
> 
>    register_translator(fops)
> 
> where fops is a structure of functions just like the linux fops structure.
> 
> struct trivial_translator_ops
> {
>   int (*read)(struct inode *, struct file *, off_t, int);
>   ...
> }

Of course it is trivial to put such a scheme on top of the Hurd libraries,
leaving the choice to the programmer (you could write such a thing for
yourselve, if you really want to).

However, is it really useful? If only done partially, it might lead to the
wrong conclusion that you only need to implement those functions and are
fine. This is only partially true. For example, some default implementations
in diskfs assume that multiple links to a file are allowed, which is not
true for all filesystems, so you need to override these functions with your
own implementation. Of course you can add these functions to the table, but
you must document in detail when they are needed (or you are back to reading
the source).

So, you might end up adding all functions to the table that are provided by
the library (how do you know the default implementation is proper for all
possible cases?), or you reduce it to the common ones, in which case you
suffer from inconsistency.

Well, personally, I don't think there is a problem with the way things are.
The interfaces you have to define are documented in the hurd manual, and if
not, then they should be. Details for uncommon cases will always have to be
worked out from the source of the libraries anyway.

The exact semantics of the Hurd servers and libraries are more complex than
the linux vfs.

Thanks,
Marcus

-- 
`Rhubarb is no Egyptian god.' Debian http://www.debian.org Check Key server 
Marcus Brinkmann              GNU    http://www.gnu.org    for public PGP Key 
Marcus.Brinkmann@ruhr-uni-bochum.de,     marcus@gnu.org    PGP Key ID 36E7CD09
http://homepage.ruhr-uni-bochum.de/Marcus.Brinkmann/       brinkmd@debian.org



Reply to: