More OpenBSD merge.
Most of this is just cleanup, not OpenBSD specific.
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;
}
}
/* dont copy more than we have room for */
if (fidIndex >= nentries) {
- DRelease((char *) dirEntryp, 0);
+ DRelease((struct buffer *) dirEntryp, 0);
break;
}
* 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 */
}
/* 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 */
}
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
#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 */
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);
*/
code = EINVAL;
}
- if (ode) DRelease(ode, 0);
+ if (ode) DRelease((struct buffer *) ode, 0);
goto dirend;
}
#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);
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];
AFS_STATCNT(afs_ustrategy);
{
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,
afs_int32 error;
struct uio tuio;
struct iovec *tvec; /* again, should have define */
- char *tfile;
register afs_int32 code;
struct vrequest treq;
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);
* 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);
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);
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) {
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;
char *tbuffer, *ve;
struct conn *tconn;
struct vrequest treq;
- XSTATS_DECLS;
if (strlen(aname) > VL_MAXNAMELEN) /* Invalid volume name */
return NULL;
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);