From: Derrick Brashear Date: Mon, 3 Mar 2003 15:37:03 +0000 (+0000) Subject: viced-vol-ansification-20030303 X-Git-Tag: openafs-devel-1_3_50~353 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=db942233a5e07ed64c43f050b02763d631ed9d9d;p=packages%2Fo%2Fopenafs.git viced-vol-ansification-20030303 some more code ansified --- diff --git a/src/viced/check_sysid.c b/src/viced/check_sysid.c index e45cddf17..2ae927c6c 100644 --- a/src/viced/check_sysid.c +++ b/src/viced/check_sysid.c @@ -29,9 +29,7 @@ struct versionStamp { /* Stolen from */ int version; }; -main(argc, argv) - int argc; - char **argv; +int main(int argc, char **argv) { int fd, size, i; diff --git a/src/viced/fsprobe.c b/src/viced/fsprobe.c index 785c00b7b..e91a9c571 100644 --- a/src/viced/fsprobe.c +++ b/src/viced/fsprobe.c @@ -29,8 +29,6 @@ RCSID("$Header$"); #endif - - struct ubik_client *cstruct; struct rx_connection *serverconns[MAXSERVERS]; char *(args[50]); @@ -45,10 +43,9 @@ extern int AFS_BulkStatus(), AFS_BulkLookup(), AFS_RenewAllTokens(); extern int AFS_BulkFetchVV(), AFS_BulkKeepAlive(); extern int AFS_Spare1(), AFS_Spare2(), AFS_Spare3(), AFS_Spare4(), AFS_Spare5(), AFS_Spare6(); -afs_int32 pxclient_Initialize(auth, serverAddr) -int auth; -afs_int32 serverAddr; -{ afs_int32 code; +afs_int32 pxclient_Initialize(int auth, afs_int32 serverAddr) +{ + afs_int32 code; afs_int32 scIndex; struct rx_securityClass *sc; @@ -89,9 +86,9 @@ afs_int32 serverAddr; #include "AFS_component_version_number.c" -main(argc, argv) - int argc; - char **argv; { +int +main(int argc, char **argv) +{ char **av = argv; struct sockaddr_in host; register afs_int32 code; @@ -138,7 +135,7 @@ main(argc, argv) else printf("return code is %d\n", code); -#ifdef notdef +#ifdef notdef while (1) { char line[500]; int nargs; @@ -248,10 +245,7 @@ main(argc, argv) } -GetArgs(line,args, nargs) - register char *line; - register char **args; - register int *nargs; +void GetArgs(register char *line, register char **args, register int *nargs) { *nargs = 0; while (*line) { @@ -268,9 +262,8 @@ GetArgs(line,args, nargs) } } -#ifdef notdef -FetchData(argp) - char **argp; +#ifdef notdef +afs_int32 FetchData(char **argp) { struct afsFetchStatus OutStatus; struct afsToken Token; @@ -301,11 +294,11 @@ FetchData(argp) code = EndAFS_FetchData(tcall, &OutStatus, &Token, &tsync); } code = rx_EndCall(tcall, code); + return code; } -static FetchProc(acall) - register struct rx_call *acall; +static afs_int32 FetchProc(register struct rx_call *acall) { extern char *malloc(); register char *tbuffer; @@ -330,8 +323,7 @@ static FetchProc(acall) } -FetchStatus(argp) - char **argp; +afs_int32 FetchStatus(char **argp) { struct afsFetchStatus OutStatus; struct afsToken Token; @@ -354,8 +346,7 @@ FetchStatus(argp) } -FetchACL(argp) - char **argp; +afs_int32 FetchACL(char **argp) { struct afsFetchStatus OutStatus; struct afsACL AccessList; @@ -379,8 +370,7 @@ FetchACL(argp) } -StoreData(argp) - char **argp; +afs_int32 StoreData(char **argp) { struct afsStoreStatus InStatus; struct afsFetchStatus OutStatus; @@ -441,10 +431,8 @@ StoreData(argp) } -static StoreProc(acall, string, length) - register struct rx_call *acall; - char *string; - int length; +static afs_int32 StoreProc(register struct rx_call *acall, + char *string, int length) { afs_int32 tlen, code; @@ -460,8 +448,7 @@ static StoreProc(acall, string, length) } -StoreStatus(argp) - char **argp; +afs_int32 StoreStatus(char **argp) { struct afsStoreStatus InStatus; struct afsFetchStatus OutStatus; @@ -503,8 +490,7 @@ StoreStatus(argp) } -StoreACL(argp) - char **argp; +afs_int32 StoreACL(char **argp) { struct afsFetchStatus OutStatus; struct afsACL AccessList; @@ -533,8 +519,7 @@ StoreACL(argp) } -RemoveFile(argp) - char **argp; +afs_int32 RemoveFile(char **argp) { struct afsFetchStatus OutDirStatus, OutFidStatus; struct afsVolSync tsync; @@ -562,8 +547,7 @@ RemoveFile(argp) } -CreateFile(argp) - char **argp; +afs_int32 CreateFile(char **argp) { struct afsFetchStatus OutDirStatus, OutFidStatus; struct afsStoreStatus InStatus; @@ -609,8 +593,7 @@ CreateFile(argp) } -Rename(argp) - char **argp; +afs_int32 Rename(char **argp) { struct afsFetchStatus OutOldDirStatus, OutNewDirStatus; struct afsFetchStatus OutOldFileStatus, OutNewFileStatus; @@ -653,8 +636,7 @@ Rename(argp) } -Symlink(argp) - char **argp; +afs_int32 Symlink(char **argp) { struct afsFetchStatus OutDirStatus, OutFidStatus; struct afsStoreStatus InStatus; @@ -702,8 +684,7 @@ Symlink(argp) } -HardLink(argp) - char **argp; +afs_int32 HardLink(char **argp) { struct afsFetchStatus OutDirStatus, OutFidStatus; struct afsVolSync tsync; @@ -736,8 +717,7 @@ HardLink(argp) } -MakeDir(argp) - char **argp; +afs_int32 MakeDir(char **argp) { struct afsFetchStatus OutDirStatus, OutFidStatus; struct afsStoreStatus InStatus; @@ -783,8 +763,7 @@ MakeDir(argp) } -RemoveDir(argp) - char **argp; +afs_int32 RemoveDir(char **argp) { struct afsFetchStatus OutDirStatus; struct afsVolSync tsync; @@ -812,8 +791,7 @@ RemoveDir(argp) } -Readdir(argp) - char **argp; +afs_int32 Readdir(char **argp) { struct afsFetchStatus OutDirStatus; struct afsVolSync tsync; @@ -849,8 +827,7 @@ Readdir(argp) } -static FetchDir(acall) - register struct rx_call *acall; +static afs_int32 FetchDir(register struct rx_call *acall) { extern char *malloc(); register char *tbuffer; @@ -880,8 +857,7 @@ static FetchDir(acall) } -Lookup(argp) - char **argp; +afs_int32 Lookup(char **argp) { struct afsFetchStatus OutDirStatus, OutFidStatus; struct afsVolSync tsync; @@ -906,8 +882,7 @@ Lookup(argp) } -GetToken(argp) - char **argp; +afs_int32 GetToken(char **argp) { struct afsFetchStatus OutStatus; struct afsVolSync tsync; @@ -934,23 +909,19 @@ GetToken(argp) } -MakeMountPoint(argp) -char **argp; +afs_int32 MakeMountPoint(char **argp) { } -ReleaseTokens(argp) -char **argp; +afs_int32 ReleaseTokens(char **argp) { } -BulkStatus(argp) -char **argp; +afs_int32 BulkStatus(char **argp) { } /* printf("ka \n"); */ -KeepAlive(argp) - char **argp; +afs_int32 KeepAlive(char **argp) { struct afsBulkFEX fex; afs_uint32 numExec, spare4; @@ -973,4 +944,4 @@ KeepAlive(argp) code = ubik_Call(AFS_BulkKeepAlive, cstruct, 0, &fex, numExec, 0, 0, 0, &spare4); return (code); } -#endif /* notfdef */ +#endif /* notdef */ diff --git a/src/viced/physio.c b/src/viced/physio.c index 60174d101..66ce91eb6 100644 --- a/src/viced/physio.c +++ b/src/viced/physio.c @@ -55,10 +55,7 @@ extern int LogLevel; afs_int32 lpErrno, lpCount; /* returns 0 on success, errno on failure */ -int ReallyRead (file, block, data) -DirHandle * file; -afs_size_t block; -char * data; +int ReallyRead (DirHandle *file, afs_size_t block, char *data) { int code; FdHandle_t *fdP; @@ -100,10 +97,7 @@ char * data; } /* returns 0 on success, errno on failure */ -int ReallyWrite (file, block, data) -DirHandle * file; -afs_size_t block; -char * data; +int ReallyWrite (DirHandle *file, afs_size_t block, char *data) { afs_int32 count; FdHandle_t *fdP; @@ -141,9 +135,7 @@ char * data; } -SetDirHandle(dir, vnode) -register DirHandle *dir; -register Vnode *vnode; +void SetDirHandle(register DirHandle *dir, register Vnode *vnode) { register Volume *vp = vnode->volumePtr; register IHandle_t *h; @@ -157,25 +149,19 @@ register Vnode *vnode; dir->dirh_handle = h; } -FidZap (file) -DirHandle * file; +void FidZap(DirHandle *file) { IH_RELEASE(file->dirh_handle); memset((char *)file, 0, sizeof(DirHandle)); } -FidZero (file) -DirHandle * file; - +void FidZero(DirHandle *file) { memset((char *)file, 0, sizeof(DirHandle)); } -FidEq (afile, bfile) -DirHandle * afile; -DirHandle * bfile; - +int FidEq(DirHandle *afile, DirHandle *bfile) { if (afile->dirh_ino != bfile->dirh_ino) return 0; if (afile->dirh_dev != bfile->dirh_dev) return 0; @@ -187,19 +173,13 @@ DirHandle * bfile; return 1; } -FidVolEq (afile, vid) -DirHandle * afile; -afs_int32 vid; - +int FidVolEq(DirHandle *afile, afs_int32 vid) { if (afile->dirh_vid != vid) return 0; return 1; } -FidCpy (tofile, fromfile) -DirHandle * tofile; -DirHandle * fromfile; - +int FidCpy(DirHandle *tofile, DirHandle *fromfile) { *tofile = *fromfile; IH_COPY(tofile->dirh_handle, fromfile->dirh_handle); diff --git a/src/viced/profile.c b/src/viced/profile.c index cc95a789e..212a0857b 100644 --- a/src/viced/profile.c +++ b/src/viced/profile.c @@ -106,8 +106,7 @@ void AllocProfBuf() int ProfileToggle(); /* Arrange to start and stop profiling when signo is sent. */ -ProfileSig(signo) - int signo; +void ProfileSig(int signo) { #if !defined (AFS_AIX_ENV) && !defined (AFS_HPUX_ENV) /* Soon should handle aix profiling */ diff --git a/src/viced/viced.c b/src/viced/viced.c index 57bd9b960..3389eac86 100644 --- a/src/viced/viced.c +++ b/src/viced/viced.c @@ -1281,25 +1281,7 @@ Do_VLRegisterRPC() { return 0; } -#if 0 -static int AddrsEqual(cnt, addr1, addr2) - int cnt; - afs_int32 *addr1, *addr2; -{ - register int i, j; - - for (i = 0; i < cnt; i++) { - for (j = 0; j < cnt; j++) { - if (addr1[i] == addr2[j]) break; - } - if (j == cnt) return 0; - } - return 1; -} -#endif - -afs_int32 -InitVL() { +afs_int32 InitVL() { int (*old)(); afs_int32 code; afs_int32 cnt, i; diff --git a/src/vol/clone.c b/src/vol/clone.c index fdaac8e87..ca9810313 100644 --- a/src/vol/clone.c +++ b/src/vol/clone.c @@ -86,9 +86,8 @@ struct clone_head { void CloneVolume(); void CloneVolume_r(); -static ci_AddItem(ah, aino) -Inode aino; -struct clone_head *ah; { +static int ci_AddItem(struct clone_head *ah, Inode aino) +{ register struct clone_items *ti; /* if no last elt (first call) or last item full, get a new one */ @@ -151,19 +150,15 @@ int ci_Destroy(struct clone_head *ah) return 0; } -static IDecProc(adata, aparm) -Inode adata; -struct clone_rock *aparm; { +static int IDecProc(Inode adata, struct clone_rock *aparm) +{ IH_DEC(aparm->h, adata, aparm->vol); DOPOLL; return 0; } -afs_int32 DoCloneIndex(rwvp, clvp, class, reclone) - Volume *rwvp; /* The RW volume */ - Volume *clvp; /* The cloned volume */ - VnodeClass class; - int reclone; /* Whether to reclone or not */ +afs_int32 DoCloneIndex(Volume *rwvp, Volume *clvp, + VnodeClass class, int reclone) { afs_int32 code, error=0; FdHandle_t *rwFd=0, *clFdIn=0, *clFdOut=0; @@ -374,9 +369,7 @@ afs_int32 DoCloneIndex(rwvp, clvp, class, reclone) } void -CloneVolume(error, original, new, old) - Error *error; - Volume *original, *new, *old; +CloneVolume(Error *error, Volume *original, Volume *new, Volume *old) { VOL_LOCK CloneVolume_r(error, original, new, old); @@ -384,9 +377,7 @@ CloneVolume(error, original, new, old) } void -CloneVolume_r(rerror, original, new, old) - Error *rerror; - Volume *original, *new, *old; +CloneVolume_r(Error *rerror, Volume *original, Volume *new, Volume *old) { afs_int32 code, error=0; afs_int32 reclone; diff --git a/src/vol/devname.c b/src/vol/devname.c index cdaf2d84b..3c1142604 100644 --- a/src/vol/devname.c +++ b/src/vol/devname.c @@ -104,9 +104,8 @@ RCSID("$Header$"); /* ensure that we don't have a "/" instead of a "/dev/rxd0a" type of device. * returns pointer to static storage; copy it out quickly! */ -char *vol_DevName(adev, wpath) -char *wpath; -dev_t adev; { +char *vol_DevName(dev_t adev, char *wpath) +{ static char pbuffer[128]; char pbuf[128], *ptr; int code, i; @@ -226,27 +225,25 @@ dev_t adev; { return NULL; } } -#ifndef AFS_AIX_ENV #ifdef AFS_SUN5_ENV (void) fclose(mntfile); #else #if defined(AFS_SGI_ENV) || defined(AFS_SUN_ENV) || defined(AFS_HPUX_ENV) || defined(AFS_LINUX22_ENV) endmntent(mfd); #else +#ifndef AFS_AIX_ENV endfsent(); #endif -#endif /* AFS_SGI_ENV */ #endif +#endif /* AFS_SGI_ENV */ return NULL; } - /* Search for the raw device name. Will put an "r" in front of each * directory and file entry of the pathname until we find a character * device. */ -char *afs_rawname(devfile) - char *devfile; +char *afs_rawname(char *devfile) { static char rawname[100]; struct stat statbuf; diff --git a/src/vol/fssync.c b/src/vol/fssync.c index 7fabc4d45..fcaeafd8e 100644 --- a/src/vol/fssync.c +++ b/src/vol/fssync.c @@ -238,8 +238,7 @@ void FSYNC_fsInit(void) #endif /* AFS_PTHREAD_ENV */ } -static int getport(addr) - struct sockaddr_in *addr; +static int getport(struct sockaddr_in *addr) { int sd; @@ -317,8 +316,7 @@ static void FSYNC_sync() { } } -static void FSYNC_newconnection(afd) - int afd; +static void FSYNC_newconnection(int afd) { struct sockaddr_in other; int junk, fd; @@ -339,8 +337,7 @@ static void FSYNC_newconnection(afd) */ afs_int32 FS_cnt = 0; -static void FSYNC_com(fd) - int fd; +static void FSYNC_com(int fd) { byte rc = FSYNC_OK; int n, i; @@ -565,8 +562,7 @@ defect #2080 for details. #endif } -static void FSYNC_Drop(fd) - int fd; +static void FSYNC_Drop(int fd) { struct offlineInfo *p; register i; @@ -645,9 +641,7 @@ static void CallHandler(fd_set *fdsetp) ReleaseReadLock(&FSYNC_handler_lock); } -static int AddHandler (afd, aproc) - int afd; - int (*aproc)(); +static int AddHandler (int afd, int (*aproc)()) { register int i; ObtainWriteLock(&FSYNC_handler_lock); @@ -663,8 +657,7 @@ static int AddHandler (afd, aproc) return 1; } -static int FindHandler (afd) - register int afd; +static int FindHandler(register int afd) { register int i; ObtainReadLock(&FSYNC_handler_lock); @@ -678,8 +671,7 @@ static int FindHandler (afd) return -1; /* satisfy compiler */ } -static int FindHandler_r (afd) - register int afd; +static int FindHandler_r(register int afd) { register int i; for(i=0;iu.param[0] is always the volume ID, for any vice inode. */ -static NukeProc(ainfo, avolid) -struct ViceInodeInfo *ainfo; -afs_int32 avolid; { +static int NukeProc(struct ViceInodeInfo *ainfo, afs_int32 avolid) +{ struct ilist *ti; register afs_int32 i; @@ -98,9 +97,8 @@ afs_int32 avolid; { * cloned from that RW volume ID, too, since everything except for their * indices will be gone. */ -nuke(aname, avolid) -char *aname; -afs_int32 avolid; { +int nuke(char *aname, afs_int32 avolid) +{ /* first process the partition containing this junk */ struct stat tstat; struct ilist *ti, *ni; diff --git a/src/vol/partition.c b/src/vol/partition.c index 18b790af0..b4075d762 100644 --- a/src/vol/partition.c +++ b/src/vol/partition.c @@ -251,9 +251,7 @@ static void VInitPartition(char *path, char *devname, Device dev) * * Use partition name as devname. */ -int VCheckPartition(part, devname) - char *part; - char *devname; +int VCheckPartition(char *part, char *devname) { #ifdef AFS_LARGEFILE_ENV struct stat64 status; @@ -355,8 +353,7 @@ int VCheckPartition(part, devname) * mounted partition (return value 0). For non-NAMEI environments, it * always returns 0. */ -static int VIsAlwaysAttach(part) - char *part; +static int VIsAlwaysAttach(char *part) { #ifdef AFS_NAMEI_ENV struct stat st; @@ -474,8 +471,7 @@ int VAttachPartitions(void) * (This function was grabbed from df.c) */ int -getmount(vmountpp) -register struct vmount **vmountpp; /* place to tell where buffer is */ +getmount(register struct vmount **vmountpp) { int size; register struct vmount *vm; diff --git a/src/vol/physio.c b/src/vol/physio.c index 8fbe594ab..f54504e5e 100644 --- a/src/vol/physio.c +++ b/src/vol/physio.c @@ -49,10 +49,7 @@ RCSID("$Header$"); #include "afs/dir.h" /* returns 0 on success, errno on failure */ -int ReallyRead (file, block, data) -DirHandle * file; -afs_size_t block; -char * data; +int ReallyRead(DirHandle *file, afs_size_t block, char *data) { FdHandle_t *fdP; int code; @@ -81,10 +78,7 @@ char * data; } /* returns 0 on success, errno on failure */ -int ReallyWrite (file, block, data) -DirHandle * file; -afs_size_t block; -char * data; +int ReallyWrite(DirHandle *file, afs_size_t block, char *data) { FdHandle_t *fdP; extern int VolumeChanged; @@ -120,11 +114,8 @@ char * data; * Create a handle to a directory entry and reference it (IH_INIT). * The handle needs to be dereferenced with the FidZap() routine. */ -SetSalvageDirHandle(dir, volume, device, inode) -DirHandle *dir; -afs_int32 volume; -Inode inode; -Device device; +void SetSalvageDirHandle(DirHandle *dir, afs_int32 volume, Device device, + Inode inode) { static SalvageCacheCheck = 1; memset(dir, 0, sizeof(DirHandle)); @@ -137,25 +128,19 @@ Device device; dir->dirh_cacheCheck = SalvageCacheCheck++; } -FidZap (file) -DirHandle * file; +void FidZap(DirHandle *file) { IH_RELEASE(file->dirh_handle); memset(file, 0, sizeof(DirHandle)); } -FidZero (file) -DirHandle * file; - +void FidZero(DirHandle *file) { memset(file, 0, sizeof(DirHandle)); } -FidEq (afile, bfile) -DirHandle * afile; -DirHandle * bfile; - +int FidEq(DirHandle *afile, DirHandle *bfile) { if (afile->dirh_volume != bfile->dirh_volume) return 0; if (afile->dirh_device != bfile->dirh_device) return 0; @@ -164,27 +149,19 @@ DirHandle * bfile; return 1; } -FidVolEq (afile, vid) -DirHandle * afile; -afs_int32 vid; - +int FidVolEq(DirHandle *afile, afs_int32 vid) { if (afile->dirh_volume != vid) return 0; return 1; } -FidCpy (tofile, fromfile) -DirHandle * tofile; -DirHandle * fromfile; - +void FidCpy(DirHandle *tofile, DirHandle *fromfile) { *tofile = *fromfile; IH_COPY(tofile->dirh_handle, fromfile->dirh_handle); } -Die (msg) -char * msg; - +void Die(char *msg) { printf("%s\n",msg); assert(1==2); diff --git a/src/vol/purge.c b/src/vol/purge.c index 110536790..fc850d369 100644 --- a/src/vol/purge.c +++ b/src/vol/purge.c @@ -90,11 +90,9 @@ void VPurgeVolume(Error *ec, Volume *vp) things work and we should be called again, 1 if success full and done, and -1 if an error occurred. It adjusts offset appropriately on 0 or 1 return codes, and otherwise doesn't touch it */ -static ObliterateRegion(avp, aclass, afile, aoffset) -afs_int32 *aoffset; -StreamHandle_t *afile; -VnodeClass aclass; -Volume *avp; { +static int ObliterateRegion(Volume *avp, VnodeClass aclass, + StreamHandle_t *afile, afs_int32 *aoffset) +{ register struct VnodeClassInfo *vcp; Inode inodes[MAXOBLITATONCE]; register afs_int32 iindex, nscanned; @@ -212,5 +210,3 @@ void PurgeHeader_r(Volume *vp) IH_DEC(V_linkHandle(vp), vp->linkHandle->ih_ino, V_parentId(vp)); #endif } - - diff --git a/src/vol/vnode.c b/src/vol/vnode.c index 0e7eb7924..a9fc4b8bd 100644 --- a/src/vol/vnode.c +++ b/src/vol/vnode.c @@ -151,8 +151,8 @@ private Vnode *VnodeHashTable[VNODE_HASH_TABLE_SIZE]; /* Code to invalidate a vnode entry. Called when we've damaged a vnode, and want to prevent future VGetVnode's from applying to it. Leaves it in the same hash bucket but that shouldn't be important. */ -VInvalidateVnode_r(avnode) -register struct Vnode *avnode; { +void VInvalidateVnode_r(register struct Vnode *avnode) +{ avnode->changed_newTime = 0; /* don't let it get flushed out again */ avnode->changed_oldTime = 0; avnode->delete = 0; /* it isn't deleted, erally */ @@ -160,9 +160,7 @@ register struct Vnode *avnode; { } /* Not normally called by general client; called by volume.c */ -VInitVnodes(class,nVnodes) - VnodeClass class; - int nVnodes; +int VInitVnodes(VnodeClass class, int nVnodes) { byte *va; register struct VnodeClassInfo *vcp = &VnodeClassInfo[class];