[OpenAFS-devel] Sanity check re: cmd_Seek

Jeff Blaine jblaine@kickflop.net
Wed, 18 May 2011 21:10:28 -0400


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.  As 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.  So 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     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?