Re: [RFC][PATCH] parser for mount options

Alexander Viro (viro@math.psu.edu)
Tue, 7 Aug 2001 21:14:47 -0400 (EDT)


On Tue, 7 Aug 2001 Andries.Brouwer@cwi.nl wrote:

> while (more_tokens) {
> t = type_of_next_token();
> switch (t) {
> case ...
> }
> }
>
> where the type_of_next_token() does the parsing, and the switch
> does the assigning. Much more code. Much uglier - but tastes differ.

I would agree, if in all cases it was about assigning a single value.
It isn't.

> If you see strange warts in my parser it is mostly because
> it was a patch without user-visible changes, so all existing
> msdos option peculiarities had to be accommodated.

But that's precisely the point. It's accomodated to warts of random syntax
and basically says "OK, nobody will ever want something that would not be
covered by it".

> Once such code is in place one needs a very good reason to
> invent option syntax not covered by it.

In other words, we can optimize for pretty arbitrary limitations. Sure.
It had been done before. Who might think that we'll ever need something
besides the array of integers or a string for sysctls? Not too random,
in that case... Well, just look at the thing now. Famous last words:
"nobody will ever do that"...

By the way, I wouldn't be surprised if it turned out that now we have
a wart not covered by ones that were there 5 years ago. I'm sure that
it also can be dealt with - no arguments here. However, it still
doesn't deal with:

* syntax being not transparent.
* the whole interface being basically _defined_ by a snapshot
of warts taken at some point.

How it was? "The difference between good and bad programs is that good
ones end up used in ways authors had never anticipated"?

Sigh... Let me put it that way - what you had described is, IMO, a kludge.
I don't think that it would be an improvement compared to the current
state of the things, but if you want it in the tree - you know where to
submit it. Tastes differ, your and mine - quite seriously.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/