From: Tom Maher Date: Fri, 29 Jun 2001 04:20:01 +0000 (+0000) Subject: update-freebsd-support-20010628 X-Git-Tag: openafs-stable-1_1_0~76 X-Git-Url: http://git.openafs.org/?p=openafs.git;a=commitdiff_plain;h=a7014d420832a11d8eb73c774336dd49ce9494b1 update-freebsd-support-20010628 fileserver now set up for namei interface. still no client --- diff --git a/configure.in b/configure.in index 25d6aff..d0fd20c 100644 --- a/configure.in +++ b/configure.in @@ -94,6 +94,10 @@ case $system in MKAFS_OSTYPE=DARWIN AC_MSG_RESULT(ppc_darwin) ;; + *-freebsd*) + MKAFS_OSTYPE=FBSD + AC_MSG_RESULT(i386_fbsd) + ;; *) AC_MSG_RESULT($system) ;; diff --git a/src/afs/afs_call.c b/src/afs/afs_call.c index ef33045..0b70b19 100644 --- a/src/afs/afs_call.c +++ b/src/afs/afs_call.c @@ -56,6 +56,8 @@ long afs_global_owner; simple_lock_data_t afs_global_lock; #elif defined(AFS_DARWIN_ENV) struct lock__bsd__ afs_global_lock; +#elif defined(AFS_FBSD_ENV) +struct simplelock afs_global_lock; #endif #if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) thread_t afs_global_owner; @@ -132,7 +134,7 @@ long parm, parm2, parm3, parm4, parm5, parm6; if (!afs_suser() && (parm != AFSOP_GETMTU) && (parm != AFSOP_GETMASK)) { /* only root can run this code */ -#if !defined(AFS_SGI_ENV) && !defined(AFS_OSF_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN_ENV) +#if !defined(AFS_SGI_ENV) && !defined(AFS_OSF_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV) setuerror(EACCES); return(EACCES); #else @@ -202,7 +204,7 @@ long parm, parm2, parm3, parm4, parm5, parm6; while (afs_initState < AFSOP_START_AFS) afs_osi_Sleep(&afs_initState); -#if defined(AFS_SUN_ENV) || defined(AFS_SGI_ENV) || defined(AFS_HPUX_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV) +#if defined(AFS_SUN_ENV) || defined(AFS_SGI_ENV) || defined(AFS_HPUX_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) temp = AFS_MINBUFFERS; /* Should fix this soon */ #else temp = ((afs_bufferpages * NBPG)>>11); /* number of 2k buffers we could get from all of the buffer space */ @@ -291,7 +293,7 @@ long parm, parm2, parm3, parm4, parm5, parm6; struct afsop_cell tcell; char *tbuffer = osi_AllocSmallSpace(AFS_SMALLOCSIZ), *lcnamep = 0; char *tbuffer1 = osi_AllocSmallSpace(AFS_SMALLOCSIZ), *cnamep = 0; -#if defined(AFS_SGI61_ENV) || defined(AFS_SUN57_ENV) || defined(AFS_DARWIN_ENV) +#if defined(AFS_SGI61_ENV) || defined(AFS_SUN57_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) size_t bufferSize; #else /* AFS_SGI61_ENV */ u_int bufferSize; @@ -329,7 +331,7 @@ long parm, parm2, parm3, parm4, parm5, parm6; while (afs_initState < AFSOP_START_BKG) afs_osi_Sleep(&afs_initState); AFS_COPYIN((char *)parm2, (caddr_t) &cparms, sizeof(cparms), code); if (code) { -#if defined(AFS_SUN5_ENV) || defined(AFS_OSF_ENV) || defined (AFS_SGI64_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV) +#if defined(AFS_SUN5_ENV) || defined(AFS_OSF_ENV) || defined (AFS_SGI64_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) goto out; #else setuerror(code); @@ -375,7 +377,7 @@ long parm, parm2, parm3, parm4, parm5, parm6; code = afs_InitCacheFile((char *) 0, ainode); } else if (parm == AFSOP_ROOTVOLUME) { -#if defined(AFS_SGI61_ENV) || defined(AFS_SUN57_ENV) || defined(AFS_DARWIN_ENV) +#if defined(AFS_SGI61_ENV) || defined(AFS_SUN57_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) size_t bufferSize; #else /* AFS_SGI61_ENV */ u_int bufferSize; @@ -393,7 +395,7 @@ long parm, parm2, parm3, parm4, parm5, parm6; else if (parm == AFSOP_CACHEFILE || parm == AFSOP_CACHEINFO || parm == AFSOP_VOLUMEINFO || parm == AFSOP_AFSLOG) { char *tbuffer = osi_AllocSmallSpace(AFS_SMALLOCSIZ); -#if defined(AFS_SGI61_ENV) || defined(AFS_SUN57_ENV) || defined(AFS_DARWIN_ENV) +#if defined(AFS_SGI61_ENV) || defined(AFS_SUN57_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) size_t bufferSize; #else /* AFS_SGI61_ENV */ u_int bufferSize; @@ -501,7 +503,7 @@ long parm, parm2, parm3, parm4, parm5, parm6; #endif /* AFS_SGI62_ENV && !AFS_SGI65_ENV */ #endif /* AFS_SGI53_ENV */ else if (parm == AFSOP_SHUTDOWN) { -#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) +#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) extern struct mount *afs_globalVFS; #else /* AFS_OSF_ENV */ extern struct vfs *afs_globalVFS; @@ -524,7 +526,7 @@ long parm, parm2, parm3, parm4, parm5, parm6; afs_vfs_mount(parm2, parm3, parm4, parm5); #endif /* AFS_HPUX100_ENV */ #else /* defined(AFS_HPUX_ENV) */ -#if defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_OSF_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV) +#if defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_OSF_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) code = EINVAL; #else setuerror(EINVAL); @@ -893,7 +895,7 @@ Afs_syscall (uap, rvp) { int *retval = &rvp->r_val1; #else /* AFS_SUN5_ENV */ -#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) +#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) afs3_syscall(p, args, retval) struct proc *p; void *args; @@ -1031,7 +1033,7 @@ Afs_syscall () mutex_exit(&procp->p_crlock); #else AFS_GLOCK(); -#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) +#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) code = afs_setpag(p, args, retval); #else /* AFS_OSF_ENV */ code = afs_setpag(); @@ -1043,7 +1045,7 @@ Afs_syscall () #ifdef AFS_SUN5_ENV code = afs_syscall_pioctl(uap->parm1, uap->parm2, uap->parm3, uap->parm4, rvp, CRED()); #else -#ifdef AFS_DARWIN_ENV +#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) code = afs_syscall_pioctl(uap->parm1, uap->parm2, uap->parm3, uap->parm4, p->p_cred->pc_ucred); #else code = afs_syscall_pioctl(uap->parm1, uap->parm2, uap->parm3, uap->parm4); @@ -1055,7 +1057,7 @@ Afs_syscall () code = copyin_iparam((char *)uap->parm3, &iparams); if (code) { -#if !defined(AFS_SUN5_ENV) && !defined(AFS_OSF_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN_ENV) +#if !defined(AFS_SUN5_ENV) && !defined(AFS_OSF_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV) setuerror(code); #endif } else @@ -1064,7 +1066,7 @@ Afs_syscall () iparams.param3, iparams.param4, rvp, CRED()); #else code = afs_syscall_icreate(uap->parm1, uap->parm2, iparams.param1, iparams.param2, -#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) +#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) iparams.param3, iparams.param4, retval); #else iparams.param3, iparams.param4); @@ -1074,7 +1076,7 @@ Afs_syscall () #ifdef AFS_SUN5_ENV code = afs_syscall_iopen(uap->parm1, uap->parm2, uap->parm3, rvp, CRED()); #else -#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) +#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) code = afs_syscall_iopen(uap->parm1, uap->parm2, uap->parm3, retval); #else code = afs_syscall_iopen(uap->parm1, uap->parm2, uap->parm3); @@ -1103,13 +1105,13 @@ Afs_syscall () } #else if (code) { -#if !defined(AFS_SUN5_ENV) && !defined(AFS_OSF_ENV) && !defined(AFS_DARWIN_ENV) +#if !defined(AFS_SUN5_ENV) && !defined(AFS_OSF_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV) setuerror(code); #endif } #endif /* !AFS_LINUX20_ENV */ } else { -#if defined(AFS_SUN5_ENV) || defined(AFS_OSF_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV) +#if defined(AFS_SUN5_ENV) || defined(AFS_OSF_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) code = EINVAL; #else setuerror(EINVAL); @@ -1301,7 +1303,7 @@ Afscall_icl(long opcode, long p1, long p2, long p3, long p4, long *retval) register afs_int32 code; struct afs_icl_log *logp; struct afs_icl_set *setp; -#if defined(AFS_SGI61_ENV) || defined(AFS_SUN57_ENV) || defined(AFS_DARWIN_ENV) +#if defined(AFS_SGI61_ENV) || defined(AFS_SUN57_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) size_t temp; #else /* AFS_SGI61_ENV */ afs_uint32 temp; @@ -1317,7 +1319,7 @@ Afscall_icl(long opcode, long p1, long p2, long p3, long p4, long *retval) } #else if (!afs_suser()) { /* only root can run this code */ -#if !defined(AFS_SGI_ENV) && !defined(AFS_OSF_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN_ENV) +#if !defined(AFS_SGI_ENV) && !defined(AFS_OSF_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV) setuerror(EACCES); return EACCES; #else diff --git a/src/afs/afs_pioctl.c b/src/afs/afs_pioctl.c index 9d3b466..82c33ad 100644 --- a/src/afs/afs_pioctl.c +++ b/src/afs/afs_pioctl.c @@ -381,7 +381,7 @@ afs_xioctl (p, args, retval) caddr_t arg; } *uap = (struct a *)args; #else /* AFS_OSF_ENV */ -#ifdef AFS_DARWIN_ENV +#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) struct ioctl_args { int fd; u_long com; @@ -411,12 +411,12 @@ afs_xioctl () caddr_t arg; } *uap = (struct a *)u.u_ap; #endif /* AFS_LINUX22_ENV */ -#endif /* AFS_DARWIN_ENV */ +#endif /* AFS_DARWIN_ENV || AFS_FBSD_ENV */ #endif /* AFS_OSF_ENV */ #endif /* AFS_SUN5_ENV */ #endif #ifndef AFS_LINUX22_ENV -#if defined(AFS_AIX32_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) +#if defined(AFS_AIX32_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) struct file *fd; #else register struct file *fd; @@ -426,7 +426,7 @@ afs_xioctl () register int ioctlDone = 0, code = 0; AFS_STATCNT(afs_xioctl); -#ifdef AFS_DARWIN_ENV +#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) if ((code=fdgetf(p, uap->fd, &fd))) return code; #else @@ -502,7 +502,7 @@ afs_xioctl () if (code) { osi_FreeSmallSpace(datap); AFS_GUNLOCK(); -#ifdef AFS_DARWIN_ENV +#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) return code; #else #if defined(AFS_SUN5_ENV) @@ -575,7 +575,7 @@ afs_xioctl () #endif code = ioctl(uap, rvp); #else -#if defined(AFS_DARWIN_ENV) +#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) return ioctl(p, uap, retval); #else #ifdef AFS_OSF_ENV @@ -608,7 +608,7 @@ afs_xioctl () #ifdef AFS_LINUX22_ENV return -code; #else -#if !defined(AFS_OSF_ENV) && !defined(AFS_DARWIN_ENV) +#if !defined(AFS_OSF_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV) if (!getuerror()) setuerror(code); #if defined(AFS_AIX32_ENV) && !defined(AFS_AIX41_ENV) @@ -619,7 +619,7 @@ afs_xioctl () #endif #endif /* AFS_LINUX22_ENV */ #endif /* AFS_SUN5_ENV */ -#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) +#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) return (code); #endif } @@ -671,7 +671,7 @@ afs_pioctl(p, args, retval) extern struct mount *afs_globalVFS; #else /* AFS_OSF_ENV */ -#ifdef AFS_DARWIN_ENV +#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) afs_pioctl(p, args, retval) struct proc *p; void *args; @@ -706,7 +706,7 @@ afs_syscall_pioctl(path, com, cmarg, follow, rvp, credp) rval_t *rvp; struct AFS_UCRED *credp; #else -#ifdef AFS_DARWIN_ENV +#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) afs_syscall_pioctl(path, com, cmarg, follow, credp) struct AFS_UCRED *credp; #else @@ -737,7 +737,7 @@ afs_syscall_pioctl(path, com, cmarg, follow) #ifndef AFS_SUN5_ENV if (! _VALIDVICEIOCTL(com)) { PIOCTL_FREE_CRED(); -#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) +#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) return EINVAL; #else /* AFS_OSF_ENV */ #if defined(AFS_SGI64_ENV) || defined(AFS_LINUX22_ENV) @@ -752,7 +752,7 @@ afs_syscall_pioctl(path, com, cmarg, follow) code = copyin_afs_ioctl(cmarg, &data); if (code) { PIOCTL_FREE_CRED(); -#if defined(AFS_SUN5_ENV) || defined(AFS_OSF_ENV) || defined(AFS_SGI64_ENV) || defined(AFS_LINUX22_ENV) || defined(AFS_DARWIN_ENV) +#if defined(AFS_SUN5_ENV) || defined(AFS_OSF_ENV) || defined(AFS_SGI64_ENV) || defined(AFS_LINUX22_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) return (code); #else setuerror(code); @@ -760,7 +760,7 @@ afs_syscall_pioctl(path, com, cmarg, follow) #endif } if ((com & 0xff) == PSetClientContext) { -#if defined(AFS_LINUX22_ENV) || defined(AFS_DARWIN_ENV) +#if defined(AFS_LINUX22_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) return EINVAL; /* Not handling these yet. */ #else #if defined(AFS_SUN5_ENV) || defined(AFS_AIX41_ENV) || defined(AFS_LINUX22_ENV) @@ -782,14 +782,14 @@ afs_syscall_pioctl(path, com, cmarg, follow) crfree(foreigncreds); } PIOCTL_FREE_CRED(); -#if defined(AFS_SUN5_ENV) || defined(AFS_OSF_ENV) || defined(AFS_SGI64_ENV) || defined(AFS_LINUX22_ENV) || defined(AFS_DARWIN_ENV) +#if defined(AFS_SUN5_ENV) || defined(AFS_OSF_ENV) || defined(AFS_SGI64_ENV) || defined(AFS_LINUX22_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) return (code); #else return (setuerror(code), code); #endif } } -#if !defined(AFS_LINUX22_ENV) && !defined(AFS_DARWIN_ENV) +#if !defined(AFS_LINUX22_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV) if (foreigncreds) { /* * We could have done without temporary setting the u.u_cred below @@ -826,7 +826,7 @@ afs_syscall_pioctl(path, com, cmarg, follow) if ((com & 0xff) == 15) { /* special case prefetch so entire pathname eval occurs in helper process. otherwise, the pioctl call is essentially useless */ -#if defined(AFS_SUN5_ENV) || defined(AFS_AIX41_ENV) || defined(AFS_LINUX22_ENV) || defined(AFS_DARWIN_ENV) +#if defined(AFS_SUN5_ENV) || defined(AFS_AIX41_ENV) || defined(AFS_LINUX22_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) code = Prefetch(path, &data, follow, foreigncreds ? foreigncreds : credp); #else @@ -840,7 +840,7 @@ afs_syscall_pioctl(path, com, cmarg, follow) #endif /* AFS_SGI64_ENV */ #endif /* AFS_HPUX101_ENV */ #endif -#if !defined(AFS_LINUX22_ENV) && !defined(AFS_DARWIN_ENV) +#if !defined(AFS_LINUX22_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV) if (foreigncreds) { #ifdef AFS_AIX41_ENV crset(tmpcred); /* restore original credentials */ @@ -861,7 +861,7 @@ afs_syscall_pioctl(path, com, cmarg, follow) } #endif /* AFS_LINUX22_ENV */ PIOCTL_FREE_CRED(); -#if defined(AFS_SUN5_ENV) || defined(AFS_OSF_ENV) || defined(AFS_SGI64_ENV) || defined(AFS_LINUX22_ENV) || defined(AFS_DARWIN_ENV) +#if defined(AFS_SUN5_ENV) || defined(AFS_OSF_ENV) || defined(AFS_SGI64_ENV) || defined(AFS_LINUX22_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) return (code); #else return (setuerror(code), code); @@ -883,7 +883,7 @@ afs_syscall_pioctl(path, com, cmarg, follow) #endif /* AFS_AIX41_ENV */ AFS_GLOCK(); if (code) { -#if !defined(AFS_LINUX22_ENV) && !defined(AFS_DARWIN_ENV) +#if !defined(AFS_LINUX22_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV) if (foreigncreds) { #ifdef AFS_AIX41_ENV crset(tmpcred); /* restore original credentials */ @@ -904,7 +904,7 @@ afs_syscall_pioctl(path, com, cmarg, follow) } #endif /* AFS_LINUX22_ENV */ PIOCTL_FREE_CRED(); -#if defined(AFS_SUN5_ENV) || defined(AFS_OSF_ENV) || defined(AFS_SGI64_ENV) || defined(AFS_LINUX22_ENV) || defined(AFS_DARWIN_ENV) +#if defined(AFS_SUN5_ENV) || defined(AFS_OSF_ENV) || defined(AFS_SGI64_ENV) || defined(AFS_LINUX22_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) return (code); #else return(setuerror(code), code); @@ -959,7 +959,7 @@ afs_syscall_pioctl(path, com, cmarg, follow) code = afs_HandlePioctl(vp, com, &data, follow, &credp); } #else -#if defined(AFS_LINUX22_ENV) || defined(AFS_DARWIN_ENV) +#if defined(AFS_LINUX22_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) code = afs_HandlePioctl(vp, com, &data, follow, &credp); #else code = afs_HandlePioctl(vp, com, &data, follow, &u.u_cred); @@ -969,7 +969,7 @@ afs_syscall_pioctl(path, com, cmarg, follow) #endif /* AFS_AIX41_ENV */ #endif /* AFS_SUN5_ENV */ } else { -#if defined(AFS_SUN5_ENV) || defined(AFS_OSF_ENV) || defined(AFS_SGI64_ENV) || defined(AFS_LINUX22_ENV) || defined(AFS_DARWIN_ENV) +#if defined(AFS_SUN5_ENV) || defined(AFS_OSF_ENV) || defined(AFS_SGI64_ENV) || defined(AFS_LINUX22_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) code = EINVAL; /* not in /afs */ #else setuerror(EINVAL); @@ -982,7 +982,7 @@ afs_syscall_pioctl(path, com, cmarg, follow) #endif } -#if !defined(AFS_LINUX22_ENV) && !defined(AFS_DARWIN_ENV) +#if !defined(AFS_LINUX22_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV) if (foreigncreds) { #ifdef AFS_AIX41_ENV crset(tmpcred); @@ -1010,7 +1010,7 @@ afs_syscall_pioctl(path, com, cmarg, follow) #endif } PIOCTL_FREE_CRED(); -#if defined(AFS_SUN5_ENV) || defined(AFS_OSF_ENV) || defined(AFS_SGI64_ENV) || defined(AFS_LINUX22_ENV) || defined(AFS_DARWIN_ENV) +#if defined(AFS_SUN5_ENV) || defined(AFS_OSF_ENV) || defined(AFS_SGI64_ENV) || defined(AFS_LINUX22_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) return (code); #else if (!getuerror()) @@ -1421,7 +1421,7 @@ static PGCPAGs(avc, afun, areq, ain, aout, ainSize, aoutSize, acred) afs_PutCell(tcell, READ_LOCK); if (set_parent_pag) { int pag; -#ifdef AFS_DARWIN_ENV +#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) struct proc *p=current_proc(); /* XXX */ uprintf("Process %d (%s) tried to change pags in PSetTokens\n", p->p_pid, p->p_comm); @@ -2046,7 +2046,7 @@ struct AFS_UCRED *acred; { register char *tp; register afs_int32 code; -#if defined(AFS_SGI61_ENV) || defined(AFS_SUN57_ENV) || defined(AFS_DARWIN_ENV) +#if defined(AFS_SGI61_ENV) || defined(AFS_SUN57_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) size_t bufferSize; #else u_int bufferSize; @@ -2556,7 +2556,7 @@ struct AFS_UCRED *acred; #if defined(AFS_SGI_ENV) || defined(AFS_ALPHA_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_HPUX_ENV) VN_HOLD((struct vnode *)tvc); #else -#if defined(AFS_DARWIN_ENV) +#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) osi_vnhold(tvc, 0); #else tvc->vrefCount++; @@ -2708,7 +2708,7 @@ register struct AFS_UCRED *acred; AFS_STATCNT(PSetSysName); if (!afs_globalVFS) { /* Afsd is NOT running; disable it */ -#if defined(AFS_SUN5_ENV) || defined(AFS_OSF_ENV) || defined(AFS_SGI64_ENV) || defined(AFS_LINUX22_ENV) || defined(AFS_DARWIN_ENV) +#if defined(AFS_SUN5_ENV) || defined(AFS_OSF_ENV) || defined(AFS_SGI64_ENV) || defined(AFS_LINUX22_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) return (EINVAL); #else return (setuerror(EINVAL), EINVAL); diff --git a/src/config/param.i386_fbsd_42.h b/src/config/param.i386_fbsd_42.h index 217c58a..8053a8b 100644 --- a/src/config/param.i386_fbsd_42.h +++ b/src/config/param.i386_fbsd_42.h @@ -6,6 +6,8 @@ #define AFS_XBSD_ENV 1 /* {Free,Open,Net}BSD */ #define AFS_X86_XBSD_ENV 1 +#define AFS_NAMEI_ENV 1 /* User space interface to file system */ +#define AFS_64BIT_IOPS_ENV 1 /* Needed for NAMEI */ #define AFS_FBSD_ENV 1 #define AFS_FBSD40_ENV 1 #define AFS_FBSD42_ENV 1 @@ -14,7 +16,7 @@ #define AFS_X86_FBSD42_ENV 1 #define AFS_X86_ENV 1 #define AFS_NONFSTRANS 1 -#define AFS_KERBEROS_ENV +#define AFS_KERBEROS_ENV 1 #define O_SYNC O_FSYNC #define FTRUNC O_TRUNC @@ -35,14 +37,12 @@ #define AFS_VFSINCL_ENV 1 #define AFS_GREEDY43_ENV 1 #define AFS_ENV 1 -#define AFS_MINPHYS_ENV 1 -#define CMUSTD_ENV 1 #define AFS_SYSCALL 210 #define AFS_MOUNT_AFS "afs" #ifndef MOUNT_UFS -#define MOUNT_UFS 1 +#define MOUNT_UFS "ufs" #endif #ifndef MOUNT_AFS @@ -54,31 +54,10 @@ #define AFS_HAVE_FFS 1 /* Use system's ffs. */ #define AFS_HAVE_STATVFS 0 /* System doesn't supports statvfs */ -#define AFS_GCPAGS 1 /* if nonzero, garbage collect PAGs */ -#define AFS_3DISPARES 1 /* Utilize the 3 available disk inode spares */ -#define AFS_USE_GETTIMEOFDAY 1 /* use gettimeofday to implement rx clock */ +#define AFS_GCPAGS 0 /* if nonzero, garbage collect PAGs */ +#define AFS_USE_GETTIMEOFDAY 1 /* use gettimeofday to implement rx clock */ -#if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) -#include -#if BYTE_ORDER == BIG_ENDIAN -#define AFSBIG_ENDIAN 1 -#else -#if BYTE_ORDER == LITTLE_ENDIAN -#define AFSLITTLE_ENDIAN 1 -#else -#error machine/endian.h must define BYTE_ORDER! -#endif -#endif -#endif /* ! ASSEMBLER && ! __LANGUAGE_ASSEMBLY__ */ - -#define NEARINODE_HINT 1 /* hint to ufs module to scatter inodes on disk*/ -#define nearInodeHash(volid, hval) { \ - unsigned char* ts = (unsigned char*)&(volid);\ - for ((hval)=0; ts<(unsigned char*)&(volid)+sizeof(volid);ts++){\ - (hval) *= 173; \ - (hval) += *ts; \ - } \ - } +#define AFSLITTLE_ENDIAN 1 /* Extra kernel definitions (from kdefs file) */ #ifdef _KERNEL diff --git a/src/config/param.i386_fbsd_42_usr.h b/src/config/param.i386_fbsd_42_usr.h index 184418b..2ef5ec2 100644 --- a/src/config/param.i386_fbsd_42_usr.h +++ b/src/config/param.i386_fbsd_42_usr.h @@ -15,14 +15,13 @@ #define AFS_MOUNT_AFS "afs" /* The name of the filesystem type. */ #define AFS_SYSCALL 210 -#define AFS_64BIT_IOPS_ENV 1 -#define AFS_NAMEI_ENV 1 /* User space interface to file system */ +#define AFS_NAMEI_ENV 1 /* User space interface to file system */ +#define AFS_64BIT_IOPS_ENV 1 /* Needed for NAMEI */ #include #define AFS_USERSPACE_IP_ADDR 1 -#define RXK_LISTENER_ENV 1 -#define AFS_GCPAGS 0 /* if nonzero, garbage collect PAGs */ - +#define RXK_LISTENER_ENV 1 +#define AFS_GCPAGS 0 /* if nonzero, garbage collect PAGs */ /* Machine / Operating system information */ #define SYS_NAME "i386_fbsd_42" diff --git a/src/des/read_pssword.c b/src/des/read_pssword.c index 8eb307b..9cbe558 100644 --- a/src/des/read_pssword.c +++ b/src/des/read_pssword.c @@ -28,9 +28,6 @@ #ifdef AFS_SUN5_ENV #define BSD_COMP #endif -#if defined(AFS_FBSD_ENV) -#define USE_OLD_TTY -#endif #include #include #include @@ -60,7 +57,7 @@ static int intrupt; #endif static int intrupt; -#if defined(AFS_SGI_ENV) || defined (AFS_AIX_ENV) /*|| defined (AFS_HPUX_ENV) || defined(AFS_SUN5_ENV)*/ +#if defined(AFS_SGI_ENV) || defined (AFS_AIX_ENV) || defined(AFS_FBSD_ENV) /*|| defined (AFS_HPUX_ENV) || defined(AFS_SUN5_ENV)*/ #undef BSDUNIX #endif @@ -137,7 +134,7 @@ des_read_pw_string(s,maxa,prompt,verify) struct sigaction newsig, oldsig; struct termios save_ttyb, ttyb; #endif -#if defined(AFS_DARWIN_ENV) +#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) FILE *fi; #endif #if defined(AFS_SUN_ENV) && !defined(AFS_SUN5_ENV) @@ -308,7 +305,7 @@ lose: if (!ok) bzero(s, maxa); printf("\n"); -#ifdef AFS_HPUX_ENV +#if defined(AFS_HPUX_ENV) || defined(AFS_FBSD_ENV) /* * Restore the terminal to its previous characteristics. * Restore the old signal handler for SIGINT. diff --git a/src/viced/Makefile b/src/viced/Makefile index 203b5f5..2c5ac08 100644 --- a/src/viced/Makefile +++ b/src/viced/Makefile @@ -73,7 +73,7 @@ check_sysid: check_sysid.c fileserver: viced.o ${objects} ${headers} ${LIBS} set -x; \ case ${SYS_NAME} in \ - *linux*) \ + *linux* | *fbsd* ) \ ${CC} ${LDFLAGS} -o fileserver ${objects} \ ${auditlib} ${LIBS} ${XLIBS} ;; \ rs_aix*) \ diff --git a/src/vol/Makefile b/src/vol/Makefile index cabb14c..e3b264b 100644 --- a/src/vol/Makefile +++ b/src/vol/Makefile @@ -101,7 +101,7 @@ gi: ${DESTDIR}/lib/afs/libsys.a volinfo: vol-info.o physio.o ihandle.o case ${SYS_NAME} in \ - *linux*) \ + *linux* | *fbsd*) \ ${CC} ${CFLAGS} ${DBG} -o volinfo vol-info.o physio.o \ ihandle.o ${LIBS} ;; \ *) \ diff --git a/src/volser/Makefile b/src/volser/Makefile index 0810d24..629f427 100644 --- a/src/volser/Makefile +++ b/src/volser/Makefile @@ -102,7 +102,7 @@ volint.xdr.o: volint.xdr.c ${INTINCLS} volserver: $(SOBJS) $(LIBS) $(HACKS) case ${SYS_NAME} in \ - *linux*) \ + *linux* | *fbsd* ) \ ${CC} ${DBUG} -o volserver $(SOBJS) $(HACKS) \ ${LDFLAGS} $(LIBS) ${XLIBS} ;; \ *) \