From: Nathan Neulinger Date: Mon, 26 Aug 2002 16:47:26 +0000 (+0000) Subject: fs-prototyping-20020826 X-Git-Tag: openafs-devel-1_3_50~634 X-Git-Url: https://git.openafs.org/?p=openafs.git;a=commitdiff_plain;h=55e2f743a99c5ce69150bbd1a11090393efe7aef fs-prototyping-20020826 prototype the fs command source --- diff --git a/src/venus/fs.c b/src/venus/fs.c index 23092cb..1953569 100644 --- a/src/venus/fs.c +++ b/src/venus/fs.c @@ -172,9 +172,8 @@ static int parm_setacl_id, parm_copyacl_id, parm_listacl_id; * Determine whether either the -id or -if switches are present, and * return 0, 1 or 2, as appropriate. Abort if both switches are present. */ -static int getidf(as, id) - struct cmd_syndesc *as; - int id; /* Offset of -id switch; -if is next switch */ +/* int id; Offset of -id switch; -if is next switch */ +static int getidf(struct cmd_syndesc *as, int id) { int idf = 0; @@ -194,9 +193,7 @@ static int getidf(as, id) return idf; } -static int PRights(arights, dfs) - afs_int32 arights; - int dfs; +static int PRights(afs_int32 arights, int dfs) { if (!dfs) { if (arights & PRSFS_READ) printf("r"); @@ -234,8 +231,7 @@ static int PRights(arights, dfs) } /* this function returns TRUE (1) if the file is in AFS, otherwise false (0) */ -static int InAFS(apath) - char *apath; +static int InAFS(char *apath) { struct ViceIoctl blob; afs_int32 code; @@ -252,8 +248,7 @@ static int InAFS(apath) } /* return a static pointer to a buffer */ -static char *Parent(apath) - char *apath; +static char *Parent(char *apath) { char *tp; strcpy(tspace, apath); @@ -267,10 +262,7 @@ static char *Parent(apath) enum rtype {add, destroy, deny}; -static afs_int32 Convert(arights, dfs, rtypep) - char *arights; - int dfs; - enum rtype *rtypep; +static afs_int32 Convert(char *arights, int dfs, enum rtype *rtypep) { int i, len; afs_int32 mode; @@ -345,9 +337,7 @@ static afs_int32 Convert(arights, dfs, rtypep) return mode; } -static struct AclEntry *FindList(alist, aname) - struct AclEntry *alist; - char *aname; +static struct AclEntry *FindList(struct AclEntry *alist, char *aname) { while (alist) { if (!foldcmp(alist->name, aname)) return alist; @@ -357,8 +347,7 @@ static struct AclEntry *FindList(alist, aname) } /* if no parm specified in a particular slot, set parm to be "." instead */ -static void SetDotDefault(aitemp) - struct cmd_item **aitemp; +static void SetDotDefault(struct cmd_item **aitemp) { struct cmd_item *ti; if (*aitemp) return; /* already has value */ @@ -372,11 +361,7 @@ static void SetDotDefault(aitemp) *aitemp = ti; } -static void ChangeList(al, plus, aname, arights) - struct Acl *al; - afs_int32 plus; - char *aname; - afs_int32 arights; +static void ChangeList(struct Acl *al, afs_int32 plus, char *aname, afs_int32 arights) { struct AclEntry *tlist; tlist = (plus ? al->pluslist : al->minuslist); @@ -410,8 +395,7 @@ static void ChangeList(al, plus, aname, arights) } } -static void ZapList(alist) - struct AclEntry *alist; +static void ZapList(struct AclEntry *alist) { struct AclEntry *tp, *np; for (tp = alist; tp; tp = np) { @@ -420,9 +404,7 @@ static void ZapList(alist) } } -static int PruneList(ae, dfs) - struct AclEntry **ae; - int dfs; +static int PruneList(struct AclEntry **ae, int dfs) { struct AclEntry **lp; struct AclEntry *te, *ne; @@ -444,8 +426,7 @@ static int PruneList(ae, dfs) return ctr; } -static char *SkipLine(astr) - char *astr; +static char *SkipLine(char *astr) { while (*astr !='\n') astr++; astr++; @@ -459,8 +440,7 @@ static char *SkipLine(astr) * assume that the acl is AFS: for DFS, the user can always resort to * acl_edit, but for AFS there may be no other way out). */ -static struct Acl *EmptyAcl(astr) - char *astr; +static struct Acl *EmptyAcl(char *astr) { struct Acl *tp; int junk; @@ -474,8 +454,7 @@ static struct Acl *EmptyAcl(astr) return tp; } -static struct Acl *ParseAcl(astr) - char *astr; +static struct Acl *ParseAcl(char *astr) { int nplus, nminus, i, trights; char tname[MAXNAME]; @@ -528,10 +507,7 @@ static struct Acl *ParseAcl(astr) return ta; } -static PrintStatus(status, name, offmsg) - VolumeStatus *status; - char *name; - char *offmsg; +static int PrintStatus(VolumeStatus *status, char *name, char *offmsg) { printf("Volume status for vid = %u named %s\n",status->Vid, name); if (*offmsg != 0) @@ -541,11 +517,10 @@ static PrintStatus(status, name, offmsg) else printf("unlimited\n"); printf("Current blocks used are %d\n",status->BlocksInUse); printf("The partition has %d blocks available out of %d\n\n",status->PartBlocksAvail, status->PartMaxBlocks); + return 0; } -static QuickPrintStatus(status, name) - VolumeStatus *status; - char *name; +static int QuickPrintStatus(VolumeStatus *status, char *name) { double QuotaUsed =0.0; double PartUsed =0.0; @@ -573,11 +548,10 @@ static QuickPrintStatus(status, name) printf(" <