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

Daniel Phillips (phillips@bonn-fries.net)
Tue, 7 Aug 2001 20:06:54 +0200


On Tuesday 07 August 2001 19:02, Alexander Viro wrote:
> OK, folks - here's an implementation of parser for mount options.
> Patch contains parser itself (lib/parser.c, include/linux/parser.h)
> and switches parse_options() in several filesystems to using it
> instead of the current ad-hackery.
> [...]
> It works surprisingly well - syntax is immediately visible in
> the table, code is not crapped with tons of global variables and
> parser itself is not large.

It's a big improvement.

> Patch applies clean at least to -pre4 and -pre5. Comments,
> suggestions and flames are welcome.

Can't think of anything to flame about, so how about a comment: strtok
is evil. Even strtok_r sucks somewhat for destroying the input string
but strtok is far worse for keeping internal static state. This would
be a good opportunity to add strtok_r to the library and use it.

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