[OpenAFS-devel] Sanity check re: cmd_Seek

Derrick Brashear shadow@gmail.com
Wed, 18 May 2011 21:14:17 -0400


basically you have some number of "slots" in the parm array which are
the switches. all this does is skip to a fixed offset before the next
AddParm is processed and thus fills a slot in the array.

so the assumption here is no command has more than 12 of its own
parameters, and the "generic" flags can always be added from offset 12
onward.

On Wed, May 18, 2011 at 9:10 PM, Jeff Blaine <jblaine@kickflop.net> wrote:
> Okay, I've made all -noexecute flags hidden, added
> -dryrun where there was a -noexecute, and normalized
> the help text for existing and new -dryrun args.
>
> One thing I'm unsure of is how cmd_Seek() plays a
> role in the modifications I've made. =A0As a newb,
> I figured I'd ping folks here for some feedback
> before going further with git/gerrit.
>
> src/cmd/cmd.c and src/cmd/cmd.h
>
> cmd_Seek() checks if the position requested is
> more than CMD_MAXPARMS and if not, sets the
> "number of parms" (as->nParms) to the requested
> position and returns 0. =A0So the first thing I am
> confused by is that nParms seems to be, by my
> likely naive eye, completely mis-named, and should
> be currParm or something.
>
> In src/volser/vos.c for one (before and after
> my edits, as I am not sure if I change 12), there
> is:
>
> #define COMMONPARMS =A0 =A0 cmd_Seek(ts, 12);\
> cmd_AddParm(ts, "-cell", CMD_SINGLE, CMD_OPTIONAL, "cell name");\
> cmd_AddParm(ts, "-noauth", CMD_FLAG, CMD_OPTIONAL, "don't authenticate");=
\
> cmd_AddParm(ts, "-localauth",CMD_FLAG,CMD_OPTIONAL,"use server tickets");=
\
> cmd_AddParm(ts, "-verbose", CMD_FLAG, CMD_OPTIONAL, "verbose");\
> cmd_AddParm(ts, "-encrypt", CMD_FLAG, CMD_OPTIONAL, "encrypt commands");\
> cmd_AddParm(ts, "-noresolve", CMD_FLAG, CMD_OPTIONAL, "don't resolve
> addresses"); \
>
> Can anyone shed some light on this stuff?
> _______________________________________________
> OpenAFS-devel mailing list
> OpenAFS-devel@openafs.org
> https://lists.openafs.org/mailman/listinfo/openafs-devel
>



--=20
Derrick