From 641a84b67b4206e848297cc5d23bcb35bce09b30 Mon Sep 17 00:00:00 2001 From: Derrick Brashear Date: Thu, 22 Aug 2002 23:37:11 +0000 Subject: [PATCH] prototypes-fixes-20020821 hopefully last of the lwp fun ==================== This delta was composed from multiple commits as part of the CVS->Git migration. The checkin message with each commit was inconsistent. The following are the additional commit messages. ==================== make it build on the bsds ==================== nope. this time for sure (more lwp createprocess casting) ==================== clean up osi_UFSOpen prototyping ==================== aix gets bitter at this ==================== fix missed argument ==================== again, aix doesn't like this. so, we don't do it ==================== yup, aix still hates this ==================== dux compiler doesn't like this (i think this one is actually my fault) ==================== already prototyped in rxkad_prototypes.h ==================== causes multiple inclusion of protosw.h which isn't safe on irix. ==================== for some reason you just can't declare the same thing the same way twice ==================== make dux compiler happy. oops. --- src/afs/FBSD/osi_vnodeops.c | 10 +++++----- src/afs/IRIX/osi_file.c | 1 - src/afs/UKERNEL/sysincludes.h | 5 +++-- src/afs/afs_dcache.c | 20 ++++++++++---------- src/afs/afs_prototypes.h | 7 +------ src/auth/ktc.c | 2 -- src/butc/tcmain.c | 3 ++- src/butc/tcprocs.c | 12 ++++++++---- src/butc/tcudbprocs.c | 2 +- src/rx/IRIX/rx_knet.c | 2 +- src/rx/rx_kcommon.h | 1 - src/rx/xdr.h | 2 ++ src/rx/xdr_int32.c | 2 +- src/sys/afssyscalls.h | 30 +++++++++++++++--------------- src/venus/fs.c | 1 - src/venus/livesys.c | 1 - src/vlserver/cnvldb.c | 1 - 17 files changed, 49 insertions(+), 53 deletions(-) diff --git a/src/afs/FBSD/osi_vnodeops.c b/src/afs/FBSD/osi_vnodeops.c index c48f1c213..f6204e732 100644 --- a/src/afs/FBSD/osi_vnodeops.c +++ b/src/afs/FBSD/osi_vnodeops.c @@ -276,7 +276,7 @@ afs_vop_open(ap) panic("AFS open changed vnode!"); #endif afs_BozonLock(&vc->pvnLock, vc); - osi_FlushPages(vc); + osi_FlushPages(vc, ap->a_cred); afs_BozonUnlock(&vc->pvnLock, vc); AFS_GUNLOCK(); return error; @@ -299,7 +299,7 @@ afs_vop_close(ap) else code=afs_close(avc, ap->a_fflag, &afs_osi_cred, ap->a_p); afs_BozonLock(&avc->pvnLock, avc); - osi_FlushPages(avc); /* hold bozon lock, but not basic vnode lock */ + osi_FlushPages(avc, ap->a_cred); /* hold bozon lock, but not basic vnode lock */ afs_BozonUnlock(&avc->pvnLock, avc); AFS_GUNLOCK(); return code; @@ -363,7 +363,7 @@ afs_vop_read(ap) struct vcache *avc=VTOAFS(ap->a_vp); AFS_GLOCK(); afs_BozonLock(&avc->pvnLock, avc); - osi_FlushPages(avc); /* hold bozon lock, but not basic vnode lock */ + osi_FlushPages(avc, ap->a_cred); /* hold bozon lock, but not basic vnode lock */ code=afs_read(avc, ap->a_uio, ap->a_cred, 0, 0, 0); afs_BozonUnlock(&avc->pvnLock, avc); AFS_GUNLOCK(); @@ -425,7 +425,7 @@ afs_vop_getpages(ap) uio.uio_procp=curproc; AFS_GLOCK(); afs_BozonLock(&avc->pvnLock, avc); - osi_FlushPages(avc); /* hold bozon lock, but not basic vnode lock */ + osi_FlushPages(avc, curproc->p_cred->pc_ucred); /* hold bozon lock, but not basic vnode lock */ code=afs_read(avc, &uio, curproc->p_cred->pc_ucred, 0, 0, 0); afs_BozonUnlock(&avc->pvnLock, avc); AFS_GUNLOCK(); @@ -503,7 +503,7 @@ afs_vop_write(ap) struct vcache *avc=VTOAFS(ap->a_vp); AFS_GLOCK(); afs_BozonLock(&avc->pvnLock, avc); - osi_FlushPages(avc); /* hold bozon lock, but not basic vnode lock */ + osi_FlushPages(avc, ap->a_cred); /* hold bozon lock, but not basic vnode lock */ code=afs_write(VTOAFS(ap->a_vp), ap->a_uio, ap->a_ioflag, ap->a_cred, 0); afs_BozonUnlock(&avc->pvnLock, avc); AFS_GUNLOCK(); diff --git a/src/afs/IRIX/osi_file.c b/src/afs/IRIX/osi_file.c index fb6e496ca..ac4bddfa7 100644 --- a/src/afs/IRIX/osi_file.c +++ b/src/afs/IRIX/osi_file.c @@ -17,7 +17,6 @@ RCSID("$Header$"); #include "../afs/afs_stats.h" /* afs statistics */ int afs_osicred_initialized=0; -struct AFS_UCRED afs_osi_cred; afs_lock_t afs_xosi; /* lock is for tvattr */ extern struct osi_dev cacheDev; extern struct vfs *afs_cacheVfsp; diff --git a/src/afs/UKERNEL/sysincludes.h b/src/afs/UKERNEL/sysincludes.h index e0057fda6..0e403daec 100644 --- a/src/afs/UKERNEL/sysincludes.h +++ b/src/afs/UKERNEL/sysincludes.h @@ -1329,13 +1329,14 @@ struct min_direct { #ifndef NOGROUP #define NOGROUP (-1) #endif +#ifdef cr_gid +#undef cr_gid +#endif struct usr_ucred { unsigned long cr_ref; long cr_uid; -#if !defined(AFS_USR_FBSD_ENV) && !defined(AFS_USR_DARWIN60_ENV) long cr_gid; -#endif long cr_ruid; long cr_rgid; long cr_suid; diff --git a/src/afs/afs_dcache.c b/src/afs/afs_dcache.c index 19cc82d83..447229800 100644 --- a/src/afs/afs_dcache.c +++ b/src/afs/afs_dcache.c @@ -1798,22 +1798,22 @@ RetryLookup: overWriteWholeChunk = 1; if (doAdjustSize || overWriteWholeChunk) { #if defined(AFS_AIX32_ENV) || defined(AFS_SGI_ENV) - #ifdef AFS_SGI_ENV - #ifdef AFS_SGI64_ENV +#ifdef AFS_SGI_ENV +#ifdef AFS_SGI64_ENV if (doAdjustSize) adjustsize = NBPP; - #else /* AFS_SGI64_ENV */ - if (doAdjustSize) adjustsize = 8192; - #endif /* AFS_SGI64_ENV */ - #else /* AFS_SGI_ENV */ +#else /* AFS_SGI64_ENV */ + if (doAdjustSize) adjustsize = 8192; +#endif /* AFS_SGI64_ENV */ +#else /* AFS_SGI_ENV */ if (doAdjustSize) adjustsize = 4096; - #endif /* AFS_SGI_ENV */ +#endif /* AFS_SGI_ENV */ if (AFS_CHUNKTOBASE(chunk)+adjustsize >= avc->m.Length && #else /* defined(AFS_AIX32_ENV) || defined(AFS_SGI_ENV) */ - #if defined(AFS_SUN_ENV) || defined(AFS_OSF_ENV) +#if defined(AFS_SUN_ENV) || defined(AFS_OSF_ENV) if ((doAdjustSize || (AFS_CHUNKTOBASE(chunk) >= avc->m.Length)) && - #else +#else if (AFS_CHUNKTOBASE(chunk) >= avc->m.Length && - #endif +#endif #endif /* defined(AFS_AIX32_ENV) || defined(AFS_SGI_ENV) */ !hsame(avc->m.DataVersion, tdc->f.versionNo)) doReallyAdjustSize = 1; diff --git a/src/afs/afs_prototypes.h b/src/afs/afs_prototypes.h index 8c8163799..9f5b70b41 100644 --- a/src/afs/afs_prototypes.h +++ b/src/afs/afs_prototypes.h @@ -458,7 +458,7 @@ extern int afs_osi_SleepSig(void *event); /* ARCH/osi_file.c */ extern int afs_osicred_initialized; -#if defined(AFS_SUN57_64BIT_ENV) +#if defined(AFS_SUN57_64BIT_ENV) || defined(AFS_SGI62_ENV) extern void *osi_UFSOpen(ino_t ainode); #else extern void *osi_UFSOpen(afs_int32 ainode); @@ -495,11 +495,6 @@ extern struct vnodeops Afs_vnodeops; /* afs_osifile.c */ -#ifdef AFS_SGI62_ENV -extern void *osi_UFSOpen(ino_t); -#else -extern void *osi_UFSOpen(); -#endif /* afs_osi_pag.c */ extern afs_uint32 pag_epoch; diff --git a/src/auth/ktc.c b/src/auth/ktc.c index 7a3d6f547..b304e5a21 100644 --- a/src/auth/ktc.c +++ b/src/auth/ktc.c @@ -80,8 +80,6 @@ RCSID("$Header$"); #ifdef AFS_KERBEROS_ENV #include #include -extern afs_uint32 life_to_time(); -extern unsigned char time_to_life(); #include "cellconfig.h" static char lcell[MAXCELLCHARS]; diff --git a/src/butc/tcmain.c b/src/butc/tcmain.c index c616375a7..2beca24ce 100644 --- a/src/butc/tcmain.c +++ b/src/butc/tcmain.c @@ -1086,7 +1086,8 @@ char *arock; { code = pthread_create(&dbWatcherPid, &tattr, dbWatcher, (void *)2); AFS_SIGSET_RESTORE(); #else - code = LWP_CreateProcess(dbWatcher, 20480, LWP_NORMAL_PRIORITY, 2, "dbWatcher", &dbWatcherPid); + code = LWP_CreateProcess(dbWatcher, 20480, LWP_NORMAL_PRIORITY, + (void *) 2, "dbWatcher", &dbWatcherPid); #endif if (code) { diff --git a/src/butc/tcprocs.c b/src/butc/tcprocs.c index f5844d22b..49dafba4e 100644 --- a/src/butc/tcprocs.c +++ b/src/butc/tcprocs.c @@ -127,7 +127,8 @@ afs_int32 STC_LabelTape(acid, label, taskId) code = pthread_create(&pid, &tattr, Labeller, ptr); AFS_SIGSET_RESTORE(); #else - code = LWP_CreateProcess(Labeller, 32768, 1, ptr ,"labeller process", &pid); + code = LWP_CreateProcess(Labeller, 32768, 1, (void *) ptr, + "labeller process", &pid); #endif error_exit: @@ -221,7 +222,8 @@ afs_int32 STC_PerformDump(rxCallId, tcdiPtr, tc_dumpArrayPtr, taskId) code = pthread_create(&pid, &tattr, Dumper, newNode); AFS_SIGSET_RESTORE(); #else - code = LWP_CreateProcess(Dumper, 32768, 1, newNode, "dumper process", &pid); + code = LWP_CreateProcess(Dumper, 32768, 1, (void *) newNode, + "dumper process", &pid); #endif if (code) ERROR_EXIT(code); @@ -298,7 +300,8 @@ afs_int32 STC_PerformRestore(acid, dumpSetName, arestores, taskID) code = pthread_create(&pid, &tattr, Restorer, newNode); AFS_SIGSET_RESTORE(); #else - code = LWP_CreateProcess(Restorer, 65368, 1,newNode ,"restorer process", &pid); + code = LWP_CreateProcess(Restorer, 65368, 1, (void *) newNode, + "restorer process", &pid); #endif error_exit: @@ -384,7 +387,8 @@ afs_int32 STC_RestoreDb(rxCall, taskId) code = pthread_create(&pid, &tattr, restoreDbFromTape, (void *)*taskId); AFS_SIGSET_RESTORE(); #else - code = LWP_CreateProcess(restoreDbFromTape, 32768, 1, *taskId, "Db restore", &pid); + code = LWP_CreateProcess(restoreDbFromTape, 32768, 1, + (void *)*taskId, "Db restore", &pid); #endif error_exit: diff --git a/src/butc/tcudbprocs.c b/src/butc/tcudbprocs.c index 348f315c7..10fcb28cd 100644 --- a/src/butc/tcudbprocs.c +++ b/src/butc/tcudbprocs.c @@ -910,7 +910,7 @@ writeDbDump(tapeInfoPtr, taskId, expires, dumpid) code = pthread_create(&alivePid, &tattr, KeepAlive, 0); AFS_SIGSET_RESTORE(); #else - code = LWP_CreateProcess(KeepAlive, 16384, 1, NULL, + code = LWP_CreateProcess(KeepAlive, 16384, 1, (void *) NULL, "Keep-alive process", &alivePid); #endif /* XXX should we check code here ??? XXX */ diff --git a/src/rx/IRIX/rx_knet.c b/src/rx/IRIX/rx_knet.c index c6abbaf0d..e60681bb7 100644 --- a/src/rx/IRIX/rx_knet.c +++ b/src/rx/IRIX/rx_knet.c @@ -104,7 +104,7 @@ int osi_NetReceive(osi_socket so, struct sockaddr_in *addr, struct iovec *dvec, else { *alength = *alength - tuio.uio_resid; if (maddr) { - memcpy((char*)from, (char*)mtod(maddr, struct sockaddr_in *), + memcpy((char*)addr, (char*)mtod(maddr, struct sockaddr_in *), sizeof(struct sockaddr_in)); m_freem(maddr); } diff --git a/src/rx/rx_kcommon.h b/src/rx/rx_kcommon.h index 63221e36b..d50ba4123 100644 --- a/src/rx/rx_kcommon.h +++ b/src/rx/rx_kcommon.h @@ -103,7 +103,6 @@ struct coda_inode_info {}; #include "../afs/afs_stats.h" #include "../h/errno.h" #ifdef KERNEL -#include "../afs/sysincludes.h" #include "../afs/afsincludes.h" #endif diff --git a/src/rx/xdr.h b/src/rx/xdr.h index 3b2dbe726..b52fef9b7 100644 --- a/src/rx/xdr.h +++ b/src/rx/xdr.h @@ -43,8 +43,10 @@ #include #endif /* _MFC_VER */ #endif +#ifndef bool_t #define bool_t int #define enum_t int +#endif #ifndef FALSE #define FALSE 0 #endif /* !FALSE */ diff --git a/src/rx/xdr_int32.c b/src/rx/xdr_int32.c index 1340dbd05..de58026e5 100644 --- a/src/rx/xdr_int32.c +++ b/src/rx/xdr_int32.c @@ -38,7 +38,7 @@ RCSID("$Header$"); #ifndef NeXT -#ifdef KERNEL +#if defined(KERNEL) && !defined(UKERNEL) #include #else #include diff --git a/src/sys/afssyscalls.h b/src/sys/afssyscalls.h index e25906386..2b0bb1256 100644 --- a/src/sys/afssyscalls.h +++ b/src/sys/afssyscalls.h @@ -15,22 +15,22 @@ /* Declare Inode type. */ #include #ifdef AFS_NAMEI_ENV - #include - #if AFS_64BIT_ENV - typedef afs_uint64 Inode; - #else - typedef u_int64_t Inode; - #endif +#include +#if AFS_64BIT_ENV +typedef afs_uint64 Inode; +#else +typedef u_int64_t Inode; +#endif #else /* AFS_NAMEI_ENV */ - #ifdef AFS_64BIT_IOPS_ENV - #ifdef AFS_SGI62_ENV - typedef uint64_t Inode; - #else - error Need 64 bit Inode defined. - #endif /* AFS_SGI62_ENV */ - #else /* AFS_64BIT_IOPS_ENV */ - typedef unsigned int Inode; - #endif +#ifdef AFS_64BIT_IOPS_ENV +#ifdef AFS_SGI62_ENV +typedef uint64_t Inode; +#else +error Need 64 bit Inode defined. +#endif /* AFS_SGI62_ENV */ +#else /* AFS_64BIT_IOPS_ENV */ +typedef unsigned int Inode; +#endif #ifdef AFS_DEBUG_IOPS extern FILE *inode_debug_log; diff --git a/src/venus/fs.c b/src/venus/fs.c index 85ef76933..23092cb7a 100644 --- a/src/venus/fs.c +++ b/src/venus/fs.c @@ -49,7 +49,6 @@ RCSID("$Header$"); #include #include #include -#include #include #include #include diff --git a/src/venus/livesys.c b/src/venus/livesys.c index cb40759df..69912cd3a 100644 --- a/src/venus/livesys.c +++ b/src/venus/livesys.c @@ -34,7 +34,6 @@ RCSID("$Header$"); #ifdef AFS_AIX32_ENV #include #endif -#include #define MAXSIZE 2048 static char space[MAXSIZE]; diff --git a/src/vlserver/cnvldb.c b/src/vlserver/cnvldb.c index 4f0a61803..4ee584d04 100644 --- a/src/vlserver/cnvldb.c +++ b/src/vlserver/cnvldb.c @@ -34,7 +34,6 @@ RCSID("$Header$"); #include #include "vlserver.h" -#include #define MAXSIZE 2048 /* most I'll get back from PIOCTL */ #define BADSERVERID 255 /* XXX */ -- 2.39.5