From: Jim Rees Date: Wed, 2 Oct 2002 16:58:18 +0000 (+0000) Subject: openbsd31-cm-20021002 X-Git-Tag: openafs-devel-1_3_50~587 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=8bdd971cb7072541b144052ee767bd4e4b43b3c2;p=packages%2Fo%2Fopenafs.git openbsd31-cm-20021002 OpenBSD 3.1 changes for the cache manager eliminate some unused variables --- diff --git a/src/afs/afs_chunkops.h b/src/afs/afs_chunkops.h index fe33e2e55..4ee88760b 100644 --- a/src/afs/afs_chunkops.h +++ b/src/afs/afs_chunkops.h @@ -64,10 +64,14 @@ */ struct afs_cacheOps { +#if defined(AFS_SUN57_64BIT_ENV) || defined(AFS_SGI62_ENV) + void *(*open)(ino_t ainode); +#else void *(*open)(afs_int32 ainode); - int (*truncate)(struct osi_file *fp, int len); - int (*fread)(struct osi_file *fp, int offset, char *buf, int len); - int (*fwrite)(struct osi_file *fp, int offset, char *buf, int len); +#endif + int (*truncate)(struct osi_file *fp, afs_int32 len); + int (*fread)(struct osi_file *fp, int offset, void *buf, afs_int32 len); + int (*fwrite)(struct osi_file *fp, afs_int32 offset, void *buf, afs_int32 len); int (*close)(struct osi_file *fp); int (*vread)(register struct vcache *avc, struct uio *auio, struct AFS_UCRED *acred, daddr_t albn, struct buf **abpp, int noLock); diff --git a/src/afs/afs_init.c b/src/afs/afs_init.c index 01e3d9d90..0a9c49970 100644 --- a/src/afs/afs_init.c +++ b/src/afs/afs_init.c @@ -80,7 +80,6 @@ int afs_CacheInit(afs_int32 astatSize, afs_int32 afiles, afs_int32 { register afs_int32 i, preallocs; register struct volume *tv; - long code; AFS_STATCNT(afs_CacheInit); /* @@ -266,7 +265,6 @@ int afs_InitVolumeInfo(char *afile) { int code; struct osi_file *tfile; - struct vnode *filevp; AFS_STATCNT(afs_InitVolumeInfo); code = LookupInodeByPath(afile, &volumeInode); @@ -370,7 +368,7 @@ int afs_InitCacheInfo(register char *afile) #if defined(AFS_DARWIN_ENV) if (!VFS_STATFS(filevp->v_mount, &st, current_proc())) #else -#if defined(AFS_FBSD_ENV) +#if defined(AFS_XBSD_ENV) if (!VFS_STATFS(filevp->v_mount, &st, curproc)) #else if (!VFS_STATFS(filevp->v_vfsp, &st)) @@ -613,9 +611,6 @@ static void afs_procsize_init(void) */ void shutdown_cache(void) { - register struct afs_cbr *tsp, *nsp; - int i; - AFS_STATCNT(shutdown_cache); afs_WriteThroughDSlots(); if (afs_cold_shutdown) { @@ -726,7 +721,6 @@ void shutdown_AFS(void) struct server *ts, *nts; struct conn *tc, *ntc; register struct afs_cbr *tcbrp, *tbrp; - struct afs_cbr **lcbrpp; for (i=0; i < NSERVERS; i++) { for (ts = afs_servers[i]; ts; ts = nts) { diff --git a/src/afs/afs_osi.h b/src/afs/afs_osi.h index ed3cd01ae..1deeda78d 100644 --- a/src/afs/afs_osi.h +++ b/src/afs/afs_osi.h @@ -278,7 +278,7 @@ typedef struct timeval osi_timeval_t; AFS_GLOCK(); \ } while(0) -#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) +#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) #define AFS_UIOMOVE(SRC,LEN,RW,UIO,CODE) \ do { \ int haveGlock = ISAFS_GLOCK(); \ @@ -318,7 +318,7 @@ typedef struct timeval osi_timeval_t; CODE = copyout((SRC),(DST),(LEN)); \ } while(0) -#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) +#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) #define AFS_UIOMOVE(SRC,LEN,RW,UIO,CODE) \ do { \ (UIO)->uio_rw = (RW); \ diff --git a/src/afs/afs_pioctl.c b/src/afs/afs_pioctl.c index a8320502f..b1132d7fb 100644 --- a/src/afs/afs_pioctl.c +++ b/src/afs/afs_pioctl.c @@ -815,11 +815,15 @@ afs_syscall_pioctl(path, com, cmarg, follow) #else #ifdef AFS_SGI_ENV code = HandleClientContext(&data, &com, &foreigncreds, OSI_GET_CURRENT_CRED()); +#else +#ifdef AFS_OBSD_ENV + code = HandleClientContext(&data, &com, &foreigncreds, osi_curcred()); #else code = HandleClientContext(&data, &com, &foreigncreds, u.u_cred); #endif /* AFS_SGI_ENV */ #endif #endif +#endif #endif if (code) { if (foreigncreds) { @@ -858,12 +862,17 @@ afs_syscall_pioctl(path, com, cmarg, follow) #ifdef AFS_SGI_ENV tmpcred = OSI_GET_CURRENT_CRED(); OSI_SET_CURRENT_CRED(foreigncreds); +#else +#ifdef AFS_OBSD_ENV + tmpcred = osi_curcred(); + osi_curcred() = foreigncreds; #else tmpcred = u.u_cred; u.u_cred = foreigncreds; #endif /* AFS_SGI64_ENV */ #endif /* AFS_HPUX101_ENV */ #endif +#endif #endif } #endif @@ -879,11 +888,15 @@ afs_syscall_pioctl(path, com, cmarg, follow) #else #ifdef AFS_SGI_ENV code = Prefetch(path, &data, follow, OSI_GET_CURRENT_CRED()); +#else +#ifdef AFS_OBSD_ENV + code = Prefetch(path, &data, follow, osi_curcred()); #else code = Prefetch(path, &data, follow, u.u_cred); #endif /* AFS_SGI64_ENV */ #endif /* AFS_HPUX101_ENV */ #endif +#endif #if !defined(AFS_LINUX22_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV) if (foreigncreds) { #ifdef AFS_AIX41_ENV diff --git a/src/afs/afs_server.c b/src/afs/afs_server.c index 2276433fb..c83ba2906 100644 --- a/src/afs/afs_server.c +++ b/src/afs/afs_server.c @@ -242,7 +242,6 @@ void afs_MarkServerUpOrDown(struct srvAddr *sa, int a_isDown) void afs_ServerDown(struct srvAddr *sa) { register struct server *aserver = sa->server; - register struct srvAddr *sap; AFS_STATCNT(ServerDown); if (aserver->flags & SRVR_ISDOWN || sa->sa_flags & SRVADDR_ISDOWN) @@ -1283,6 +1282,13 @@ static int afs_SetServerPrefs(struct srvAddr *sa) afsi_SetServerIPRank(sa, ifa); } } +#elif defined(AFS_OBSD_ENV) + { + extern struct in_ifaddrhead in_ifaddr; + struct in_ifaddr *ifa; + for (ifa = in_ifaddr.tqh_first; ifa; ifa = ifa->ia_list.tqe_next) + afsi_SetServerIPRank(sa, ifa); + } #else { struct in_ifaddr *ifa; @@ -1400,7 +1406,7 @@ struct server *afs_GetServer(afs_uint32 *aserverp, afs_int32 nservers, afs_int32 addr_uniquifier) { struct server *oldts=0, *ts, *newts, *orphts=0; - struct srvAddr *oldsa, *sa, *newsa, *nextsa, *orphsa; + struct srvAddr *oldsa, *newsa, *nextsa, *orphsa; u_short fsport; afs_int32 iphash, k, srvcount=0; unsigned int srvhash; diff --git a/src/afs/sysincludes.h b/src/afs/sysincludes.h index 3f925a61a..043c76d13 100644 --- a/src/afs/sysincludes.h +++ b/src/afs/sysincludes.h @@ -36,11 +36,12 @@ #include #include #include +#include #include #include #include #include -#include +#include #include #else /* AFS_OBSD_ENV */ #ifdef AFS_LINUX22_ENV