From: Jim Rees Date: Mon, 14 Oct 2002 16:48:40 +0000 (+0000) Subject: openbsd-20021014 X-Git-Tag: openafs-devel-1_3_50~564 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=393fc0d046334b85e638f6db88bc0469367eb928;p=packages%2Fo%2Fopenafs.git openbsd-20021014 More OpenBSD merge. Most of this is just cleanup, not OpenBSD specific. --- diff --git a/src/afs/VNOPS/afs_vnop_lookup.c b/src/afs/VNOPS/afs_vnop_lookup.c index 956088502..5ecde68a6 100644 --- a/src/afs/VNOPS/afs_vnop_lookup.c +++ b/src/afs/VNOPS/afs_vnop_lookup.c @@ -408,41 +408,40 @@ int afs_ENameOK(register char *aname) int afs_getsysname(register struct vrequest *areq, register struct vcache *adp, register char *bufp) { - static char sysname[MAXSYSNAME]; register struct unixuser *au; register afs_int32 error; if (!afs_nfsexporter) { - strcpy(bufp, afs_sysname); - return 0; + strcpy(bufp, afs_sysname); + return 0; } AFS_STATCNT(getsysname); au = afs_GetUser(areq->uid, adp->fid.Cell, 0); afs_PutUser(au, 0); if (au->exporter) { - error = EXP_SYSNAME(au->exporter, NULL, bufp); - if (error) - strcpy(bufp, "@sys"); - return -1; + error = EXP_SYSNAME(au->exporter, NULL, bufp); + if (error) + strcpy(bufp, "@sys"); + return -1; } else { - strcpy(bufp, afs_sysname); - return 0; + strcpy(bufp, afs_sysname); + return 0; } } -int Check_AtSys(register struct vcache *avc, const char *aname, +void Check_AtSys(register struct vcache *avc, const char *aname, struct sysname_info *state, struct vrequest *areq) { if (AFS_EQ_ATSYS(aname)) { - state->offset = 0; - state->name = (char *) osi_AllocLargeSpace(AFS_SMALLOCSIZ); - state->allocked = 1; - state->index = afs_getsysname(areq, avc, state->name); + state->offset = 0; + state->name = (char *) osi_AllocLargeSpace(AFS_SMALLOCSIZ); + state->allocked = 1; + state->index = afs_getsysname(areq, avc, state->name); } else { - state->offset = -1; - state->allocked = 0; - state->index = 0; - state->name = aname; + state->offset = -1; + state->allocked = 0; + state->index = 0; + state->name = aname; } } @@ -647,7 +646,7 @@ tagain: /* dont copy more than we have room for */ if (fidIndex >= nentries) { - DRelease((char *) dirEntryp, 0); + DRelease((struct buffer *) dirEntryp, 0); break; } @@ -727,7 +726,7 @@ tagain: * used by this dir entry. */ temp = afs_dir_NameBlobs(dirEntryp->name) << 5; - DRelease((char *) dirEntryp, 0); + DRelease((struct buffer *) dirEntryp, 0); if (temp <= 0) break; dirCookie += temp; } /* while loop over all dir entries */ diff --git a/src/afs/VNOPS/afs_vnop_readdir.c b/src/afs/VNOPS/afs_vnop_readdir.c index a5d788923..c50bfb25b 100644 --- a/src/afs/VNOPS/afs_vnop_readdir.c +++ b/src/afs/VNOPS/afs_vnop_readdir.c @@ -96,7 +96,7 @@ int BlobScan(afs_int32 *afile, afs_int32 ablob) } /* now relativeBlob is the page-relative first allocated blob, or EPP (if there are none in this page). */ - DRelease(tpe, 0); + DRelease((struct buffer *) tpe, 0); if (i != EPP) return i+pageBlob; ablob = pageBlob + EPP; /* go around again */ } @@ -477,14 +477,14 @@ afs_readdir(OSI_VC_ARG(avc), auio, acred) struct vrequest treq; register struct dcache *tdc; afs_size_t origOffset, tlen; - afs_int32 len, dirsiz; + afs_int32 len; int code = 0; struct DirEntry *ode = 0, *nde = 0; int o_slen = 0, n_slen = 0; afs_uint32 us; struct afs_fakestat_state fakestate; #if defined(AFS_SGI53_ENV) - afs_int32 use64BitDirent; + afs_int32 use64BitDirent, dirsiz; #endif /* defined(AFS_SGI53_ENV) */ OSI_VC_CONVERT(avc) #ifdef AFS_HPUX_ENV @@ -659,7 +659,7 @@ tagain: #if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) || defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) if (eofp) *eofp = 1; /* Set it properly */ #endif - if (ode) DRelease(ode, 0); + if (ode) DRelease((struct buffer *) ode, 0); goto dirend; } /* by here nde is set */ @@ -678,7 +678,7 @@ tagain: if (DIRSIZ_LEN(n_slen) >= (auio->afsio_resid-len)) { #endif /* AFS_SGI53_ENV */ /* No can do no more now; ya know... at this time */ - DRelease (nde, 0); /* can't use this one. */ + DRelease ((struct buffer *) nde, 0); /* can't use this one. */ if (len) { #ifdef AFS_HPUX_ENV sdirEntry->d_fileno = (avc->fid.Fid.Volume << 16) + ntohl(ode->fid.vnode); @@ -720,7 +720,7 @@ tagain: */ code = EINVAL; } - if (ode) DRelease(ode, 0); + if (ode) DRelease((struct buffer *) ode, 0); goto dirend; } @@ -767,11 +767,11 @@ tagain: #else len = DIRSIZ_LEN( o_slen = n_slen ); #endif /* AFS_SGI53_ENV */ - if (ode) DRelease(ode, 0); + if (ode) DRelease((struct buffer *) ode, 0); ode = nde; auio->afsio_offset = (afs_int32)((us + afs_dir_NameBlobs(nde->name)) << 5); } - if (ode) DRelease(ode, 0); + if (ode) DRelease((struct buffer *) ode, 0); dirend: ReleaseReadLock(&tdc->lock); diff --git a/src/afs/VNOPS/afs_vnop_strategy.c b/src/afs/VNOPS/afs_vnop_strategy.c index feb601750..17d22b175 100644 --- a/src/afs/VNOPS/afs_vnop_strategy.c +++ b/src/afs/VNOPS/afs_vnop_strategy.c @@ -46,9 +46,6 @@ afs_ustrategy(abp) #else struct AFS_UCRED *credp = u.u_cred; #endif -#endif -#if defined(AFS_SUN_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) - int async = abp->b_flags & B_ASYNC; #endif struct iovec tiovec[1]; diff --git a/src/afs/VNOPS/afs_vnop_symlink.c b/src/afs/VNOPS/afs_vnop_symlink.c index 0f5014360..2580aae32 100644 --- a/src/afs/VNOPS/afs_vnop_symlink.c +++ b/src/afs/VNOPS/afs_vnop_symlink.c @@ -283,15 +283,15 @@ int afs_UFSHandleLink(register struct vcache *avc, struct vrequest *areq) { register struct dcache *tdc; register char *tp, *rbuf; - char *tfile; + void *tfile; afs_size_t offset, len; afs_int32 tlen, alen; register afs_int32 code; - /* two different formats, one for links protected 644, have a "." at the end - of the file name, which we turn into a null. Others, protected 755, - we add a null to the end of */ - AFS_STATCNT(afs_UFSHandleLink); + /* two different formats, one for links protected 644, have a "." at the + end of the file name, which we turn into a null. Others, protected + 755, we add a null to the end of */ + AFS_STATCNT(afs_UFSHandleLink); if (!avc->linkData) { tdc = afs_GetDCache(avc, (afs_size_t) 0, areq, &offset, &len, 0); afs_Trace3(afs_iclSetp, CM_TRACE_UFSLINK, ICL_TYPE_POINTER, avc, diff --git a/src/afs/VNOPS/afs_vnop_write.c b/src/afs/VNOPS/afs_vnop_write.c index 31688c404..bd3321b7e 100644 --- a/src/afs/VNOPS/afs_vnop_write.c +++ b/src/afs/VNOPS/afs_vnop_write.c @@ -103,7 +103,6 @@ int afs_MemWrite(register struct vcache *avc, struct uio *auio, int aio, afs_int32 error; struct uio tuio; struct iovec *tvec; /* again, should have define */ - char *tfile; register afs_int32 code; struct vrequest treq; @@ -347,7 +346,6 @@ int afs_UFSWrite(register struct vcache *avc, struct uio *auio, struct iovec *tvec; /* again, should have define */ struct osi_file *tfile; register afs_int32 code; - struct vnode *vp; struct vrequest treq; AFS_STATCNT(afs_UFSWrite); @@ -419,7 +417,7 @@ int afs_UFSWrite(register struct vcache *avc, struct uio *auio, * high-level write op. */ if (avc->execsOrWriters <= 0) { - printf("WARNING: afs_ufswr vp=%x, exOrW=%d\n", avc, avc->execsOrWriters); + printf("WARNING: afs_ufswr vcp=%x, exOrW=%d\n", avc, avc->execsOrWriters); } #else afs_FakeOpen(avc); diff --git a/src/afs/afs_prototypes.h b/src/afs/afs_prototypes.h index 567e6572f..5a2ceca28 100644 --- a/src/afs/afs_prototypes.h +++ b/src/afs/afs_prototypes.h @@ -790,7 +790,7 @@ extern void afs_PutFakeStat(struct afs_fakestat_state *state); extern int afs_ENameOK(register char *aname); extern int afs_getsysname(register struct vrequest *areq, register struct vcache *adp, register char *bufp); -extern int Check_AtSys(register struct vcache *avc, const char *aname, +extern void Check_AtSys(register struct vcache *avc, const char *aname, struct sysname_info *state, struct vrequest *areq); extern int Next_AtSys(register struct vcache *avc, struct vrequest *areq, struct sysname_info *state); diff --git a/src/afs/afs_volume.c b/src/afs/afs_volume.c index 665187fc9..559576a33 100644 --- a/src/afs/afs_volume.c +++ b/src/afs/afs_volume.c @@ -179,10 +179,7 @@ struct volume *afs_UFSGetVolSlot(void) struct volume *afs_MemGetVolSlot(void) { - register struct volume *tv, **lv; - register afs_int32 i; - afs_int32 bestTime; - struct volume *bestVp, **bestLp; + register struct volume *tv; AFS_STATCNT(afs_MemGetVolSlot); if (!afs_freeVolList) { @@ -558,7 +555,7 @@ int lastnvcode; static struct volume *afs_NewVolumeByName(char *aname, afs_int32 acell, int agood, struct vrequest *areq, afs_int32 locktype) { - afs_int32 code, i, type=0; + afs_int32 code, type=0; struct volume *tv, *tv1; struct vldbentry *tve; struct nvldbentry *ntve; @@ -567,7 +564,6 @@ static struct volume *afs_NewVolumeByName(char *aname, afs_int32 acell, int agoo char *tbuffer, *ve; struct conn *tconn; struct vrequest treq; - XSTATS_DECLS; if (strlen(aname) > VL_MAXNAMELEN) /* Invalid volume name */ return NULL; @@ -843,14 +839,13 @@ void InstallNVolumeEntry(struct volume *av, struct nvldbentry *ve, int acell) void InstallUVolumeEntry(struct volume *av, struct uvldbentry *ve, int acell, struct cell *tcell, struct vrequest *areq) { - register struct srvAddr *sa; register struct server *ts; struct conn *tconn; struct cell *cellp; register int i, j; afs_uint32 serverid; afs_int32 mask; - int hash, k; + int k; AFS_STATCNT(InstallVolumeEntry);