diff --git a/src/afs/FBSD/osi_inode.h b/src/afs/FBSD/osi_inode.h index d63526c953..8a9dd84fee 100644 --- a/src/afs/FBSD/osi_inode.h +++ b/src/afs/FBSD/osi_inode.h @@ -10,7 +10,7 @@ /* * osi_inode.h * - * Inode information required for DUX servers and salvager. + * Inode information required for FreeBSD servers and salvager. */ #ifndef _OSI_INODE_H_ #define _OSI_INODE_H_ diff --git a/src/afs/NBSD/osi_inode.h b/src/afs/NBSD/osi_inode.h index d63526c953..536ea0b09f 100644 --- a/src/afs/NBSD/osi_inode.h +++ b/src/afs/NBSD/osi_inode.h @@ -10,7 +10,7 @@ /* * osi_inode.h * - * Inode information required for DUX servers and salvager. + * Inode information required for NetBSD servers and salvager. */ #ifndef _OSI_INODE_H_ #define _OSI_INODE_H_ diff --git a/src/afs/NBSD/osi_machdep.h b/src/afs/NBSD/osi_machdep.h index 1a8fc7f144..91e98bc7ff 100644 --- a/src/afs/NBSD/osi_machdep.h +++ b/src/afs/NBSD/osi_machdep.h @@ -9,7 +9,7 @@ /* * - * DUX OSI header file. Extends afs_osi.h. + * NetBSD OSI header file. Extends afs_osi.h. * * afs_osi.h includes this file, which is the only way this file should * be included in a source file. This file can redefine macros declared in diff --git a/src/afs/NBSD/osi_vfsops.c b/src/afs/NBSD/osi_vfsops.c index 15211635e8..361d6e3bb1 100644 --- a/src/afs/NBSD/osi_vfsops.c +++ b/src/afs/NBSD/osi_vfsops.c @@ -8,7 +8,7 @@ */ /* - * osi_vfsops.c for DUX + * osi_vfsops.c for NetBSD */ #include #include "afs/param.h" diff --git a/src/afs/UKERNEL/sysincludes.h b/src/afs/UKERNEL/sysincludes.h index bb44e818f9..dc90170250 100644 --- a/src/afs/UKERNEL/sysincludes.h +++ b/src/afs/UKERNEL/sysincludes.h @@ -1352,7 +1352,7 @@ extern long V; #endif /* UKERNEL */ struct min_direct { -#if defined(AFS_OFS_ENV) || defined(AFS_USR_OSF_ENV) +#if defined(AFS_USR_OSF_ENV) unsigned int d_fileno; #else /* AFS_OFS_ENV || AFS_USR_OSF_ENV */ unsigned long d_fileno; diff --git a/src/afs/VNOPS/afs_vnop_access.c b/src/afs/VNOPS/afs_vnop_access.c index 8e33d3657f..0a31ac8d1b 100644 --- a/src/afs/VNOPS/afs_vnop_access.c +++ b/src/afs/VNOPS/afs_vnop_access.c @@ -295,18 +295,6 @@ afs_access(OSI_VC_DECL(avc), register afs_int32 amode, if (amode & VEXEC) { code = afs_AccessOK(avc, PRSFS_READ, &treq, CHECK_MODE_BITS); if (code) { -#ifdef AFS_OSF_ENV - /* - * The nfs server in read operations for non-owner of a file - * will also check the access with the VEXEC (along with VREAD) - * because for them exec is the same as read over the net because of - * demand loading. But this means if the mode bit is '-rw' the call - * will fail below; so for this particular case where both modes are - * specified (only in rfs_read so far) and from the xlator requests - * we return succes. - */ - if (!((amode & VREAD) && AFS_NFSXLATORREQ(acred))) -#endif if ((avc->f.m.Mode & 0100) == 0) code = 0; } else if (avc->f.m.Mode & 0100) diff --git a/src/afs/VNOPS/afs_vnop_attrs.c b/src/afs/VNOPS/afs_vnop_attrs.c index beb2a34055..fe3ed77952 100644 --- a/src/afs/VNOPS/afs_vnop_attrs.c +++ b/src/afs/VNOPS/afs_vnop_attrs.c @@ -90,8 +90,6 @@ afs_CopyOutAttrs(register struct vcache *avc, register struct vattr *attrs) attrs->va_gid = fakedir ? 0 : avc->f.m.Group; /* yeah! */ #if defined(AFS_SUN56_ENV) attrs->va_fsid = avc->v.v_vfsp->vfs_fsid.val[0]; -#elif defined(AFS_OSF_ENV) - attrs->va_fsid = avc->v.v_mount->m_stat.f_fsid.val[0]; #elif defined(AFS_DARWIN80_ENV) VATTR_RETURN(attrs, va_fsid, vfs_statfs(vnode_mount(AFSTOV(avc)))->f_fsid.val[0]); #elif defined(AFS_DARWIN70_ENV) @@ -142,7 +140,7 @@ afs_CopyOutAttrs(register struct vcache *avc, register struct vattr *attrs) attrs->va_atime.tv_usec = attrs->va_mtime.tv_usec = attrs->va_ctime.tv_usec = (hgetlo(avc->f.m.DataVersion) & 0x7ffff); #endif -#if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) || defined(AFS_OSF_ENV) +#if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) attrs->va_flags = 0; #endif #if defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV) @@ -160,7 +158,7 @@ afs_CopyOutAttrs(register struct vcache *avc, register struct vattr *attrs) * Below return 0 (and not 1) blocks if the file is zero length. This conforms * better with the other filesystems that do return 0. */ -#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) +#if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) attrs->va_bytes = (attrs->va_size ? (attrs->va_size + 1023) : 1024); #ifdef va_bytes_rsv attrs->va_bytes_rsv = -1; @@ -494,7 +492,7 @@ afs_setattr(OSI_VC_DECL(avc), register struct vattr *attrs, if (attrs->va_mask & ATTR_SIZE) { #elif defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) if (attrs->va_mask & AT_SIZE) { -#elif defined(AFS_OSF_ENV) || defined(AFS_XBSD_ENV) +#elif defined(AFS_XBSD_ENV) if (attrs->va_size != VNOVAL) { #elif defined(AFS_AIX41_ENV) if (attrs->va_size != -1) { @@ -532,7 +530,7 @@ afs_setattr(OSI_VC_DECL(avc), register struct vattr *attrs, if (attrs->va_mask & ATTR_SIZE) { #elif defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) if (attrs->va_mask & AT_SIZE) { -#elif defined(AFS_OSF_ENV) || defined(AFS_XBSD_ENV) +#elif defined(AFS_XBSD_ENV) if (attrs->va_size != VNOVAL) { #elif defined(AFS_AIX41_ENV) if (attrs->va_size != -1) { diff --git a/src/afs/VNOPS/afs_vnop_create.c b/src/afs/VNOPS/afs_vnop_create.c index d401818768..9f7815706b 100644 --- a/src/afs/VNOPS/afs_vnop_create.c +++ b/src/afs/VNOPS/afs_vnop_create.c @@ -330,22 +330,18 @@ afs_create(OSI_VC_DECL(adp), char *aname, struct vattr *attrs, afs_PutDCache(tdc); } ReleaseWriteLock(&adp->lock); -#if !(defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV)) -#if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) + + #if defined(AFS_SGI64_ENV) code = afs_lookup(VNODE_TO_FIRST_BHV((vnode_t *) adp), aname, avcp, NULL, 0, NULL, acred); -#else +#elif defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) code = afs_lookup(adp, aname, avcp, NULL, 0, NULL, acred); -#endif /* AFS_SGI64_ENV */ -#else /* SUN5 || SGI */ -#if defined(UKERNEL) +#elif defined(UKERNEL) code = afs_lookup(adp, aname, avcp, acred, 0); -#else /* UKERNEL */ +#elif !defined(AFS_DARWIN_ENV) code = afs_lookup(adp, aname, avcp, acred); -#endif /* UKERNEL */ -#endif /* SUN5 || SGI */ -#endif /* !(AFS_OSF_ENV || AFS_DARWIN_ENV) */ +#endif goto done; } @@ -497,10 +493,6 @@ afs_create(OSI_VC_DECL(adp), char *aname, struct vattr *attrs, /* return the new status in vattr */ afs_CopyOutAttrs(*avcp, attrs); } -#ifdef AFS_OSF_ENV - if (!code && !strcmp(aname, "core")) - tvc->f.states |= CCore1; -#endif afs_PutFakeStat(&fakestate); code = afs_CheckCode(code, &treq, 20); diff --git a/src/afs/VNOPS/afs_vnop_fid.c b/src/afs/VNOPS/afs_vnop_fid.c index 148d614b65..69ead8d15f 100644 --- a/src/afs/VNOPS/afs_vnop_fid.c +++ b/src/afs/VNOPS/afs_vnop_fid.c @@ -11,14 +11,13 @@ * Implements: * afs_fid * - * afs_vptofh (DUX) is now in DUX/osi_vfsops.c */ #include #include "afs/param.h" -#if !defined(AFS_DUX40_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_OBSD_ENV) +#if !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_OBSD_ENV) #include "afs/sysincludes.h" /* Standard vendor system headers */ #include "afsincludes.h" /* Afs-based standard headers */ #include "afs/afs_stats.h" /* statistics */ @@ -69,7 +68,7 @@ extern int afs_NFSRootOnly; /* 1 => only allow NFS mounts of /afs. */ int #ifdef AFS_AIX41_ENV afs_fid(OSI_VC_DECL(avc), struct fid *fidpp, struct ucred *credp) -#elif defined(AFS_OSF_ENV) || defined(AFS_SUN54_ENV) +#elif defined(AFS_SUN54_ENV) afs_fid(OSI_VC_DECL(avc), struct fid *fidpp) #else afs_fid(OSI_VC_DECL(avc), struct fid **fidpp) @@ -154,4 +153,4 @@ afs_fid(OSI_VC_DECL(avc), struct fid **fidpp) #endif -#endif /* !AFS_DUX40_ENV && !AFS_LINUX20_ENV */ +#endif /* !AFS_LINUX20_ENV */ diff --git a/src/afs/VNOPS/afs_vnop_flock.c b/src/afs/VNOPS/afs_vnop_flock.c index 1d6793f756..6f4cf62dea 100644 --- a/src/afs/VNOPS/afs_vnop_flock.c +++ b/src/afs/VNOPS/afs_vnop_flock.c @@ -122,7 +122,7 @@ lockIdSet(struct AFS_FLOCK *flock, struct SimpleLocks *slp, int clid) flock->l_pid = procp->p_epid; # endif } -#elif defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) +#elif defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) void lockIdSet(struct AFS_FLOCK *flock, struct SimpleLocks *slp, int clid) { @@ -508,10 +508,7 @@ DoLockWarning(void) } -#ifdef AFS_OSF_ENV -int afs_lockctl(struct vcache * avc, struct eflock * af, int flag, - afs_ucred_t * acred, pid_t clid, off_t offset) -#elif defined(AFS_SGI_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) +#if defined(AFS_SGI_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) int afs_lockctl(struct vcache * avc, struct AFS_FLOCK * af, int acmd, afs_ucred_t * acred, pid_t clid) #else @@ -522,9 +519,6 @@ int afs_lockctl(struct vcache * avc, struct AFS_FLOCK * af, int acmd, { struct vrequest treq; afs_int32 code; -#ifdef AFS_OSF_ENV - int acmd = 0; -#endif struct afs_fakestat_state fakestate; AFS_STATCNT(afs_lockctl); @@ -538,19 +532,6 @@ int afs_lockctl(struct vcache * avc, struct AFS_FLOCK * af, int acmd, if (code) { goto done; } -#ifdef AFS_OSF_ENV - if (flag & VNOFLCK) { - code = 0; - goto done; - } - if (flag & CLNFLCK) { - acmd = LOCK_UN; - } else if ((flag & GETFLCK) || (flag & RGETFLCK)) { - acmd = F_GETLK; - } else if ((flag & SETFLCK) || (flag & RSETFLCK)) { - acmd = F_SETLK; - } -#endif #if (defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV)) && !defined(AFS_SUN58_ENV) if ((acmd == F_GETLK) || (acmd == F_RGETLK)) { #else @@ -560,9 +541,7 @@ int afs_lockctl(struct vcache * avc, struct AFS_FLOCK * af, int acmd, code = 0; goto done; } -#ifndef AFS_OSF_ENV /* getlock is a no-op for osf (for now) */ code = HandleGetLock(avc, af, &treq, clid); -#endif code = afs_CheckCode(code, &treq, 2); /* defeat buggy AIX optimz */ goto done; } else if ((acmd == F_SETLK) || (acmd == F_SETLKW) @@ -614,7 +593,7 @@ int afs_lockctl(struct vcache * avc, struct AFS_FLOCK * af, int acmd, #endif ) && code != LOCK_UN) code |= LOCK_NB; /* non-blocking, s.v.p. */ -#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) +#if defined(AFS_DARWIN_ENV) code = HandleFlock(avc, code, &treq, clid, 0 /*!onlymine */ ); #elif defined(AFS_SGI_ENV) AFS_RWLOCK((vnode_t *) avc, VRWLOCK_WRITE); @@ -645,7 +624,6 @@ done: * 2. Asking for write lock, and only the current * PID has the file read locked. */ -#ifndef AFS_OSF_ENV /* getlock is a no-op for osf (for now) */ static int HandleGetLock(register struct vcache *avc, register struct AFS_FLOCK *af, register struct vrequest *areq, int clid) @@ -885,125 +863,4 @@ GetFlockCount(struct vcache *avc, struct vrequest *areq) return ((int)OutStatus.lockCount); } } -#endif - -#if !defined(AFS_AIX_ENV) && !defined(AFS_HPUX_ENV) && !defined(AFS_SUN5_ENV) && !defined(AFS_SGI_ENV) && !defined(UKERNEL) && !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_XBSD_ENV) -/* Flock not support on System V systems */ -#ifdef AFS_OSF_ENV -extern struct fileops afs_fileops; - -int -afs_xflock(afs_proc_t *p, void *args, int *retval) -#else /* AFS_OSF_ENV */ -int -afs_xflock(void) -#endif -{ - int code = 0; - struct a { - int fd; - int com; - } *uap; - struct file *fd; - struct vrequest treq; - struct vcache *tvc; - int flockDone; - struct afs_fakestat_state fakestate; - - afs_InitFakeStat(&fakestate); - AFS_STATCNT(afs_xflock); - flockDone = 0; -#ifdef AFS_OSF_ENV - uap = (struct a *)args; - getf(&fd, uap->fd, FILE_FLAGS_NULL, &u.u_file_state); -#else /* AFS_OSF_ENV */ - uap = (struct a *)u.u_ap; - fd = getf(uap->fd); -#endif - if (!fd) { - afs_PutFakeStat(&fakestate); - return; - } - - if (flockDone = afs_InitReq(&treq, u.u_cred)) { - afs_PutFakeStat(&fakestate); - return flockDone; - } - - AFS_DISCON_LOCK(); - - /* first determine whether this is any sort of vnode */ - if (fd->f_type == DTYPE_VNODE) { - /* good, this is a vnode; next see if it is an AFS vnode */ - tvc = VTOAFS(fd->f_data); /* valid, given a vnode */ - if (IsAfsVnode(AFSTOV(tvc))) { - /* This is an AFS vnode, so do the work */ - code = afs_EvalFakeStat(&tvc, &fakestate, &treq); - if (code) { - AFS_DISCON_UNLOCK(); - afs_PutFakeStat(&fakestate); - return code; - } - if ((fd->f_flag & (FEXLOCK | FSHLOCK)) && !(uap->com & LOCK_UN)) { - /* First, if fd already has lock, release it for relock path */ -#if defined(AFS_SGI_ENV) || defined(AFS_OSF_ENV) - HandleFlock(tvc, LOCK_UN, &treq, u.u_procp->p_pid, - 0 /*!onlymine */ ); -#else - HandleFlock(tvc, LOCK_UN, &treq, 0, 0 /*!onlymine */ ); -#endif - fd->f_flag &= ~(FEXLOCK | FSHLOCK); - } - /* now try the requested operation */ - -#if defined(AFS_SGI_ENV) || defined(AFS_OSF_ENV) - code = - HandleFlock(tvc, uap->com, &treq, u.u_procp->p_pid, - 0 /*!onlymine */ ); -#else - code = HandleFlock(tvc, uap->com, &treq, 0, 0 /*!onlymine */ ); -#endif -#ifndef AFS_OSF_ENV - u.u_error = code; -#endif - - if (uap->com & LOCK_UN) { - /* gave up lock */ - fd->f_flag &= ~(FEXLOCK | FSHLOCK); - } else { -#ifdef AFS_OSF_ENV - if (!code) { -#else /* AFS_OSF_ENV */ - if (!u.u_error) { -#endif - if (uap->com & LOCK_SH) - fd->f_flag |= FSHLOCK; - else if (uap->com & LOCK_EX) - fd->f_flag |= FEXLOCK; - } - } - flockDone = 1; - fd->f_ops = &afs_fileops; - } - } -#ifdef AFS_OSF_ENV - if (!flockDone) - code = flock(p, args, retval); -#ifdef AFS_OSF30_ENV - FP_UNREF_ALWAYS(fd); -#else - FP_UNREF(fd); -#endif - AFS_DISCON_UNLOCK(); - afs_PutFakeStat(&fakestate); - return code; -#else /* AFS_OSF_ENV */ - if (!flockDone) - flock(); - AFS_DISCON_UNLOCK(); - afs_PutFakeStat(&fakestate); - return; -#endif -} -#endif /* !defined(AFS_AIX_ENV) && !defined(AFS_HPUX_ENV) && !defined(AFS_SUN5_ENV) && !defined(UKERNEL) && !defined(AFS_LINUX20_ENV) */ diff --git a/src/afs/VNOPS/afs_vnop_lookup.c b/src/afs/VNOPS/afs_vnop_lookup.c index d5d92beb4a..4691417c52 100644 --- a/src/afs/VNOPS/afs_vnop_lookup.c +++ b/src/afs/VNOPS/afs_vnop_lookup.c @@ -1196,9 +1196,7 @@ static int AFSDOBULK = 1; #endif int -#ifdef AFS_OSF_ENV -afs_lookup(OSI_VC_DECL(adp), char *aname, struct vcache **avcp, afs_ucred_t *acred, int opflag, int wantparent) -#elif defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) +#if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) afs_lookup(OSI_VC_DECL(adp), char *aname, struct vcache **avcp, struct pathname *pnp, int flags, struct vnode *rdir, afs_ucred_t *acred) #elif defined(UKERNEL) afs_lookup(OSI_VC_DECL(adp), char *aname, struct vcache **avcp, afs_ucred_t *acred, int flags) @@ -1231,10 +1229,6 @@ afs_lookup(OSI_VC_DECL(adp), char *aname, struct vcache **avcp, afs_ucred_t *acr if ((code = afs_InitReq(&treq, acred))) goto done; -#ifdef AFS_OSF_ENV - ndp->ni_dvp = AFSTOV(adp); -#endif /* AFS_OSF_ENV */ - if (afs_fakestat_enable && adp->mvstat == 1) { if (strcmp(aname, ".directory") == 0) tryEvalOnly = 1; @@ -1284,18 +1278,6 @@ afs_lookup(OSI_VC_DECL(adp), char *aname, struct vcache **avcp, afs_ucred_t *acr if (adp->mvstat == 2 && aname[0] == '.' && aname[1] == '.' && !aname[2]) { /* looking up ".." in root via special hacks */ if (adp->mvid == (struct VenusFid *)0 || adp->mvid->Fid.Volume == 0) { -#ifdef AFS_OSF_ENV - if (adp == afs_globalVp) { - struct vnode *rvp = AFSTOV(adp); -/* - ndp->ni_vp = rvp->v_vfsp->vfs_vnodecovered; - ndp->ni_dvp = ndp->ni_vp; - VN_HOLD(*avcp); -*/ - code = ENODEV; - goto done; - } -#endif code = ENODEV; goto done; } @@ -1749,17 +1731,6 @@ afs_lookup(OSI_VC_DECL(adp), char *aname, struct vcache **avcp, afs_ucred_t *acr if (tname != aname && tname) osi_FreeLargeSpace(tname); if (code == 0) { -#ifdef AFS_OSF_ENV - /* Handle RENAME; only need to check rename "." */ - if (opflag == RENAME && wantparent && *ndp->ni_next == 0) { - if (!FidCmp(&(tvc->f.fid), &(adp->f.fid))) { - afs_PutVCache(*avcp); - *avcp = NULL; - afs_PutFakeStat(&fakestate); - return afs_CheckCode(EISDIR, &treq, 18); - } - } -#endif /* AFS_OSF_ENV */ if (afs_mariner) afs_AddMarinerName(aname, tvc); diff --git a/src/afs/VNOPS/afs_vnop_read.c b/src/afs/VNOPS/afs_vnop_read.c index ff6c14a284..3f6f0b5fee 100644 --- a/src/afs/VNOPS/afs_vnop_read.c +++ b/src/afs/VNOPS/afs_vnop_read.c @@ -877,11 +877,6 @@ afs_UFSRead(register struct vcache *avc, struct uio *auio, code); AFS_VOP_RWUNLOCK(tfile->vnode, VRWLOCK_READ); AFS_GLOCK(); -#elif defined(AFS_OSF_ENV) - tuio.uio_rw = UIO_READ; - AFS_GUNLOCK(); - VOP_READ(tfile->vnode, &tuio, 0, afs_osi_credp, code); - AFS_GLOCK(); #elif defined(AFS_HPUX100_ENV) AFS_GUNLOCK(); code = VOP_RDWR(tfile->vnode, &tuio, UIO_READ, 0, afs_osi_credp); diff --git a/src/afs/VNOPS/afs_vnop_readdir.c b/src/afs/VNOPS/afs_vnop_readdir.c index 44295fe6c8..992bf3d885 100644 --- a/src/afs/VNOPS/afs_vnop_readdir.c +++ b/src/afs/VNOPS/afs_vnop_readdir.c @@ -15,7 +15,7 @@ * afs_readdir_move * afs_bulkstat_send * afs_readdir/afs_readdir2(HP) - * afs_readdir1 - HP and DUX NFS versions + * afs_readdir1 - HP NFS version * */ @@ -163,7 +163,7 @@ struct min_direct { /* miniature direct structure */ }; #endif /* AFS_SGI_ENV */ -#if defined(AFS_HPUX_ENV) || defined(AFS_OSF_ENV) +#if defined(AFS_HPUX_ENV) struct minnfs_direct { afs_int32 d_off; /* XXX */ afs_uint32 d_fileno; @@ -549,7 +549,7 @@ afs_bulkstat_send(struct vcache *avc, struct vrequest *req) */ int -#if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) || defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) +#if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) afs_readdir(OSI_VC_DECL(avc), struct uio *auio, afs_ucred_t *acred, int *eofp) #else @@ -612,7 +612,7 @@ afs_readdir(OSI_VC_DECL(avc), struct uio *auio, afs_ucred_t *acred) #endif /* AFS_SGI61_ENV */ #endif /* defined(AFS_SGI53_ENV) */ -#if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) || defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) +#if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) /* Not really used by the callee so we ignore it for now */ if (eofp) *eofp = 0; @@ -758,7 +758,7 @@ afs_readdir(OSI_VC_DECL(avc), struct uio *auio, afs_ucred_t *acred) } else { /* nothin to hand over */ } -#if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) || defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) +#if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) if (eofp) *eofp = 1; /* Set it properly */ #endif @@ -902,15 +902,9 @@ afs_readdir(OSI_VC_DECL(avc), struct uio *auio, afs_ucred_t *acred) return code; } -#if defined(AFS_HPUX_ENV) || defined(AFS_OSF_ENV) -#ifdef AFS_OSF_ENV -int -afs1_readdir(struct vcache *avc, struct uio *auio, afs_ucred_t *acred, - int *eofp) -#else +#if defined(AFS_HPUX_ENV) int afs1_readdir(struct vcache *avc, struct uio *auio, afs_ucred_t *acred) -#endif { struct vrequest treq; register struct dcache *tdc; @@ -919,36 +913,28 @@ afs1_readdir(struct vcache *avc, struct uio *auio, afs_ucred_t *acred) struct DirEntry *ode = 0, *nde = 0; int o_slen = 0, n_slen = 0; afs_uint32 us; -#if defined(AFS_HPUX_ENV) || defined(AFS_OSF_ENV) /* - * XXX All the hacks for alloced sdirEntry and inlining of afs_readdir_move instead of calling - * it is necessary for hpux due to stack problems that seem to occur when coming thru the nfs + * XXX All the hacks for alloced sdirEntry and inlining of + * afs_readdir_move instead of calling it is necessary for hpux due to + * stack problems that seem to occur when coming thru the nfs * translator side XXX */ struct minnfs_direct *sdirEntry = (struct minnfs_direct *) osi_AllocSmallSpace(sizeof(struct min_direct)); afs_int32 rlen; -#endif + struct afs_fakestat_state fakestate; AFS_STATCNT(afs_readdir); -#if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) || defined(AFS_OSF_ENV) - if (eofp) - *eofp = 0; -#endif if (code = afs_InitReq(&treq, acred)) { -#ifdef AFS_HPUX_ENV osi_FreeSmallSpace((char *)sdirEntry); -#endif return code; } afs_InitFakeStat(&fakestate); AFS_DISCON_LOCK(); code = afs_EvalFakeStat(&avc, &fakestate, &treq); if (code) { -#ifdef AFS_HPUX_ENV osi_FreeSmallSpace((char *)sdirEntry); -#endif AFS_DISCON_UNLOCK(); afs_PutFakeStat(&fakestate); return code; @@ -994,20 +980,18 @@ afs1_readdir(struct vcache *avc, struct uio *auio, afs_ucred_t *acred) } len = 0; -#ifdef AFS_HPUX_ENV auio->uio_fpflags = 0; -#endif while (code == 0) { origOffset = AFS_UIO_OFFSET(auio); - /* scan for the next interesting entry scan for in-use blob otherwise up point at - * this blob note that ode, if non-zero, also represents a held dir page */ + /* scan for the next interesting entry scan for in-use blob + * otherwise up point at this blob note that ode, if non-zero, + * also represents a held dir page */ if (!(us = BlobScan(tdc, (origOffset >> 5))) || !(nde = (struct DirEntry *)afs_dir_GetBlob(tdc, us))) { /* failed to setup nde, return what we've got, and release ode */ if (len) { /* something to hand over. */ -#if defined(AFS_HPUX_ENV) || defined(AFS_OSF_ENV) sdirEntry->d_fileno = (avc->f.fid.Fid.Volume << 16) + ntohl(ode->fid.vnode); FIXUPSTUPIDINODE(sdirEntry->d_fileno); @@ -1035,19 +1019,10 @@ afs1_readdir(struct vcache *avc, struct uio *auio, afs_ucred_t *acred) rlen -= minLen; } } -#else - code = - afs_readdir_move(ode, avc, auio, o_slen, - AFS_UIO_RESID(auio), origOffset); -#endif /* AFS_HPUX_ENV */ AFS_UIO_SETRESID(auio, 0); } else { /* nothin to hand over */ } -#if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) || defined(AFS_OSF_ENV) - if (eofp) - *eofp = 1; -#endif if (ode) DRelease(ode, 0); goto dirend; @@ -1055,16 +1030,11 @@ afs1_readdir(struct vcache *avc, struct uio *auio, afs_ucred_t *acred) /* by here nde is set */ /* Do we have enough user space to carry out our mission? */ -#if defined(AFS_SGI_ENV) - n_slen = strlen(nde->name) + 1; /* NULL terminate */ -#else n_slen = strlen(nde->name); -#endif if (NDIRSIZ_LEN(n_slen) >= (AFS_UIO_RESID(auio) - len)) { /* No can do no more now; ya know... at this time */ DRelease(nde, 0); /* can't use this one. */ if (len) { -#if defined(AFS_HPUX_ENV) || defined(AFS_OSF_ENV) sdirEntry->d_fileno = (avc->f.fid.Fid.Volume << 16) + ntohl(ode->fid.vnode); FIXUPSTUPIDINODE(sdirEntry->d_fileno); @@ -1091,11 +1061,6 @@ afs1_readdir(struct vcache *avc, struct uio *auio, afs_ucred_t *acred) rlen -= minLen; } } -#else - code = - afs_readdir_move(ode, avc, auio, o_slen, - AFS_UIO_RESID(auio), origOffset); -#endif /* AFS_HPUX_ENV */ /* this next line used to be AFSVFS40 or AIX 3.1, but is really generic */ AFS_UIO_SETOFFSET(auio, origOffset); AFS_UIO_SETRESID(auio, 0); @@ -1116,7 +1081,6 @@ afs1_readdir(struct vcache *avc, struct uio *auio, afs_ucred_t *acred) * to set up for the next one. */ if (len) { -#if defined(AFS_HPUX_ENV) || defined(AFS_OSF_ENV) sdirEntry->d_fileno = (avc->f.fid.Fid.Volume << 16) + ntohl(ode->fid.vnode); FIXUPSTUPIDINODE(sdirEntry->d_fileno); @@ -1143,9 +1107,6 @@ afs1_readdir(struct vcache *avc, struct uio *auio, afs_ucred_t *acred) rlen -= minLen; } } -#else - code = afs_readdir_move(ode, avc, auio, o_slen, len, origOffset); -#endif /* AFS_HPUX_ENV */ } len = NDIRSIZ_LEN(o_slen = n_slen); if (ode) @@ -1162,9 +1123,7 @@ afs1_readdir(struct vcache *avc, struct uio *auio, afs_ucred_t *acred) ReleaseReadLock(&avc->lock); done: -#if defined(AFS_HPUX_ENV) || defined(AFS_OSF_ENV) osi_FreeSmallSpace((char *)sdirEntry); -#endif AFS_DISCON_UNLOCK(); afs_PutFakeStat(&fakestate); code = afs_CheckCode(code, &treq, 29); diff --git a/src/afs/VNOPS/afs_vnop_remove.c b/src/afs/VNOPS/afs_vnop_remove.c index 3fe8ccef6e..e4ef064990 100644 --- a/src/afs/VNOPS/afs_vnop_remove.c +++ b/src/afs/VNOPS/afs_vnop_remove.c @@ -9,9 +9,7 @@ /* * Implements: - * afs_Wire (DUX) * FetchWholeEnchilada - * afs_IsWired (DUX) * afsremove * afs_remove * afs_newname @@ -33,19 +31,8 @@ extern afs_rwlock_t afs_xvcache; extern afs_rwlock_t afs_xcbhash; -#ifdef AFS_OSF_ENV -/* - * Wire down file in cache: prefetch all data, and turn on CWired flag - * so that callbacks/callback expirations are (temporarily) ignored - * and cache file(s) are kept in cache. File will be unwired when - * afs_inactive is called (ie no one has VN_HOLD on vnode), or when - * afs_IsWired notices that the file is no longer Active. - */ -afs_Wire(avc, areq) -#else /* AFS_OSF_ENV */ static void FetchWholeEnchilada(register struct vcache *avc, struct vrequest *areq) -#endif { register afs_int32 nextChunk; register struct dcache *tdc; @@ -56,44 +43,15 @@ FetchWholeEnchilada(register struct vcache *avc, struct vrequest *areq) return; /* don't know size */ for (nextChunk = 0; nextChunk < 1024; nextChunk++) { /* sanity check on N chunks */ pos = AFS_CHUNKTOBASE(nextChunk); -#if defined(AFS_OSF_ENV) - if (pos >= avc->f.m.Length) - break; /* all done */ -#else /* AFS_OSF_ENV */ if (pos >= avc->f.m.Length) return; /* all done */ -#endif tdc = afs_GetDCache(avc, pos, areq, &offset, &len, 0); if (!tdc) -#if defined(AFS_OSF_ENV) - break; -#else /* AFS_OSF_ENV */ return; -#endif afs_PutDCache(tdc); } -#if defined(AFS_OSF_ENV) - avc->f.states |= CWired; -#endif /* AFS_OSF_ENV */ } -#if defined(AFS_OSF_ENV) -/* - * Tests whether file is wired down, after unwiring the file if it - * is found to be inactive (ie not open and not being paged from). - */ -afs_IsWired(register struct vcache *avc) -{ - if (avc->f.states & CWired) { - if (osi_Active(avc)) { - return 1; - } - avc->f.states &= ~CWired; - } - return 0; -} -#endif /* AFS_OSF_ENV */ - int afsremove(register struct vcache *adp, register struct dcache *tdc, register struct vcache *tvc, char *aname, afs_ucred_t *acred, @@ -228,14 +186,8 @@ afs_remove(OSI_VC_DECL(adp), char *aname, afs_ucred_t *acred) afs_Trace2(afs_iclSetp, CM_TRACE_REMOVE, ICL_TYPE_POINTER, adp, ICL_TYPE_STRING, aname); -#ifdef AFS_OSF_ENV - tvc = (struct vcache *)ndp->ni_vp; /* should never be null */ -#endif if ((code = afs_InitReq(&treq, acred))) { -#ifdef AFS_OSF_ENV - afs_PutVCache(tvc); -#endif return code; } @@ -243,9 +195,6 @@ afs_remove(OSI_VC_DECL(adp), char *aname, afs_ucred_t *acred) code = afs_EvalFakeStat(&adp, &fakestate, &treq); if (code) { afs_PutFakeStat(&fakestate); -#ifdef AFS_OSF_ENV - afs_PutVCache(tvc); -#endif return code; } @@ -253,9 +202,6 @@ afs_remove(OSI_VC_DECL(adp), char *aname, afs_ucred_t *acred) if (afs_IsDynroot(adp)) { code = afs_DynrootVOPRemove(adp, acred, aname); afs_PutFakeStat(&fakestate); -#ifdef AFS_OSF_ENV - afs_PutVCache(tvc); -#endif return code; } if (afs_IsDynrootMount(adp)) { @@ -264,36 +210,21 @@ afs_remove(OSI_VC_DECL(adp), char *aname, afs_ucred_t *acred) if (strlen(aname) > AFSNAMEMAX) { afs_PutFakeStat(&fakestate); -#ifdef AFS_OSF_ENV - afs_PutVCache(tvc); -#endif return ENAMETOOLONG; } tagain: code = afs_VerifyVCache(adp, &treq); -#ifdef AFS_OSF_ENV - tvc = VTOAFS(ndp->ni_vp); /* should never be null */ - if (code) { - afs_PutVCache(tvc); - afs_PutFakeStat(&fakestate); - return afs_CheckCode(code, &treq, 22); - } -#else /* AFS_OSF_ENV */ tvc = NULL; if (code) { code = afs_CheckCode(code, &treq, 23); afs_PutFakeStat(&fakestate); return code; } -#endif /** If the volume is read-only, return error without making an RPC to the * fileserver */ if (adp->f.states & CRO) { -#ifdef AFS_OSF_ENV - afs_PutVCache(tvc); -#endif code = EROFS; afs_PutFakeStat(&fakestate); return code; @@ -301,9 +232,6 @@ afs_remove(OSI_VC_DECL(adp), char *aname, afs_ucred_t *acred) /* If we're running disconnected without logging, go no further... */ if (AFS_IS_DISCONNECTED && !AFS_IS_DISCON_RW) { -#ifdef AFS_OSF_ENV - afs_PutVCache(tvc); -#endif code = ENETDOWN; afs_PutFakeStat(&fakestate); return code; @@ -391,11 +319,7 @@ afs_remove(OSI_VC_DECL(adp), char *aname, afs_ucred_t *acred) if (tdc) ReleaseSharedLock(&tdc->lock); ObtainWriteLock(&tvc->lock, 143); -#if defined(AFS_OSF_ENV) - afs_Wire(tvc, &treq); -#else /* AFS_OSF_ENV */ FetchWholeEnchilada(tvc, &treq); -#endif ReleaseWriteLock(&tvc->lock); ObtainWriteLock(&adp->lock, 144); /* Technically I don't think we need this back, but let's hold it diff --git a/src/afs/VNOPS/afs_vnop_strategy.c b/src/afs/VNOPS/afs_vnop_strategy.c index c192ee01f6..932da24032 100644 --- a/src/afs/VNOPS/afs_vnop_strategy.c +++ b/src/afs/VNOPS/afs_vnop_strategy.c @@ -27,7 +27,7 @@ -#if defined(AFS_SUN5_ENV) || defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) +#if defined(AFS_SUN5_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) int afs_ustrategy(register struct buf *abp, afs_ucred_t *credp) #else int afs_ustrategy(register struct buf *abp) @@ -38,12 +38,10 @@ int afs_ustrategy(register struct buf *abp) struct iovec tiovec[1]; register struct vcache *tvc = VTOAFS(abp->b_vp); register afs_int32 len = abp->b_bcount; -#if !defined(AFS_SUN5_ENV) && !defined(AFS_OSF_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_XBSD_ENV) #ifdef AFS_AIX41_ENV struct ucred *credp; -#else +#elif !defined(AFS_SUN5_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_XBSD_ENV) afs_ucred_t *credp = u.u_cred; -#endif #endif AFS_STATCNT(afs_ustrategy); @@ -73,16 +71,16 @@ int afs_ustrategy(register struct buf *abp) */ tuio.afsio_iov = tiovec; tuio.afsio_iovcnt = 1; -#if defined(AFS_OSF_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_XBSD_ENV) -#ifdef AFS_64BIT_CLIENT -#ifdef AFS_SUN5_ENV +#if defined(AFS_SUN5_ENV) || defined(AFS_XBSD_ENV) +# ifdef AFS_64BIT_CLIENT +# ifdef AFS_SUN5_ENV tuio.afsio_offset = (afs_offs_t) ldbtob(abp->b_lblkno); -#else +# else tuio.afsio_offset = (afs_offs_t) dbtob(abp->b_blkno); -#endif -#else /* AFS_64BIT_CLIENT */ +# endif +# else /* AFS_64BIT_CLIENT */ tuio.afsio_offset = (u_int) dbtob(abp->b_blkno); -#endif /* AFS_64BIT_CLIENT */ +# endif /* AFS_64BIT_CLIENT */ #else tuio.afsio_offset = DEV_BSIZE * abp->b_blkno; #endif @@ -132,7 +130,7 @@ int afs_ustrategy(register struct buf *abp) } else { tuio.afsio_iov = tiovec; tuio.afsio_iovcnt = 1; -#if defined(AFS_OSF_ENV) || defined(AFS_SUN5_ENV) +#if defined(AFS_SUN5_ENV) #ifdef AFS_64BIT_CLIENT #ifdef AFS_SUN5_ENV tuio.afsio_offset = (afs_offs_t) ldbtob(abp->b_lblkno); @@ -163,11 +161,6 @@ int afs_ustrategy(register struct buf *abp) */ len = MIN(len, tvc->f.m.Length - dbtob(abp->b_blkno)); #endif -#ifdef AFS_OSF_ENV - len = - MIN(abp->b_bcount, - (VTOAFS(abp->b_vp))->f.m.Length - dbtob(abp->b_blkno)); -#endif /* AFS_OSF_ENV */ tuio.afsio_resid = len; #if defined(AFS_XBSD_ENV) tiovec[0].iov_base = abp->b_saveaddr; @@ -184,7 +177,7 @@ int afs_ustrategy(register struct buf *abp) #endif } -#if defined(AFS_DUX40_ENV) || defined (AFS_XBSD_ENV) +#if defined (AFS_XBSD_ENV) if (code) { abp->b_error = code; #if !defined(AFS_FBSD50_ENV) @@ -195,15 +188,6 @@ int afs_ustrategy(register struct buf *abp) #if defined(AFS_AIX32_ENV) crfree(credp); -#elif defined(AFS_DUX40_ENV) - biodone(abp); - if (code && !(abp->b_flags & B_READ)) { - /* prevent ubc from retrying writes */ - AFS_GUNLOCK(); - ubc_invalidate(AFSTOV(tvc)->v_object, - (vm_offset_t) dbtob(abp->b_blkno), PAGE_SIZE, B_INVAL); - AFS_GLOCK(); - } #elif defined(AFS_FBSD60_ENV) (*abp->b_iodone)(abp); #elif defined(AFS_FBSD50_ENV) diff --git a/src/afs/VNOPS/afs_vnop_write.c b/src/afs/VNOPS/afs_vnop_write.c index 4b85177c28..b47b0f63a9 100644 --- a/src/afs/VNOPS/afs_vnop_write.c +++ b/src/afs/VNOPS/afs_vnop_write.c @@ -13,7 +13,6 @@ * afs_MemWrite * afs_StoreOnLastReference * afs_close - * afs_closex * afs_fsync */ @@ -485,16 +484,6 @@ afs_UFSWrite(register struct vcache *avc, struct uio *auio, int aio, AFS_VOP_RWUNLOCK(tfile->vnode, VRWLOCK_WRITE); avc->f.states &= ~CWritingUFS; AFS_GLOCK(); -#elif defined(AFS_OSF_ENV) - { - struct ucred *tmpcred = u.u_cred; - u.u_cred = afs_osi_credp; - tuio.uio_rw = UIO_WRITE; - AFS_GUNLOCK(); - VOP_WRITE(tfile->vnode, &tuio, 0, afs_osi_credp, code); - AFS_GLOCK(); - u.u_cred = tmpcred; - } #elif defined(AFS_HPUX100_ENV) { AFS_GUNLOCK(); @@ -659,76 +648,6 @@ afs_DoPartialWrite(register struct vcache *avc, struct vrequest *areq) return code; } -#ifdef AFS_OSF_ENV -#ifdef AFS_DUX50_ENV -#define vno_close(X) vn_close((X), 0, NOCRED) -#elif defined(AFS_DUX40_ENV) -#define vno_close vn_close -#endif -/* We don't need this for AIX since: - * (1) aix doesn't use fileops and it call close directly intead - * (where the unlocking should be done) and - * (2) temporarily, the aix lockf isn't supported yet. - * - * this stupid routine is used to release the flocks held on a - * particular file descriptor. Sun doesn't pass file descr. info - * through to the vnode layer, and yet we must unlock flocked files - * on the *appropriate* (not first, as in System V) close call. Thus - * this code. - * How does this code get invoked? The afs AFS_FLOCK plugs in the new afs - * file ops structure into any afs file when it gets flocked. - * N.B: Intercepting close syscall doesn't trap aborts or exit system - * calls. -*/ -int -afs_closex(register struct file *afd) -{ - struct vrequest treq; - struct vcache *tvc; - afs_int32 flags; - int closeDone; - afs_int32 code = 0; - struct afs_fakestat_state fakestat; - - AFS_STATCNT(afs_closex); - /* setup the credentials */ - if ((code = afs_InitReq(&treq, u.u_cred))) - return code; - afs_InitFakeStat(&fakestat); - - closeDone = 0; - /* we're the last one. If we're an AFS vnode, clear the flags, - * close the file and release the lock when done. Otherwise, just - * let the regular close code work. */ - if (afd->f_type == DTYPE_VNODE) { - tvc = VTOAFS(afd->f_data); - if (IsAfsVnode(AFSTOV(tvc))) { - code = afs_EvalFakeStat(&tvc, &fakestat, &treq); - if (code) { - afs_PutFakeStat(&fakestat); - return code; - } - VN_HOLD(AFSTOV(tvc)); - flags = afd->f_flag & (FSHLOCK | FEXLOCK); - afd->f_flag &= ~(FSHLOCK | FEXLOCK); - code = vno_close(afd); - if (flags) - HandleFlock(tvc, LOCK_UN, &treq, u.u_procp->p_pid, - 1 /*onlymine */ ); - AFS_RELE(AFSTOV(tvc)); - closeDone = 1; - } - } - /* now, if close not done, do it */ - if (!closeDone) { - code = vno_close(afd); - } - afs_PutFakeStat(&fakestat); - return code; /* return code from vnode layer */ -} -#endif - - /* handle any closing cleanup stuff */ int #if defined(AFS_SGI65_ENV) @@ -782,36 +701,34 @@ afs_close(OSI_VC_DECL(avc), afs_int32 aflags, afs_ucred_t *acred) } /* unlock any locks for pid - could be wrong for child .. */ AFS_RWLOCK((vnode_t *) avc, VRWLOCK_WRITE); -#ifdef AFS_SGI65_ENV +# ifdef AFS_SGI65_ENV get_current_flid(&flid); cleanlocks((vnode_t *) avc, flid.fl_pid, flid.fl_sysid); HandleFlock(avc, LOCK_UN, &treq, flid.fl_pid, 1 /*onlymine */ ); -#else -#ifdef AFS_SGI64_ENV +# else +# ifdef AFS_SGI64_ENV cleanlocks((vnode_t *) avc, flp); -#else /* AFS_SGI64_ENV */ +# else /* AFS_SGI64_ENV */ cleanlocks((vnode_t *) avc, u.u_procp->p_epid, u.u_procp->p_sysid); -#endif /* AFS_SGI64_ENV */ +# endif /* AFS_SGI64_ENV */ HandleFlock(avc, LOCK_UN, &treq, OSI_GET_CURRENT_PID(), 1 /*onlymine */ ); -#endif /* AFS_SGI65_ENV */ +# endif /* AFS_SGI65_ENV */ /* afs_chkpgoob will drop and re-acquire the global lock. */ afs_chkpgoob(&avc->v, btoc(avc->f.m.Length)); -#elif defined(AFS_SUN5_ENV) +#elif defined(AFS_SUN5_ENV) if (count > 1) { - /* The vfs layer may call this repeatedly with higher "count"; only on the last close (i.e. count = 1) we should actually proceed with the close. */ + /* The vfs layer may call this repeatedly with higher "count"; only + * on the last close (i.e. count = 1) we should actually proceed + * with the close. */ afs_PutFakeStat(&fakestat); AFS_DISCON_UNLOCK(); return 0; } -#else /* AFS_SGI_ENV */ - if (avc->flockCount) { /* Release Lock */ -#if defined(AFS_OSF_ENV) - HandleFlock(avc, LOCK_UN, &treq, u.u_procp->p_pid, 1 /*onlymine */ ); #else + if (avc->flockCount) { /* Release Lock */ HandleFlock(avc, LOCK_UN, &treq, 0, 1 /*onlymine */ ); -#endif } -#endif /* AFS_SGI_ENV */ +#endif if (aflags & (FWRITE | FTRUNC)) { if (afs_BBusy() || (AFS_NFSXLATORREQ(acred)) || AFS_IS_DISCONNECTED) { /* do it yourself if daemons are all busy */ @@ -899,11 +816,6 @@ afs_close(OSI_VC_DECL(avc), afs_int32 aflags, afs_ucred_t *acred) avc->opens--; ReleaseWriteLock(&avc->lock); } -#ifdef AFS_OSF_ENV - if ((VREFCOUNT(avc) <= 2) && (avc->f.states & CUnlinked)) { - afs_remunlink(avc, 1); /* ignore any return code */ - } -#endif AFS_DISCON_UNLOCK(); afs_PutFakeStat(&fakestat); code = afs_CheckCode(code, &treq, 5); @@ -912,19 +824,15 @@ afs_close(OSI_VC_DECL(avc), afs_int32 aflags, afs_ucred_t *acred) int -#ifdef AFS_OSF_ENV -afs_fsync(OSI_VC_DECL(avc), int fflags, afs_ucred_t *acred, int waitfor) -#else /* AFS_OSF_ENV */ #if defined(AFS_SGI_ENV) || defined(AFS_SUN53_ENV) afs_fsync(OSI_VC_DECL(avc), int flag, afs_ucred_t *acred -#ifdef AFS_SGI65_ENV +# ifdef AFS_SGI65_ENV , off_t start, off_t stop -#endif /* AFS_SGI65_ENV */ +# endif /* AFS_SGI65_ENV */ ) -#else /* !OSF && !SUN53 && !SGI */ +#else /* !SUN53 && !SGI */ afs_fsync(OSI_VC_DECL(avc), afs_ucred_t *acred) #endif -#endif { register afs_int32 code; struct vrequest treq; diff --git a/src/afs/afs.h b/src/afs/afs.h index 8e86273e0d..0c6b8597cf 100644 --- a/src/afs/afs.h +++ b/src/afs/afs.h @@ -564,19 +564,15 @@ struct SimpleLocks { #define CNSHARE 0x00000100 /* support O_NSHARE semantics */ #define CLied 0x00000200 #define CTruth 0x00000400 -#ifdef AFS_OSF_ENV -#define CWired 0x00000800 /* OSF hack only */ -#else -#ifdef AFS_DARWIN80_ENV + +#if defined(AFS_DARWIN80_ENV) #define CDeadVnode 0x00000800 -#else -#ifdef AFS_DARWIN_ENV +#elif defined(AFS_DARWIN_ENV) #define CUBCinit 0x00000800 #else #define CWRITE_IGN 0x00000800 /* Next OS hack only */ #endif -#endif -#endif + #define CUnique 0x00001000 /* vc's uniquifier - latest unifiquier for fid */ #define CForeign 0x00002000 /* this is a non-afs vcache */ #define CReadDir 0x00004000 /* readdir in progress */ @@ -1342,11 +1338,7 @@ extern struct brequest afs_brs[NBRS]; /* request structures */ #if defined(AFS_SGI62_ENV) || defined(AFS_HAVE_VXFS) || defined(AFS_DARWIN_ENV) #define afs_vnodeToInumber(V) VnodeToIno(V) #else -#ifdef AFS_DECOSF_ENV -#define afs_vnodeToInumber(V) osi_vnodeToInumber(V) -#else #define afs_vnodeToInumber(V) (VTOI(V)->i_number) -#endif /* AFS_DECOSF_ENV */ #endif /* AFS_SGI62_ENV */ #endif @@ -1354,21 +1346,11 @@ extern struct brequest afs_brs[NBRS]; /* request structures */ #ifndef afs_vnodeToDev #if defined(AFS_SGI62_ENV) || defined(AFS_HAVE_VXFS) || defined(AFS_DARWIN_ENV) #define afs_vnodeToDev(V) VnodeToDev(V) -#elif defined(AFS_DECOSF_ENV) -#define afs_vnodeToDev(V) osi_vnodeToDev(V) #else #define afs_vnodeToDev(V) (VTOI(V)->i_dev) #endif #endif - -/* Note: this should agree with the definition in kdump.c */ -#if defined(AFS_OSF_ENV) -#if !defined(UKERNEL) -#define AFS_USEBUFFERS 1 -#endif -#endif - #if !defined(UKERNEL) && !defined(HAVE_STRUCT_BUF) /* declare something so that prototypes don't flip out */ /* appears struct buf stuff is only actually passed around as a pointer, diff --git a/src/afs/afs_call.c b/src/afs/afs_call.c index 514c6c6a51..d438b21c2b 100644 --- a/src/afs/afs_call.c +++ b/src/afs/afs_call.c @@ -526,7 +526,7 @@ afs_syscall_call(long parm, long parm2, long parm3, #endif && (parm != AFSOP_GETMTU) && (parm != AFSOP_GETMASK)) { /* only root can run this code */ -#if defined(AFS_OSF_ENV) || defined(AFS_SUN5_ENV) || defined(KERNEL_HAVE_UERROR) +#if defined(AFS_SUN5_ENV) || defined(KERNEL_HAVE_UERROR) #if defined(KERNEL_HAVE_UERROR) setuerror(EACCES); #endif @@ -1331,7 +1331,7 @@ afs_shutdown(void) shutdown_osifile(); shutdown_vnodeops(); shutdown_memcache(); -#if (!defined(AFS_NONFSTRANS) || defined(AFS_AIX_IAUTH_ENV)) && !defined(AFS_OSF_ENV) +#if (!defined(AFS_NONFSTRANS) || defined(AFS_AIX_IAUTH_ENV)) shutdown_exporter(); shutdown_nfsclnt(); #endif diff --git a/src/afs/afs_callback.c b/src/afs/afs_callback.c index 26d5fb6eb8..1bfaf1edc1 100644 --- a/src/afs/afs_callback.c +++ b/src/afs/afs_callback.c @@ -151,7 +151,7 @@ SRXAFSCB_GetCE(struct rx_call *a_call, afs_int32 a_index, a_result->lock.pid_last_reader = 0; a_result->lock.pid_writer = 0; a_result->lock.src_indicator = 0; -#endif /* AFS_OSF20_ENV */ +#endif /* INSTRUMENT_LOCKS */ #ifdef AFS_64BIT_CLIENT a_result->Length = (afs_int32) tvc->f.m.Length & 0xffffffff; #else /* AFS_64BIT_CLIENT */ @@ -237,7 +237,7 @@ SRXAFSCB_GetCE64(struct rx_call *a_call, afs_int32 a_index, a_result->lock.pid_last_reader = 0; a_result->lock.pid_writer = 0; a_result->lock.src_indicator = 0; -#endif /* AFS_OSF20_ENV */ +#endif /* INSTRUMENT_LOCKS */ #if !defined(AFS_64BIT_ENV) a_result->Length.high = 0; a_result->Length.low = tvc->f.m.Length; @@ -464,7 +464,7 @@ loop1: goto loop1; } #endif -#if defined(AFS_SGI_ENV) || defined(AFS_OSF_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_HPUX_ENV) || defined(AFS_LINUX20_ENV) +#if defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_HPUX_ENV) || defined(AFS_LINUX20_ENV) VN_HOLD(AFSTOV(tvc)); #else #ifdef AFS_DARWIN80_ENV @@ -558,7 +558,7 @@ loop2: goto loop2; } #endif -#if defined(AFS_SGI_ENV) || defined(AFS_OSF_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_HPUX_ENV) || defined(AFS_LINUX20_ENV) +#if defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_HPUX_ENV) || defined(AFS_LINUX20_ENV) VN_HOLD(AFSTOV(tvc)); #else #ifdef AFS_DARWIN80_ENV diff --git a/src/afs/afs_cbqueue.c b/src/afs/afs_cbqueue.c index ac931576f2..d963b96832 100644 --- a/src/afs/afs_cbqueue.c +++ b/src/afs/afs_cbqueue.c @@ -178,7 +178,7 @@ afs_DequeueCallback(struct vcache *avc) */ /* Sanity check on the callback queue. Allow for slop in the computation. */ -#if defined(AFS_OSF_ENV) || defined(AFS_LINUX22_ENV) +#if defined(AFS_LINUX22_ENV) #define CBQ_LIMIT (afs_maxvcount + 10) #else #define CBQ_LIMIT (afs_cacheStats + afs_stats_cmperf.vcacheXAllocs + 10) diff --git a/src/afs/afs_dcache.c b/src/afs/afs_dcache.c index be6a762caf..5cb11827a9 100644 --- a/src/afs/afs_dcache.c +++ b/src/afs/afs_dcache.c @@ -1894,7 +1894,7 @@ afs_GetDCache(register struct vcache *avc, afs_size_t abyte, #endif /* AFS_SGI_ENV */ if (AFS_CHUNKTOBASE(chunk) + adjustsize >= avc->f.m.Length && #else /* defined(AFS_AIX32_ENV) || defined(AFS_SGI_ENV) */ -#if defined(AFS_SUN5_ENV) || defined(AFS_OSF_ENV) +#if defined(AFS_SUN5_ENV) if ((doAdjustSize || (AFS_CHUNKTOBASE(chunk) >= avc->f.m.Length)) && #else if (AFS_CHUNKTOBASE(chunk) >= avc->f.m.Length && diff --git a/src/afs/afs_icl.c b/src/afs/afs_icl.c index 7ced4f40bb..0bfc3a3bb6 100644 --- a/src/afs/afs_icl.c +++ b/src/afs/afs_icl.c @@ -32,7 +32,7 @@ struct afs_icl_set *afs_iclSetp = (struct afs_icl_set *)0; struct afs_icl_set *afs_iclLongTermSetp = (struct afs_icl_set *)0; -#if defined(AFS_OSF_ENV) || defined(AFS_SGI61_ENV) +#if defined(AFS_SGI61_ENV) /* For SGI 6.2, this can is changed to 1 if it's a 32 bit kernel. */ #if defined(AFS_SGI62_ENV) && defined(KERNEL) && !defined(_K64U64) int afs_icl_sizeofLong = 1; @@ -541,16 +541,16 @@ afs_icl_AppendString(struct afs_icl_log *logp, char *astr) (lp)->logElements++; \ MACRO_END -#if defined(AFS_OSF_ENV) || (defined(AFS_SGI61_ENV) && (_MIPS_SZLONG==64)) || (defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL)) || defined(AFS_DARWIN_ENV) && defined(__amd64__) +#if (defined(AFS_SGI61_ENV) && (_MIPS_SZLONG==64)) || (defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL)) || defined(AFS_DARWIN_ENV) && defined(__amd64__) #define ICL_APPENDLONG(lp, x) \ MACRO_BEGIN \ ICL_APPENDINT32((lp), ((x) >> 32) & 0xffffffffL); \ ICL_APPENDINT32((lp), (x) & 0xffffffffL); \ MACRO_END -#else /* AFS_OSF_ENV */ +#else #define ICL_APPENDLONG(lp, x) ICL_APPENDINT32((lp), (x)) -#endif /* AFS_OSF_ENV */ +#endif /* routine to tell whether we're dealing with the address or the * object itself @@ -695,10 +695,10 @@ afs_icl_AppendRecord(register struct afs_icl_log *logp, afs_int32 op, ICL_APPENDINT32(logp, (afs_int32) ((afs_int32 *) p1)[2]); ICL_APPENDINT32(logp, (afs_int32) ((afs_int32 *) p1)[3]); } -#if defined(AFS_OSF_ENV) || (defined(AFS_SGI61_ENV) && (_MIPS_SZLONG==64)) || (defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL)) +#if (defined(AFS_SGI61_ENV) && (_MIPS_SZLONG==64)) || (defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL)) else if (t1 == ICL_TYPE_INT32) ICL_APPENDINT32(logp, (afs_int32) p1); -#endif /* AFS_OSF_ENV */ +#endif else ICL_APPENDLONG(logp, p1); } @@ -735,10 +735,10 @@ afs_icl_AppendRecord(register struct afs_icl_log *logp, afs_int32 op, ICL_APPENDINT32(logp, (afs_int32) ((afs_int32 *) p2)[2]); ICL_APPENDINT32(logp, (afs_int32) ((afs_int32 *) p2)[3]); } -#if defined(AFS_OSF_ENV) || (defined(AFS_SGI61_ENV) && (_MIPS_SZLONG==64)) || (defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL)) +#if (defined(AFS_SGI61_ENV) && (_MIPS_SZLONG==64)) || (defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL)) else if (t2 == ICL_TYPE_INT32) ICL_APPENDINT32(logp, (afs_int32) p2); -#endif /* AFS_OSF_ENV */ +#endif else ICL_APPENDLONG(logp, p2); } @@ -775,10 +775,10 @@ afs_icl_AppendRecord(register struct afs_icl_log *logp, afs_int32 op, ICL_APPENDINT32(logp, (afs_int32) ((afs_int32 *) p3)[2]); ICL_APPENDINT32(logp, (afs_int32) ((afs_int32 *) p3)[3]); } -#if defined(AFS_OSF_ENV) || (defined(AFS_SGI61_ENV) && (_MIPS_SZLONG==64)) || (defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL)) +#if (defined(AFS_SGI61_ENV) && (_MIPS_SZLONG==64)) || (defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL)) else if (t3 == ICL_TYPE_INT32) ICL_APPENDINT32(logp, (afs_int32) p3); -#endif /* AFS_OSF_ENV */ +#endif else ICL_APPENDLONG(logp, p3); } @@ -815,10 +815,10 @@ afs_icl_AppendRecord(register struct afs_icl_log *logp, afs_int32 op, ICL_APPENDINT32(logp, (afs_int32) ((afs_int32 *) p4)[2]); ICL_APPENDINT32(logp, (afs_int32) ((afs_int32 *) p4)[3]); } -#if defined(AFS_OSF_ENV) || (defined(AFS_SGI61_ENV) && (_MIPS_SZLONG==64)) || (defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL)) +#if (defined(AFS_SGI61_ENV) && (_MIPS_SZLONG==64)) || (defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL)) else if (t4 == ICL_TYPE_INT32) ICL_APPENDINT32(logp, (afs_int32) p4); -#endif /* AFS_OSF_ENV */ +#endif else ICL_APPENDLONG(logp, p4); } diff --git a/src/afs/afs_init.c b/src/afs/afs_init.c index 143d4f8aa2..69bf17826b 100644 --- a/src/afs/afs_init.c +++ b/src/afs/afs_init.c @@ -32,7 +32,7 @@ /* Exported variables */ struct osi_dev cacheDev; /*Cache device */ afs_int32 cacheInfoModTime; /*Last time cache info modified */ -#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) +#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) struct mount *afs_cacheVfsp = 0; #elif defined(AFS_LINUX20_ENV) struct super_block *afs_cacheSBp = 0; @@ -396,8 +396,6 @@ afs_InitCacheInfo(register char *afile) struct k_statvfs st; #elif defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) ||defined(AFS_HPUX100_ENV) struct statvfs st; -#elif defined(AFS_DUX40_ENV) - struct nstatfs st; #elif defined(AFS_DARWIN80_ENV) struct vfsstatfs st; #else @@ -413,12 +411,6 @@ afs_InitCacheInfo(register char *afile) #endif /* AFS_SGI65_ENV */ #elif defined(AFS_SUN5_ENV) || defined(AFS_HPUX100_ENV) if (!VFS_STATVFS(filevp->v_vfsp, &st)) -#elif defined(AFS_OSF_ENV) - - VFS_STATFS(filevp->v_vfsp, code); - /* struct copy */ - st = filevp->v_vfsp->m_stat; - if (code == 0) #elif defined(AFS_AIX41_ENV) if (!VFS_STATFS(filevp->v_vfsp, &st, &afs_osi_cred)) #elif defined(AFS_LINUX20_ENV) diff --git a/src/afs/afs_mariner.c b/src/afs/afs_mariner.c index 8b9ae5780d..d61ff7db49 100644 --- a/src/afs/afs_mariner.c +++ b/src/afs/afs_mariner.c @@ -83,7 +83,7 @@ afs_MarinerLogFetch(register struct vcache *avc, register afs_int32 off, taddr.sin_port = htons(2106); #ifdef STRUCT_SOCKADDR_HAS_SA_LEN taddr.sin_len = sizeof(taddr); -#endif /* AFS_OSF_ENV */ +#endif tp = tp1 = (char *)osi_AllocSmallSpace(AFS_SMALLOCSIZ); strcpy(tp, "fetch$Fetching "); tp += 15; /* change it if string changes */ @@ -115,7 +115,7 @@ afs_MarinerLog(register char *astring, register struct vcache *avc) taddr.sin_port = htons(2106); #ifdef STRUCT_SOCKADDR_HAS_SA_LEN taddr.sin_len = sizeof(taddr); -#endif /* AFS_OSF_ENV */ +#endif tp = buf = (char *)osi_AllocSmallSpace(AFS_SMALLOCSIZ); strcpy(tp, astring); diff --git a/src/afs/afs_memcache.c b/src/afs/afs_memcache.c index 3bbd53e2a3..9105fcd859 100644 --- a/src/afs/afs_memcache.c +++ b/src/afs/afs_memcache.c @@ -15,13 +15,6 @@ #ifndef AFS_LINUX22_ENV #include "rpc/types.h" #endif -#ifdef AFS_OSF_ENV -#undef kmem_alloc -#undef kmem_free -#undef mem_alloc -#undef mem_free -#undef register -#endif /* AFS_OSF_ENV */ #include "afsincludes.h" /* Afs-based standard headers */ #include "afs/afs_stats.h" /* statistics */ diff --git a/src/afs/afs_nfsclnt.c b/src/afs/afs_nfsclnt.c index 94b76230cc..5fe7a9b35d 100644 --- a/src/afs/afs_nfsclnt.c +++ b/src/afs/afs_nfsclnt.c @@ -206,11 +206,7 @@ afs_nfsclient_reqhandler(struct afs_exporter *exporter, uid = (*cred)->cr_uid; #endif /* Do this early, so pag management knows */ -#ifdef AFS_OSF_ENV - (*cred)->cr_ruid = NFSXLATOR_CRED; /* Identify it as nfs xlator call */ -#else (*cred)->cr_rgid = NFSXLATOR_CRED; /* Identify it as nfs xlator call */ -#endif if ((afs_nfsexporter->exp_states & EXP_CLIPAGS) && pag != NOPAG) { uid = pag; } else if (pag != NOPAG) { @@ -246,11 +242,7 @@ afs_nfsclient_reqhandler(struct afs_exporter *exporter, * that the translator rebooted and therefore we ignore all older * pag values */ -#ifdef AFS_OSF_ENV - if (code = setpag(u.u_procp, cred, -1, &pag, 0)) { /* XXX u.u_procp is a no-op XXX */ -#else if ((code = setpag(cred, -1, &pag, 0))) { -#endif if (au) afs_PutUser(au, READ_LOCK); /* ReleaseWriteLock(&afs_xnfsreq); */ @@ -264,11 +256,7 @@ afs_nfsclient_reqhandler(struct afs_exporter *exporter, np->client_uid = (*cred)->cr_uid; } else { if (pag == NOPAG) { -#ifdef AFS_OSF_ENV - if (code = setpag(u.u_procp, cred, np->pag, &pag, 0)) { /* XXX u.u_procp is a no-op XXX */ -#else if ((code = setpag(cred, np->pag, &pag, 0))) { -#endif afs_PutNfsClientPag(np); /* ReleaseWriteLock(&afs_xnfsreq); */ #if defined(KERNEL_HAVE_UERROR) @@ -281,11 +269,7 @@ afs_nfsclient_reqhandler(struct afs_exporter *exporter, tnp = (struct nfsclientpag *)au->exporter; if (tnp->uid && (tnp->uid != (afs_int32) - 2)) { /* allow "root" initiators */ /* Pag doesn't belong to caller; treat it as an unpaged call too */ -#ifdef AFS_OSF_ENV - if (code = setpag(u.u_procp, cred, np->pag, &pag, 0)) { /* XXX u.u_procp is a no-op XXX */ -#else if ((code = setpag(cred, np->pag, &pag, 0))) { -#endif afs_PutNfsClientPag(np); afs_PutUser(au, READ_LOCK); /* ReleaseWriteLock(&afs_xnfsreq); */ diff --git a/src/afs/afs_osi.c b/src/afs/afs_osi.c index 85713a32d6..47ccfcc885 100644 --- a/src/afs/afs_osi.c +++ b/src/afs/afs_osi.c @@ -45,10 +45,6 @@ kmutex_t afs_rxglobal_lock; long afs_global_owner; #endif -#if defined(AFS_OSF_ENV) -simple_lock_data_t afs_global_lock; -#endif - #if defined(AFS_DARWIN_ENV) #ifdef AFS_DARWIN80_ENV lck_mtx_t *afs_global_lock; @@ -65,9 +61,9 @@ afs_proc_t *afs_global_owner; struct mtx afs_global_mtx; #endif -#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) +#if defined(AFS_DARWIN_ENV) thread_t afs_global_owner; -#endif /* AFS_OSF_ENV */ +#endif /* AFS_DARWIN_ENV */ #if defined(AFS_AIX41_ENV) simple_lock_data afs_global_lock; @@ -85,9 +81,6 @@ osi_Init(void) #if defined(AFS_GLOBAL_SUNLOCK) #if defined(AFS_SGI62_ENV) mutex_init(&afs_global_lock, MUTEX_DEFAULT, "afs_global_lock"); -#elif defined(AFS_OSF_ENV) - usimple_lock_init(&afs_global_lock); - afs_global_owner = (thread_t) 0; #elif defined(AFS_FBSD50_ENV) #if defined(AFS_FBSD80_ENV) && defined(WITNESS) /* "lock_initalized" (sic) can panic, checks a flag bit diff --git a/src/afs/afs_osi.h b/src/afs/afs_osi.h index 5ecfe98ea4..66c2e058e7 100644 --- a/src/afs/afs_osi.h +++ b/src/afs/afs_osi.h @@ -311,7 +311,7 @@ typedef struct timeval osi_timeval_t; AFS_GLOCK(); \ } while(0) #else -#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) +#if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) #define AFS_UIOMOVE(SRC,LEN,RW,UIO,CODE) \ do { \ int haveGlock = ISAFS_GLOCK(); \ @@ -358,20 +358,18 @@ typedef struct timeval osi_timeval_t; uio_setrw((UIO),(RW)); \ CODE = uiomove((SRC),(LEN),(UIO)); \ } while(0) -#else /* AFS_OSF_ENV || AFS_FBSD_ENV */ -#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) +#elif defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) #define AFS_UIOMOVE(SRC,LEN,RW,UIO,CODE) \ do { \ (UIO)->uio_rw = (RW); \ CODE = uiomove((SRC),(LEN),(UIO)); \ } while(0) -#else /* AFS_OSF_ENV || AFS_FBSD_ENV */ +#else #define AFS_UIOMOVE(SRC,LEN,RW,UIO,CODE) \ do { \ CODE = uiomove((SRC),(LEN),(RW),(UIO)); \ } while(0) -#endif /* AFS_OSF_ENV || AFS_FBSD_ENV */ -#endif /* AFS_DARWIN80_ENV */ +#endif #endif /* AFS_GLOBAL_SUNLOCK */ diff --git a/src/afs/afs_osi_gcpags.c b/src/afs/afs_osi_gcpags.c index 54c4c98dcb..40f3171797 100644 --- a/src/afs/afs_osi_gcpags.c +++ b/src/afs/afs_osi_gcpags.c @@ -181,31 +181,6 @@ afs_osi_TraverseProcTable(void) } #endif -#if defined(AFS_OSF_ENV) - -#ifdef AFS_DUX50_ENV -extern struct pid_entry *pidtab; -extern int npid; -#endif - -void -afs_osi_TraverseProcTable(void) -{ - struct pid_entry *pe; -#ifdef AFS_DUX50_ENV -#define pidNPID (pidtab + npid) -#define PID_LOCK() -#define PID_UNLOCK() -#endif - PID_LOCK(); - for (pe = pidtab; pe < pidNPID; ++pe) { - if (pe->pe_proc != PROC_NULL) - afs_GCPAGs_perproc_func(pe->pe_proc); - } - PID_UNLOCK(); -} -#endif - #if (defined(AFS_DARWIN_ENV) && !defined(AFS_DARWIN80_ENV)) || defined(AFS_FBSD_ENV) void afs_osi_TraverseProcTable(void) @@ -436,22 +411,6 @@ afs_osi_proc2cred(afs_proc_t * pproc) return pcred; } -#elif defined(AFS_OSF_ENV) -const afs_ucred_t * -afs_osi_proc2cred(afs_proc_t * pr) -{ - afs_ucred_t *rv = NULL; - - if (pr == NULL) { - return NULL; - } - - if ((pr->p_stat == SSLEEP) || (pr->p_stat == SRUN) - || (pr->p_stat == SSTOP)) - rv = pr->p_rcred; - - return rv; -} #elif defined(AFS_DARWIN80_ENV) const afs_ucred_t * afs_osi_proc2cred(afs_proc_t * pr) diff --git a/src/afs/afs_osi_pag.c b/src/afs/afs_osi_pag.c index 7d9e540232..1bedaea556 100644 --- a/src/afs/afs_osi_pag.c +++ b/src/afs/afs_osi_pag.c @@ -191,7 +191,7 @@ afs_pag_wait(afs_ucred_t **acred) int #if defined(AFS_SUN5_ENV) afs_setpag(afs_ucred_t **credpp) -#elif defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) +#elif defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) afs_setpag(afs_proc_t *p, void *args, int *retval) #else afs_setpag(void) @@ -220,7 +220,7 @@ afs_setpag(void) #if defined(AFS_SUN5_ENV) code = AddPag(genpag(), credpp); -#elif defined(AFS_OSF_ENV) || defined(AFS_XBSD_ENV) +#elif defined(AFS_XBSD_ENV) code = AddPag(p, genpag(), &p->p_rcred); #elif defined(AFS_AIX41_ENV) { @@ -293,7 +293,7 @@ afs_setpag(void) int #if defined(AFS_SUN5_ENV) afs_setpag_val(afs_ucred_t **credpp, int pagval) -#elif defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) +#elif defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) afs_setpag_val(afs_proc_t *p, void *args, int *retval, int pagval) #else afs_setpag_val(int pagval) @@ -321,7 +321,7 @@ afs_setpag_val(int pagval) #if defined(AFS_SUN5_ENV) code = AddPag(pagval, credpp); -#elif defined(AFS_OSF_ENV) || defined(AFS_XBSD_ENV) +#elif defined(AFS_XBSD_ENV) code = AddPag(p, pagval, &p->p_rcred); #elif defined(AFS_AIX41_ENV) { @@ -399,7 +399,7 @@ afs_getpag_val(void) /* Note - needs to be available on AIX, others can be static - rework this */ -#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) +#if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) int AddPag(afs_proc_t *p, afs_int32 aval, afs_ucred_t **credpp) #else @@ -411,7 +411,7 @@ AddPag(afs_int32 aval, afs_ucred_t **credpp) afs_uint32 newpag; AFS_STATCNT(AddPag); -#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) +#if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) if ((code = setpag(p, credpp, aval, &newpag, 0))) #else if ((code = setpag(credpp, aval, &newpag, 0))) @@ -575,7 +575,7 @@ PagInCred(afs_ucred_t *cred) pag = NOPAG; goto out; } -#elif defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_DUX40_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_XBSD_ENV) +#elif defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_XBSD_ENV) #if defined(AFS_SUN510_ENV) if (ngroups < 2) { #else @@ -605,7 +605,7 @@ PagInCred(afs_ucred_t *cred) #else pag = (afs_int32) afs_get_pag_from_groups(g0, g1); #endif -#if defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_DUX40_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_XBSD_ENV) +#if defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_XBSD_ENV) out: #endif #if defined(AFS_LINUX26_ENV) && defined(LINUX_KEYRING_SUPPORT) diff --git a/src/afs/afs_osi_vget.c b/src/afs/afs_osi_vget.c index afc91ee848..b79a3abb16 100644 --- a/src/afs/afs_osi_vget.c +++ b/src/afs/afs_osi_vget.c @@ -34,9 +34,6 @@ afs_osi_vget(struct vcache **avcpp, struct fid *afidp, struct vrequest *areqp) afs_int32 ret; memcpy((char *)&Sfid, afidp->fid_data, SIZEOF_SMALLFID); -#ifdef AFS_OSF_ENV - Sfid.Vnode = afidp->fid_reserved; -#endif /* Need to extract fid from SmallFid. Will need a wild card option for * finding the right vcache entry. diff --git a/src/afs/afs_osi_vm.c b/src/afs/afs_osi_vm.c index 25b370ed8f..29e2675fed 100644 --- a/src/afs/afs_osi_vm.c +++ b/src/afs/afs_osi_vm.c @@ -22,7 +22,7 @@ int osi_Active(register struct vcache *avc) { AFS_STATCNT(osi_Active); -#if defined(AFS_AIX_ENV) || defined(AFS_OSF_ENV) || defined(AFS_SUN5_ENV) || (AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) +#if defined(AFS_AIX_ENV) || defined(AFS_SUN5_ENV) || (AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) if ((avc->opens > 0) || (avc->f.states & CMAPPED)) return 1; /* XXX: Warning, verify this XXX */ #elif defined(AFS_SGI_ENV) diff --git a/src/afs/afs_osidnlc.c b/src/afs/afs_osidnlc.c index 5a5b8feec1..83bc793079 100644 --- a/src/afs/afs_osidnlc.c +++ b/src/afs/afs_osidnlc.c @@ -266,10 +266,7 @@ osi_dnlc_lookup(struct vcache *adp, char *aname, int locktype) ma_critical_exit(); return 0; } -#ifdef AFS_OSF_ENV - VN_HOLD((vnode_t *) tvc); -#else -#ifdef AFS_DARWIN80_ENV +#if defined(AFS_DARWIN80_ENV) tvp = AFSTOV(tvc); if (vnode_get(tvp)) { ReleaseReadLock(&afs_xvcache); @@ -288,16 +285,13 @@ osi_dnlc_lookup(struct vcache *adp, char *aname, int locktype) ma_critical_exit(); return 0; } -#else -#ifdef AFS_FBSD50_ENV +#elif defined(AFS_FBSD50_ENV) /* can't sleep in a critical section */ ma_critical_exit(); osi_vnhold(tvc, 0); ma_critical_enter(); #else osi_vnhold(tvc, 0); -#endif /* AFS_FBSD80_ENV */ -#endif #endif ReleaseReadLock(&afs_xvcache); diff --git a/src/afs/afs_pag_cred.c b/src/afs/afs_pag_cred.c index b4223f9f3c..ad3237aa33 100644 --- a/src/afs/afs_pag_cred.c +++ b/src/afs/afs_pag_cred.c @@ -172,22 +172,18 @@ int afspag_PSetTokens(char *ain, afs_int32 ainSize, afs_ucred_t **acred) if (!tcell) return ESRCH; if (set_parent_pag) { #if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) -#if defined(AFS_DARWIN_ENV) +# if defined(AFS_DARWIN_ENV) afs_proc_t *p = current_proc(); /* XXX */ -#else +# else afs_proc_t *p = curproc; /* XXX */ -#endif -#ifndef AFS_DARWIN80_ENV +# endif +# ifndef AFS_DARWIN80_ENV uprintf("Process %d (%s) tried to change pags in PSetTokens\n", p->p_pid, p->p_comm); -#endif +# endif setpag(p, acred, -1, &pag, 1); -#else -#ifdef AFS_OSF_ENV - setpag(u.u_procp, acred, -1, &pag, 1); /* XXX u.u_procp is a no-op XXX */ #else setpag(acred, -1, &pag, 1); -#endif #endif } pag = PagInCred(*acred); diff --git a/src/afs/afs_pioctl.c b/src/afs/afs_pioctl.c index 15140d3d65..4ff344a201 100644 --- a/src/afs/afs_pioctl.c +++ b/src/afs/afs_pioctl.c @@ -381,32 +381,32 @@ afs_ioctl(OSI_VN_DECL(tvc), int cmd, void *arg, int flag, cred_t * cr, */ /* AFS_HPUX102 and up uses VNODE ioctl instead */ #if !defined(AFS_HPUX102_ENV) && !defined(AFS_DARWIN80_ENV) -#if !defined(AFS_SGI_ENV) -#ifdef AFS_AIX32_ENV -#ifdef AFS_AIX51_ENV -#ifdef __64BIT__ +# if !defined(AFS_SGI_ENV) +# ifdef AFS_AIX32_ENV +# ifdef AFS_AIX51_ENV +# ifdef __64BIT__ int kioctl(int fdes, int com, caddr_t arg, caddr_t ext, caddr_t arg2, caddr_t arg3) -#else /* __64BIT__ */ +# else /* __64BIT__ */ int kioctl32(int fdes, int com, caddr_t arg, caddr_t ext, caddr_t arg2, caddr_t arg3) -#endif /* __64BIT__ */ -#else +# endif /* __64BIT__ */ +# else int kioctl(int fdes, int com, caddr_t arg, caddr_t ext) -#endif +# endif { struct a { int fd, com; caddr_t arg, ext; -#ifdef AFS_AIX51_ENV +# ifdef AFS_AIX51_ENV caddr_t arg2, arg3; -#endif +# endif } u_uap, *uap = &u_uap; -#else -#if defined(AFS_SUN5_ENV) +# else +# if defined(AFS_SUN5_ENV) struct afs_ioctl_sys { int fd; @@ -417,23 +417,14 @@ struct afs_ioctl_sys { int afs_xioctl(struct afs_ioctl_sys *uap, rval_t *rvp) { -#elif defined(AFS_OSF_ENV) -int -afs_xioctl(afs_proc_t *p, void *args, long *retval) -{ - struct a { - long fd; - u_long com; - caddr_t arg; - } *uap = (struct a *)args; -#elif defined(AFS_FBSD50_ENV) -#define arg data +# elif defined(AFS_FBSD50_ENV) +# define arg data int afs_xioctl(struct thread *td, register struct ioctl_args *uap, register_t *retval) { afs_proc_t *p = td->td_proc; -#elif defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) +# elif defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) struct ioctl_args { int fd; u_long com; @@ -443,7 +434,7 @@ struct ioctl_args { int afs_xioctl(afs_proc_t *p, register struct ioctl_args *uap, register_t *retval) { -#elif defined(AFS_LINUX22_ENV) +# elif defined(AFS_LINUX22_ENV) struct afs_ioctl_sys { unsigned int com; unsigned long arg; @@ -453,7 +444,7 @@ afs_xioctl(struct inode *ip, struct file *fp, unsigned int com, unsigned long arg) { struct afs_ioctl_sys ua, *uap = &ua; -#else +# else int afs_xioctl(void) { @@ -462,88 +453,84 @@ afs_xioctl(void) int com; caddr_t arg; } *uap = (struct a *)u.u_ap; -#endif /* AFS_SUN5_ENV */ -#endif -#if defined(AFS_AIX32_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) +# endif /* AFS_SUN5_ENV */ +# endif +# if defined(AFS_AIX32_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_DARWIN_ENV) struct file *fd; -#elif !defined(AFS_LINUX22_ENV) +# elif !defined(AFS_LINUX22_ENV) register struct file *fd; -#endif -#if defined(AFS_XBSD_ENV) +# endif +# if defined(AFS_XBSD_ENV) register struct filedesc *fdp; -#endif +# endif register struct vcache *tvc; register int ioctlDone = 0, code = 0; AFS_STATCNT(afs_xioctl); -#if defined(AFS_DARWIN_ENV) +# if defined(AFS_DARWIN_ENV) if ((code = fdgetf(p, uap->fd, &fd))) return code; -#elif defined(AFS_XBSD_ENV) +# elif defined(AFS_XBSD_ENV) fdp = p->p_fd; if ((u_int) uap->fd >= fdp->fd_nfiles || (fd = fdp->fd_ofiles[uap->fd]) == NULL) return EBADF; if ((fd->f_flag & (FREAD | FWRITE)) == 0) return EBADF; -#elif defined(AFS_LINUX22_ENV) +# elif defined(AFS_LINUX22_ENV) ua.com = com; ua.arg = arg; -#elif defined(AFS_AIX32_ENV) +# elif defined(AFS_AIX32_ENV) uap->fd = fdes; uap->com = com; uap->arg = arg; -#ifdef AFS_AIX51_ENV +# ifdef AFS_AIX51_ENV uap->arg2 = arg2; uap->arg3 = arg3; -#endif +# endif if (setuerror(getf(uap->fd, &fd))) { return -1; } -#elif defined(AFS_OSF_ENV) - fd = NULL; - if (code = getf(&fd, uap->fd, FILE_FLAGS_NULL, &u.u_file_state)) - return code; -#elif defined(AFS_SUN5_ENV) -# if defined(AFS_SUN57_ENV) +# elif defined(AFS_SUN5_ENV) +# if defined(AFS_SUN57_ENV) fd = getf(uap->fd); if (!fd) return (EBADF); -# elif defined(AFS_SUN54_ENV) +# elif defined(AFS_SUN54_ENV) fd = GETF(uap->fd); if (!fd) return (EBADF); -# else +# else if (code = getf(uap->fd, &fd)) { return (code); } -# endif /* AFS_SUN57_ENV */ -#else +# endif /* AFS_SUN57_ENV */ +# else fd = getf(uap->fd); if (!fd) return (EBADF); -#endif +# endif /* first determine whether this is any sort of vnode */ -#if defined(AFS_LINUX22_ENV) +# if defined(AFS_LINUX22_ENV) tvc = VTOAFS(ip); { -#else -#ifdef AFS_SUN5_ENV +# else +# ifdef AFS_SUN5_ENV if (fd->f_vnode->v_type == VREG || fd->f_vnode->v_type == VDIR) { -#else +# else if (fd->f_type == DTYPE_VNODE) { -#endif +# endif /* good, this is a vnode; next see if it is an AFS vnode */ -#if defined(AFS_AIX32_ENV) || defined(AFS_SUN5_ENV) +# if defined(AFS_AIX32_ENV) || defined(AFS_SUN5_ENV) tvc = VTOAFS(fd->f_vnode); /* valid, given a vnode */ -#elif defined(AFS_OBSD_ENV) +# elif defined(AFS_OBSD_ENV) tvc = IsAfsVnode((struct vnode *)fd-> f_data) ? VTOAFS((struct vnode *)fd->f_data) : NULL; -#else +# else tvc = VTOAFS((struct vnode *)fd->f_data); /* valid, given a vnode */ -#endif -#endif /* AFS_LINUX22_ENV */ +# endif +# endif /* AFS_LINUX22_ENV */ if (tvc && IsAfsVnode(AFSTOV(tvc))) { /* This is an AFS vnode */ if (((uap->com >> 8) & 0xff) == 'V') { @@ -555,135 +542,102 @@ afs_xioctl(void) if (code) { osi_FreeSmallSpace(datap); AFS_GUNLOCK(); -#if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) - return code; -#else -#if defined(AFS_SUN5_ENV) -#ifdef AFS_SUN54_ENV - releasef(uap->fd); -#else - releasef(fd); -#endif - return (EFAULT); -#else -#ifdef AFS_OSF_ENV -#ifdef AFS_OSF30_ENV - FP_UNREF_ALWAYS(fd); -#else - FP_UNREF(fd); -#endif - return code; -#else /* AFS_OSF_ENV */ -#ifdef AFS_AIX41_ENV +# if defined(AFS_AIX41_ENV) ufdrele(uap->fd); -#endif -#ifdef AFS_LINUX22_ENV +# elif defined(AFS_SUN54_ENV) + releasef(uap->fd); +# elif defined(AFS_SUN5_ENV) + releasef(fd); +# endif + +# if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) + return code; +# elif defined(AFS_SUN5_ENV) + return (EFAULT); +# elif defined(AFS_LINUX22_ENV) return -code; -#else +# else return (setuerror(code), code); -#endif -#endif -#endif -#endif +# endif } code = HandleIoctl(tvc, uap->com, datap); osi_FreeSmallSpace(datap); AFS_GUNLOCK(); ioctlDone = 1; -#ifdef AFS_AIX41_ENV +# if defined(AFS_AIX41_ENV) ufdrele(uap->fd); -#endif -#ifdef AFS_OSF_ENV -#ifdef AFS_OSF30_ENV - FP_UNREF_ALWAYS(fd); -#else - FP_UNREF(fd); -#endif -#endif +# endif } -#if defined(AFS_LINUX22_ENV) +# if defined(AFS_LINUX22_ENV) else code = EINVAL; -#endif +# endif } } if (!ioctlDone) { -#ifdef AFS_AIX41_ENV +# if defined(AFS_AIX41_ENV) ufdrele(uap->fd); -#ifdef AFS_AIX51_ENV -#ifdef __64BIT__ +# ifdef AFS_AIX51_ENV +# ifdef __64BIT__ code = okioctl(fdes, com, arg, ext, arg2, arg3); -#else /* __64BIT__ */ +# else /* __64BIT__ */ code = okioctl32(fdes, com, arg, ext, arg2, arg3); -#endif /* __64BIT__ */ -#else /* !AFS_AIX51_ENV */ +# endif /* __64BIT__ */ +# else /* !AFS_AIX51_ENV */ code = okioctl(fdes, com, arg, ext); -#endif /* AFS_AIX51_ENV */ +# endif /* AFS_AIX51_ENV */ return code; -#else /* !AFS_AIX41_ENV */ -#ifdef AFS_AIX32_ENV +# elif defined(AFS_AIX32_ENV) okioctl(fdes, com, arg, ext); -#elif defined(AFS_SUN5_ENV) -#if defined(AFS_SUN57_ENV) +# elif defined(AFS_SUN5_ENV) +# if defined(AFS_SUN57_ENV) releasef(uap->fd); -#elif defined(AFS_SUN54_ENV) +# elif defined(AFS_SUN54_ENV) RELEASEF(uap->fd); -#else +# else releasef(fd); -#endif +# endif code = ioctl(uap, rvp); -#elif defined(AFS_FBSD50_ENV) +# elif defined(AFS_FBSD50_ENV) return ioctl(td, uap); -#elif defined(AFS_FBSD_ENV) +# elif defined(AFS_FBSD_ENV) return ioctl(p, uap); -#elif defined(AFS_OBSD_ENV) +# elif defined(AFS_OBSD_ENV) code = sys_ioctl(p, uap, retval); -#elif defined(AFS_DARWIN_ENV) +# elif defined(AFS_DARWIN_ENV) return ioctl(p, uap, retval); -#elif defined(AFS_OSF_ENV) - code = ioctl(p, args, retval); -#ifdef AFS_OSF30_ENV - FP_UNREF_ALWAYS(fd); -#else - FP_UNREF(fd); -#endif - return code; -#elif !defined(AFS_LINUX22_ENV) +# elif !defined(AFS_LINUX22_ENV) ioctl(); -#endif -#endif +# endif } -#ifdef AFS_SUN5_ENV +# ifdef AFS_SUN5_ENV if (ioctlDone) -#ifdef AFS_SUN54_ENV +# ifdef AFS_SUN54_ENV releasef(uap->fd); -#else +# else releasef(fd); -#endif +# endif return (code); -#else -#ifdef AFS_LINUX22_ENV +# elif defined(AFS_LINUX22_ENV) return -code; -#else -#if defined(KERNEL_HAVE_UERROR) +# elif defined(KERNEL_HAVE_UERROR) if (!getuerror()) setuerror(code); -#if defined(AFS_AIX32_ENV) && !defined(AFS_AIX41_ENV) +# if defined(AFS_AIX32_ENV) && !defined(AFS_AIX41_ENV) return (getuerror()? -1 : u.u_ioctlrv); -#else +# else return getuerror()? -1 : 0; -#endif -#endif -#endif /* AFS_LINUX22_ENV */ -#endif /* AFS_SUN5_ENV */ -#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) +# endif +# endif + +# if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) return (code); -#else +# else return 0; -#endif +# endif } -#endif /* AFS_SGI_ENV */ +# endif /* AFS_SGI_ENV */ #endif /* AFS_HPUX102_ENV */ #if defined(AFS_SGI_ENV) @@ -704,25 +658,11 @@ afs_pioctl(struct pioctlargs *uap, rval_t * rvp) AFS_GLOCK(); code = afs_syscall_pioctl(uap->path, uap->cmd, uap->cmarg, uap->follow); AFS_GUNLOCK(); -#ifdef AFS_SGI64_ENV +# ifdef AFS_SGI64_ENV return code; -#else +# else return u.u_error; -#endif -} - -#elif defined(AFS_OSF_ENV) -afs_pioctl(afs_proc_t *p, void *args, int *retval) -{ - struct a { - char *path; - int cmd; - caddr_t cmarg; - int follow; - } *uap = (struct a *)args; - - AFS_STATCNT(afs_pioctl); - return (afs_syscall_pioctl(uap->path, uap->cmd, uap->cmarg, uap->follow)); +# endif } #elif defined(AFS_FBSD50_ENV) @@ -753,15 +693,15 @@ afs_pioctl(afs_proc_t *p, void *args, int *retval) } *uap = (struct a *)args; AFS_STATCNT(afs_pioctl); -#ifdef AFS_DARWIN80_ENV +# ifdef AFS_DARWIN80_ENV return (afs_syscall_pioctl (uap->path, uap->cmd, uap->cmarg, uap->follow, kauth_cred_get())); -#else +# else return (afs_syscall_pioctl (uap->path, uap->cmd, uap->cmarg, uap->follow, p->p_cred->pc_ucred)); -#endif +# endif } #endif @@ -1566,22 +1506,18 @@ DECL_PIOCTL(PSetTokens) if (set_parent_pag) { afs_uint32 pag; #if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) -#if defined(AFS_DARWIN_ENV) +# if defined(AFS_DARWIN_ENV) afs_proc_t *p = current_proc(); /* XXX */ -#else +# else afs_proc_t *p = curproc; /* XXX */ -#endif -#ifndef AFS_DARWIN80_ENV +# endif +# ifndef AFS_DARWIN80_ENV uprintf("Process %d (%s) tried to change pags in PSetTokens\n", p->p_pid, p->p_comm); -#endif +# endif if (!setpag(p, acred, -1, &pag, 1)) { -#else -#ifdef AFS_OSF_ENV - if (!setpag(u.u_procp, acred, -1, &pag, 1)) { /* XXX u.u_procp is a no-op XXX */ #else if (!setpag(acred, -1, &pag, 1)) { -#endif #endif afs_InitReq(&treq, *acred); areq = &treq; @@ -3050,10 +2986,9 @@ DECL_PIOCTL(PFlushVolumeData) goto loop; } #endif -#if defined(AFS_SGI_ENV) || defined(AFS_OSF_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_HPUX_ENV) || defined(AFS_LINUX20_ENV) +#if defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_HPUX_ENV) || defined(AFS_LINUX20_ENV) VN_HOLD(AFSTOV(tvc)); -#else -#ifdef AFS_DARWIN80_ENV +#elif defined(AFS_DARWIN80_ENV) vp = AFSTOV(tvc); if (vnode_get(vp)) continue; @@ -3063,13 +2998,10 @@ DECL_PIOCTL(PFlushVolumeData) AFS_GLOCK(); continue; } -#else -#if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) +#elif defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) osi_vnhold(tvc, 0); #else VREFCOUNT_INC(tvc); /* AIX, apparently */ -#endif -#endif #endif ReleaseReadLock(&afs_xvcache); #ifdef AFS_BOZONLOCK_ENV @@ -4074,9 +4006,6 @@ HandleClientContext(struct afs_ioctl *ablob, int *com, for (i = 2; i < NGROUPS; i++) newcred->cr_groups[i] = NOGROUP; #endif -#endif -#if !defined(AFS_OSF_ENV) - afs_nfsclient_init(); /* before looking for exporter, ensure one exists */ #endif if (!(exporter = exporter_find(exporter_type))) { /* Exporter wasn't initialized or an invalid exporter type */ diff --git a/src/afs/afs_prototypes.h b/src/afs/afs_prototypes.h index abde0ffddf..fde30dcbe2 100644 --- a/src/afs/afs_prototypes.h +++ b/src/afs/afs_prototypes.h @@ -569,7 +569,7 @@ extern void shutdown_osinet(void); /* afs_osi_pag.c */ #if defined(AFS_SUN5_ENV) extern int afs_setpag(afs_ucred_t **credpp); -#elif defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) +#elif defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) extern int afs_setpag(afs_proc_t *p, void *args, int *retval); #else extern int afs_setpag(void); @@ -577,7 +577,7 @@ extern int afs_setpag(void); extern afs_uint32 genpag(void); extern afs_uint32 getpag(void); -#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) +#if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) extern int AddPag(afs_proc_t *p, afs_int32 aval, afs_ucred_t **credpp); #else extern int AddPag(afs_int32 aval, afs_ucred_t **credpp); @@ -661,7 +661,7 @@ extern int afs_syscall_iincdec(dev_t, int, int, int, rval_t *, extern int afs_syscall_icreate(afs_uint32, afs_uint32, afs_uint32, afs_uint32, afs_uint32, afs_uint32, rval_t *); extern int afs_syscall_iopen(int, ino_t, int, rval_t *); extern int afs_syscall_iincdec(int, int, int, int); -#elif defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) +#elif defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) extern int afs_syscall_icreate(long, long, long, long, long, long, long*); extern int afs_syscall_iopen(int dev, int inode, int usrmod, long *retval); extern int afs_syscall_iincdec(int dev, int inode, int inode_p1, int amount); @@ -726,17 +726,6 @@ extern void osi_VM_PreTruncate(struct vcache *avc, int alen, /* ARCH/osi_vnodeops.c */ extern struct vnodeops Afs_vnodeops; -#if defined(AFS_OSF_ENV) -#if defined(AFS_OSF30_ENV) -extern int max_vnodes; /* number of total system vnodes */ -#else -extern int nvnode; /* number of total system vnodes */ -extern int numvnodes; /* number vnodes in use now */ -#endif -#ifdef AFS_DUX40_ENV -extern struct vfs_ubcops afs_ubcops; -#endif -#endif extern int afs_inactive(struct vcache *avc, afs_ucred_t *acred); /* afs_osifile.c */ @@ -746,7 +735,7 @@ extern afs_uint32 pag_epoch; extern afs_uint32 pagCounter; /* OS/osi_vfsops.c */ -#if defined(AFS_OSF_ENV) || defined(AFS_XBSD_ENV) || defined(AFS_DARWIN_ENV) +#if defined(AFS_XBSD_ENV) || defined(AFS_DARWIN_ENV) extern struct mount *afs_globalVFS; #else extern struct vfs *afs_globalVFS; @@ -1077,9 +1066,6 @@ extern int afs_setattr(OSI_VC_DECL(avc), register struct vattr *attrs, #endif /* VNOPS/afs_vnop_create.c */ -#ifdef AFS_OSF_ENV -extern int afs_create(struct nameidata *ndp, struct vattr *attrs); -#else /* AFS_OSF_ENV */ #ifdef AFS_SGI64_ENV extern int afs_create(OSI_VC_DECL(adp), char *aname, struct vattr *attrs, int flags, int amode, struct vcache **avcp, @@ -1089,7 +1075,6 @@ extern int afs_create(OSI_VC_DECL(adp), char *aname, struct vattr *attrs, enum vcexcl aexcl, int amode, struct vcache **avcp, afs_ucred_t *acred); #endif /* AFS_SGI64_ENV */ -#endif /* AFS_OSF_ENV */ extern int afs_LocalHero(register struct vcache *avc, register struct dcache *adc, register AFSFetchStatus * astat, register int aincr); @@ -1110,7 +1095,7 @@ struct fid; #if !defined(AFS_ATHENA_ENV) #ifdef AFS_AIX41_ENV int afs_fid(OSI_VC_DECL(avc), struct fid *fidpp, struct ucred *credp); -#elif defined(AFS_OSF_ENV) || defined(AFS_SUN54_ENV) +#elif defined(AFS_SUN54_ENV) int afs_fid(OSI_VC_DECL(avc), struct fid *fidpp); #else int afs_fid(OSI_VC_DECL(avc), struct fid **fidpp); @@ -1125,10 +1110,7 @@ extern void lockIdSet(struct AFS_FLOCK *flock, struct SimpleLocks *slp, extern int HandleFlock(register struct vcache *avc, int acom, struct vrequest *areq, pid_t clid, int onlymine); -#ifdef AFS_OSF_ENV -extern int afs_lockctl(struct vcache * avc, struct eflock * af, int flag, - afs_ucred_t * acred, pid_t clid, off_t offset); -#elif defined(AFS_SGI_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) +#if defined(AFS_SGI_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) extern int afs_lockctl(struct vcache * avc, struct AFS_FLOCK * af, int acmd, afs_ucred_t * acred, pid_t clid); #else @@ -1164,10 +1146,8 @@ extern int Next_AtSys(register struct vcache *avc, struct vrequest *areq, struct sysname_info *state); extern int afs_DoBulkStat(struct vcache *adp, long dirCookie, struct vrequest *areqp); -#ifdef AFS_OSF_ENV -extern int afs_lookup(OSI_VC_DECL(adp), char *aname, struct vcache **avcp, - afs_ucred_t *acred, int opflag, int wantparent); -#elif defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) + +#if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) extern int afs_lookup(OSI_VC_DECL(adp), char *aname, struct vcache **avcp, struct pathname *pnp, int flags, struct vnode *rdir, afs_ucred_t *acred); @@ -1205,7 +1185,7 @@ extern void afs_PrefetchChunk(struct vcache *avc, struct dcache *adc, /* VNOPS/afs_vnop_readdir.c */ extern int afs_rd_stash_i; -#if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) || defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) +#if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) extern int afs_readdir(OSI_VC_DECL(avc), struct uio *auio, afs_ucred_t *acred, int *eofp); #elif defined(AFS_HPUX100_ENV) @@ -1238,7 +1218,7 @@ extern int afs_rename(OSI_VC_DECL(aodp), char *aname1, struct vcache *andp, #endif /* VNOPS/afs_vnop_strategy.c */ -#if defined(AFS_SUN5_ENV) || defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) +#if defined(AFS_SUN5_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) extern int afs_ustrategy(register struct buf *adp, afs_ucred_t *credp); #else extern int afs_ustrategy(register struct buf *adp); @@ -1285,10 +1265,7 @@ extern int afs_close(OSI_VC_DECL(avc), afs_int32 aflags, afs_ucred_t *acred); #endif -#ifdef AFS_OSF_ENV -extern int afs_fsync(OSI_VC_DECL(avc), int fflags, afs_ucred_t *acred, - int waitfor); -#elif defined(AFS_SGI65_ENV) +#if defined(AFS_SGI65_ENV) extern int afs_fsync(OSI_VC_DECL(avc), int flags, afs_ucred_t *acred, off_t start, off_t stop); #elif defined(AFS_SGI_ENV) || defined(AFS_SUN53_ENV) @@ -1339,7 +1316,7 @@ extern void afs_ntohuuid(afsUUID * uuidp); extern afs_int32 afs_uuid_create(afsUUID * uuid); extern u_short afs_uuid_hash(afsUUID * uuid); -#if defined(AFS_SUN5_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_AIX_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) || defined(AFS_HPUX_ENV) || defined(AFS_SGI62_ENV) || defined(AFS_OSF_ENV) +#if defined(AFS_SUN5_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_AIX_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) || defined(AFS_HPUX_ENV) || defined(AFS_SGI62_ENV) #include "osi_prototypes.h" #endif diff --git a/src/afs/afs_syscall.c b/src/afs/afs_syscall.c index 9f073de68a..04b6e8f8f9 100644 --- a/src/afs/afs_syscall.c +++ b/src/afs/afs_syscall.c @@ -439,7 +439,7 @@ extern int afs_sinited; * to accomodate both, *long* is used instead of afs_int32 */ -#ifdef AFS_SUN57_ENV +# ifdef AFS_SUN57_ENV struct afssysa { long syscall; long parm1; @@ -449,7 +449,7 @@ struct afssysa { long parm5; long parm6; }; -#else +# else struct afssysa { afs_int32 syscall; afs_int32 parm1; @@ -459,13 +459,12 @@ struct afssysa { afs_int32 parm5; afs_int32 parm6; }; -#endif +# endif Afs_syscall(register struct afssysa *uap, rval_t * rvp) { int *retval = &rvp->r_val1; -#else /* AFS_SUN5_ENV */ -#ifdef AFS_DARWIN100_ENV +#elif defined(AFS_DARWIN100_ENV) struct afssysa { afs_int32 syscall; afs_int32 parm1; @@ -489,14 +488,14 @@ afs3_syscall(afs_proc_t *p, void *args, unsigned int *retval) { struct afssysa64 *uap64 = NULL; struct afssysa *uap = NULL; -#elif defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) +#elif defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) int afs3_syscall(p, args, retval) -#ifdef AFS_FBSD50_ENV +# ifdef AFS_FBSD50_ENV struct thread *p; -#else +# else afs_proc_t *p; -#endif +# endif void *args; long *retval; { @@ -509,8 +508,7 @@ afs3_syscall(p, args, retval) long parm5; long parm6; } *uap = (struct a *)args; -#else /* AFS_OSF_ENV */ -#ifdef AFS_LINUX20_ENV +#elif defined(AFS_LINUX20_ENV) struct afssysargs { long syscall; long parm1; @@ -528,12 +526,12 @@ afs_syscall(long syscall, long parm1, long parm2, long parm3, long parm4) long linux_ret = 0; long *retval = &linux_ret; long eparm[4]; /* matches AFSCALL_ICL in fstrace.c */ -#ifdef AFS_SPARC64_LINUX24_ENV +# ifdef AFS_SPARC64_LINUX24_ENV afs_int32 eparm32[4]; -#endif +# endif /* eparm is also used by AFSCALL_CALL in afsd.c */ #else -#if defined(UKERNEL) +# if defined(UKERNEL) int Afs_syscall() { @@ -546,7 +544,7 @@ Afs_syscall() long parm5; long parm6; } *uap = (struct a *)u.u_ap; -#else /* UKERNEL */ +# else /* UKERNEL */ int Afs_syscall() { @@ -559,15 +557,13 @@ Afs_syscall() long parm5; long parm6; } *uap = (struct a *)u.u_ap; -#endif /* UKERNEL */ -#if defined(AFS_HPUX_ENV) +# endif /* UKERNEL */ +# if defined(AFS_HPUX_ENV) long *retval = &u.u_rval1; -#else +# else int *retval = &u.u_rval1; +# endif #endif -#endif /* AFS_LINUX20_ENV */ -#endif /* AFS_OSF_ENV */ -#endif /* AFS_SUN5_ENV */ register int code = 0; AFS_STATCNT(afs_syscall); @@ -679,9 +675,9 @@ Afs_syscall() AFS_GUNLOCK(); #else AFS_GLOCK(); -#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) +#if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) code = afs_setpag(p, args, retval); -#else /* AFS_OSF_ENV */ +#else /* AFS_DARWIN_ENV || AFS_XBSD_ENV */ code = afs_setpag(); #endif AFS_GUNLOCK(); @@ -731,7 +727,7 @@ Afs_syscall() afs_syscall_icreate(uap->parm1, uap->parm2, iparams.param1, iparams.param2, iparams.param3, iparams.param4 -#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) +#if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) , retval #endif ); @@ -744,7 +740,7 @@ Afs_syscall() CRED()); #else code = afs_syscall_iopen(uap->parm1, uap->parm2, uap->parm3 -#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) +#if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) , retval #endif ); diff --git a/src/afs/afs_util.c b/src/afs/afs_util.c index fb42f9e954..9855008d0e 100644 --- a/src/afs/afs_util.c +++ b/src/afs/afs_util.c @@ -215,14 +215,10 @@ afs_CheckLocks(void) for (i = 0; i < VCSIZE; i++) { for (tvc = afs_vhashT[i]; tvc; tvc = tvc->hnext) { if (tvc->f.states & CVInit) continue; -#ifdef AFS_OSF_ENV - if (VREFCOUNT(tvc) > 1) -#else /* AFS_OSF_ENV */ #ifdef AFS_DARWIN80_ENV if (vnode_isinuse(AFSTOV(tvc), 0)) #else if (VREFCOUNT(tvc)) -#endif #endif afs_warn("Stat cache entry at %x is held\n", tvc); if (CheckLock(&tvc->lock)) @@ -290,11 +286,7 @@ int afs_noop(void) { AFS_STATCNT(afs_noop); -#ifdef AFS_OSF30_ENV - return (EOPNOTSUPP); -#else return EINVAL; -#endif } int diff --git a/src/afs/afs_vcache.c b/src/afs/afs_vcache.c index 6d69b07d6d..899cdf8c64 100644 --- a/src/afs/afs_vcache.c +++ b/src/afs/afs_vcache.c @@ -47,10 +47,10 @@ #include "afs/afs_cbqueue.h" #include "afs/afs_osidnlc.h" -#if defined(AFS_OSF_ENV) || defined(AFS_LINUX22_ENV) +#if defined(AFS_LINUX22_ENV) afs_int32 afs_maxvcount = 0; /* max number of vcache entries */ afs_int32 afs_vcount = 0; /* number of vcache in use now */ -#endif /* AFS_OSF_ENV */ +#endif /* AFS_LINUX22_ENV */ #ifdef AFS_SGI_ENV int afsvnumbers = 0; @@ -149,11 +149,6 @@ afs_FlushVCache(struct vcache *avc, int *slept) AFS_STATCNT(afs_FlushVCache); afs_Trace2(afs_iclSetp, CM_TRACE_FLUSHV, ICL_TYPE_POINTER, avc, ICL_TYPE_INT32, avc->f.states); -#ifdef AFS_OSF_ENV - AFS_GUNLOCK(); - VN_LOCK(AFSTOV(avc)); - AFS_GLOCK(); -#endif code = osi_VM_FlushVCache(avc, slept); if (code) @@ -244,7 +239,7 @@ afs_FlushVCache(struct vcache *avc, int *slept) else afs_evenZaps++; -#if !defined(AFS_OSF_ENV) && !defined(AFS_LINUX22_ENV) +#if !defined(AFS_LINUX22_ENV) /* put the entry in the free list */ avc->nextfree = freeVCList; freeVCList = avc; @@ -257,32 +252,20 @@ afs_FlushVCache(struct vcache *avc, int *slept) afs_vcount--; vSetType(avc, VREG); if (VREFCOUNT_GT(avc,0)) { -#if defined(AFS_OSF_ENV) - VN_UNLOCK(AFSTOV(avc)); -#endif AFS_RELE(AFSTOV(avc)); afs_stats_cmperf.vcacheXAllocs--; } else { if (afs_norefpanic) { printf("flush vc refcnt < 1"); afs_norefpanic++; -#if defined(AFS_OSF_ENV) - (void)vgone(avc, VX_NOSLEEP, NULL); - AFS_GLOCK(); - VN_UNLOCK(AFSTOV(avc)); -#endif } else osi_Panic("flush vc refcnt < 1"); } -#endif /* AFS_OSF_ENV */ +#endif /* AFS_LINUX22_ENV */ return 0; bad: -#ifdef AFS_OSF_ENV - VN_UNLOCK(AFSTOV(avc)); -#endif return code; - } /*afs_FlushVCache */ #ifndef AFS_SGI_ENV @@ -628,7 +611,7 @@ afs_FlushReclaimedVcaches(void) int afs_ShakeLooseVCaches(afs_int32 anumber) { -#if defined(AFS_OSF_ENV) || defined(AFS_LINUX22_ENV) +#if defined(AFS_LINUX22_ENV) afs_int32 i; struct vcache *tvc; struct afs_q *tq, *uq; @@ -726,19 +709,7 @@ static struct vcache * afs_AllocVCache(void) { struct vcache *tvc; -#if defined(AFS_OSF30_ENV) - struct vcache *nvc; - AFS_GUNLOCK(); - if (getnewvnode(MOUNT_AFS, &Afs_vnodeops, &nvc)) { - /* What should we do ???? */ - osi_Panic("afs_AllocVCache: no more vnodes"); - } - AFS_GLOCK(); - - tvc = nvc; - tvc->nextfree = NULL; - afs_vcount++; -#elif defined(AFS_LINUX22_ENV) +#if defined(AFS_LINUX22_ENV) struct inode *ip; AFS_GUNLOCK(); @@ -833,7 +804,7 @@ afs_NewVCache(struct VenusFid *afid, struct server *serverp) #ifdef AFS_AIX_ENV struct gnode *gnodepnt; #endif -#if !defined(AFS_OSF_ENV) && !defined(AFS_LINUX22_ENV) +#if !defined(AFS_LINUX22_ENV) struct afs_q *tq, *uq; int code, fv_slept; #endif @@ -842,7 +813,7 @@ afs_NewVCache(struct VenusFid *afid, struct server *serverp) afs_FlushReclaimedVcaches(); -#if defined(AFS_OSF_ENV) || defined(AFS_LINUX22_ENV) +#if defined(AFS_LINUX22_ENV) if(!afsd_dynamic_vcaches) { afs_ShakeLooseVCaches(anumber); if (afs_vcount >= afs_maxvcount) { @@ -851,7 +822,7 @@ afs_NewVCache(struct VenusFid *afid, struct server *serverp) } } tvc = afs_AllocVCache(); -#else /* AFS_OSF_ENV */ +#else /* AFS_LINUX22_ENV */ /* pull out a free cache entry */ if (!freeVCList) { int loop = 0; @@ -946,14 +917,14 @@ afs_NewVCache(struct VenusFid *afid, struct server *serverp) tvc->nextfree = NULL; } /* end of if (!freeVCList) */ -#endif /* AFS_OSF_ENV */ +#endif /* AFS_LINUX22_ENV */ #if defined(AFS_XBSD_ENV) || defined(AFS_DARWIN_ENV) if (tvc->v) panic("afs_NewVCache(): free vcache with vnode attached"); #endif -#if !defined(AFS_SGI_ENV) && !defined(AFS_OSF_ENV) && !defined(AFS_LINUX22_ENV) +#if !defined(AFS_SGI_ENV) && !defined(AFS_LINUX22_ENV) #if defined(AFS_DISCON_ENV) /* We need to preserve the slot that we're being stored into on @@ -1082,14 +1053,13 @@ afs_NewVCache(struct VenusFid *afid, struct server *serverp) } #endif -#if defined(AFS_OSF_ENV) || defined(AFS_LINUX22_ENV) +#if defined(AFS_LINUX22_ENV) /* Hold it for the LRU (should make count 2) */ VN_HOLD(AFSTOV(tvc)); -#else /* AFS_OSF_ENV */ -#if !(defined (AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)) +#elif !(defined (AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)) VREFCOUNT_SET(tvc, 1); /* us */ -#endif /* AFS_XBSD_ENV */ -#endif /* AFS_OSF_ENV */ +#endif + #ifdef AFS_AIX32_ENV LOCK_INIT(&tvc->pvmlock, "vcache pvmlock"); tvc->vmh = tvc->segid = NULL; @@ -1182,14 +1152,6 @@ afs_NewVCache(struct VenusFid *afid, struct server *serverp) tvc->v.v_next = gnodepnt->gn_vnode; /*Single vnode per gnode for us! */ gnodepnt->gn_vnode = &tvc->v; #endif -#if defined(AFS_DUX40_ENV) - insmntque(tvc, afs_globalVFS, &afs_ubcops); -#else -#ifdef AFS_OSF_ENV - /* Is this needed??? */ - insmntque(tvc, afs_globalVFS); -#endif /* AFS_OSF_ENV */ -#endif /* AFS_DUX40_ENV */ #ifdef AFS_FBSD70_ENV #ifndef AFS_FBSD80_ENV /* yup. they put it back. */ insmntque(AFSTOV(tvc), afs_globalVFS); @@ -1417,14 +1379,6 @@ afs_VerifyVCache2(struct vcache *avc, struct vrequest *areq) AFS_STATCNT(afs_VerifyVCache); -#if defined(AFS_OSF_ENV) - ObtainReadLock(&avc->lock); - if (afs_IsWired(avc)) { - ReleaseReadLock(&avc->lock); - return 0; - } - ReleaseReadLock(&avc->lock); -#endif /* AFS_OSF_ENV */ /* otherwise we must fetch the status info */ ObtainWriteLock(&avc->lock, 53); @@ -1940,12 +1894,6 @@ afs_GetVCache(register struct VenusFid *afid, struct vrequest *areq, ReleaseWriteLock(&tvc->lock); return tvc; } -#if defined(AFS_OSF_ENV) - if (afs_IsWired(tvc)) { - ReleaseWriteLock(&tvc->lock); - return tvc; - } -#endif /* AFS_OSF_ENV */ #ifdef AFS_DARWIN80_ENV /* Darwin 8.0 only has bufs in nfs, so we shouldn't have to worry about them. What about ubc? */ @@ -2312,9 +2260,6 @@ afs_GetRootVCache(struct VenusFid *afid, struct vrequest *areq, struct AFSCallBack CallBack; struct AFSVolSync tsync; int origCBs = 0; -#ifdef AFS_OSF_ENV - int vg; -#endif #ifdef AFS_DARWIN80_ENV vnode_t tvp; #endif @@ -2356,17 +2301,6 @@ afs_GetRootVCache(struct VenusFid *afid, struct vrequest *areq, afs_osi_Sleep(&tvc->f.states); goto rootvc_loop; } -#ifdef AFS_OSF_ENV - /* Grab this vnode, possibly reactivating from the free list */ - /* for the present (95.05.25) everything on the hash table is - * definitively NOT in the free list -- at least until afs_reclaim - * can be safely implemented */ - AFS_GUNLOCK(); - vg = vget(AFSTOV(tvc)); /* this bumps ref count */ - AFS_GLOCK(); - if (vg) - continue; -#endif /* AFS_OSF_ENV */ #ifdef AFS_DARWIN80_ENV if (tvc->f.states & CDeadVnode) { ReleaseSharedLock(&afs_xvcache); @@ -2390,10 +2324,6 @@ afs_GetRootVCache(struct VenusFid *afid, struct vrequest *areq, if (!haveStatus && (!tvc || !(tvc->f.states & CStatd))) { /* Mount point no longer stat'd or unknown. FID may have changed. */ -#ifdef AFS_OSF_ENV - if (tvc) - AFS_RELE(AFSTOV(tvc)); -#endif getNewFid = 1; ReleaseSharedLock(&afs_xvcache); #ifdef AFS_DARWIN80_ENV @@ -2423,9 +2353,9 @@ afs_GetRootVCache(struct VenusFid *afid, struct vrequest *areq, if (cached) *cached = 1; afs_stats_cmperf.vcacheHits++; -#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN80_ENV) +#if defined(AFS_DARWIN80_ENV) /* we already bumped the ref count in the for loop above */ -#else /* AFS_OSF_ENV */ +#else /* AFS_DARWIN80_ENV */ osi_vnhold(tvc, 0); #endif UpgradeSToWLock(&afs_xvcache, 24); @@ -2905,9 +2835,6 @@ afs_FindVCache(struct VenusFid *afid, afs_int32 * retry, afs_int32 flag) register struct vcache *tvc; afs_int32 i; -#if defined( AFS_OSF_ENV) - int vg; -#endif #ifdef AFS_DARWIN80_ENV vnode_t tvp; #endif @@ -2922,14 +2849,6 @@ afs_FindVCache(struct VenusFid *afid, afs_int32 * retry, afs_int32 flag) findvc_sleep(tvc, flag); goto findloop; } -#ifdef AFS_OSF_ENV - /* Grab this vnode, possibly reactivating from the free list */ - AFS_GUNLOCK(); - vg = vget(AFSTOV(tvc)); - AFS_GLOCK(); - if (vg) - continue; -#endif /* AFS_OSF_ENV */ #ifdef AFS_DARWIN80_ENV if (tvc->f.states & CDeadVnode) { findvc_sleep(tvc, flag); @@ -2954,7 +2873,7 @@ afs_FindVCache(struct VenusFid *afid, afs_int32 * retry, afs_int32 flag) if (tvc) { if (retry) *retry = 0; -#if !defined(AFS_OSF_ENV) && !defined(AFS_DARWIN80_ENV) +#if !defined(AFS_DARWIN80_ENV) osi_vnhold(tvc, retry); /* already held, above */ if (retry && *retry) return 0; @@ -3039,9 +2958,6 @@ afs_NFSFindVCache(struct vcache **avcp, struct VenusFid *afid) afs_int32 i; afs_int32 count = 0; struct vcache *found_tvc = NULL; -#ifdef AFS_OSF_ENV - int vg; -#endif #ifdef AFS_DARWIN80_ENV vnode_t tvp; #endif @@ -3064,16 +2980,6 @@ afs_NFSFindVCache(struct vcache **avcp, struct VenusFid *afid) afs_osi_Sleep(&tvc->f.states); goto loop; } -#ifdef AFS_OSF_ENV - /* Grab this vnode, possibly reactivating from the free list */ - AFS_GUNLOCK(); - vg = vget(AFSTOV(tvc)); - AFS_GLOCK(); - if (vg) { - /* This vnode no longer exists. */ - continue; - } -#endif /* AFS_OSF_ENV */ #ifdef AFS_DARWIN80_ENV if (tvc->f.states & CDeadVnode) { ReleaseSharedLock(&afs_xvcache); @@ -3097,11 +3003,6 @@ afs_NFSFindVCache(struct vcache **avcp, struct VenusFid *afid) count++; if (found_tvc) { /* Duplicates */ -#ifdef AFS_OSF_ENV - /* Drop our reference counts. */ - vrele(AFSTOV(tvc)); - vrele(AFSTOV(found_tvc)); -#endif afs_duplicate_nfs_fids++; ReleaseSharedLock(&afs_xvcache); #ifdef AFS_DARWIN80_ENV @@ -3129,9 +3030,7 @@ afs_NFSFindVCache(struct vcache **avcp, struct VenusFid *afid) goto loop; } #else -#if !defined(AFS_OSF_ENV) osi_vnhold(tvc, (int *)0); /* already held, above */ -#endif #endif /* * We obtained the xvcache lock above. @@ -3188,31 +3087,25 @@ afs_NFSFindVCache(struct vcache **avcp, struct VenusFid *afid) void afs_vcacheInit(int astatSize) { -#if (!defined(AFS_OSF_ENV) && !defined(AFS_LINUX22_ENV)) || defined(AFS_SGI_ENV) +#if !defined(AFS_LINUX22_ENV) register struct vcache *tvp; #endif int i; -#if defined(AFS_OSF_ENV) || defined(AFS_LINUX22_ENV) - if (!afs_maxvcount) { #if defined(AFS_LINUX22_ENV) + if (!afs_maxvcount) { afs_maxvcount = astatSize; /* no particular limit on linux? */ -#elif defined(AFS_OSF30_ENV) - afs_maxvcount = max_vnodes / 2; /* limit ourselves to half the total */ -#else - afs_maxvcount = nvnode / 2; /* limit ourselves to half the total */ -#endif if (astatSize < afs_maxvcount) { afs_maxvcount = astatSize; } } -#else /* AFS_OSF_ENV */ +#else /* AFS_LINUX22_ENV */ freeVCList = NULL; #endif AFS_RWLOCK_INIT(&afs_xvcache, "afs_xvcache"); LOCK_INIT(&afs_xvcb, "afs_xvcb"); -#if !defined(AFS_OSF_ENV) && !defined(AFS_LINUX22_ENV) +#if !defined(AFS_LINUX22_ENV) /* Allocate and thread the struct vcache entries */ tvp = (struct vcache *)afs_osi_Alloc(astatSize * sizeof(struct vcache)); memset(tvp, 0, sizeof(struct vcache) * astatSize); @@ -3223,9 +3116,9 @@ afs_vcacheInit(int astatSize) tvp[i].nextfree = &(tvp[i + 1]); } tvp[astatSize - 1].nextfree = NULL; -#ifdef KERNEL_HAVE_PIN +# ifdef KERNEL_HAVE_PIN pin((char *)tvp, astatSize * sizeof(struct vcache)); /* XXX */ -#endif +# endif #endif #if defined(AFS_SGI_ENV) @@ -3337,16 +3230,16 @@ shutdown_vcache(void) } afs_cbrSpace = 0; -#if !defined(AFS_OSF_ENV) && !defined(AFS_LINUX22_ENV) +#if !defined(AFS_LINUX22_ENV) afs_osi_Free(Initial_freeVCList, afs_cacheStats * sizeof(struct vcache)); -#endif -#ifdef KERNEL_HAVE_PIN - unpin(Initial_freeVCList, afs_cacheStats * sizeof(struct vcache)); -#endif -#if !defined(AFS_OSF_ENV) && !defined(AFS_LINUX22_ENV) +# ifdef KERNEL_HAVE_PIN + unpin(Initial_freeVCList, afs_cacheStats * sizeof(struct vcache)); +# endif + freeVCList = Initial_freeVCList = 0; #endif + AFS_RWLOCK_INIT(&afs_xvcache, "afs_xvcache"); LOCK_INIT(&afs_xvcb, "afs_xvcb"); QInit(&VLRU); diff --git a/src/afs/exporter.h b/src/afs/exporter.h index 3b344d60a4..ecaa8c0fee 100644 --- a/src/afs/exporter.h +++ b/src/afs/exporter.h @@ -34,7 +34,7 @@ * up 2 bytes */ -#if defined(AFS_SUN57_64BIT_ENV) || defined(AFS_OSF_ENV) || (defined(AFS_SGI61_ENV) && (_MIPS_SZPTR==64)) || defined(AFS_LINUX_64BIT_KERNEL) +#if defined(AFS_SUN57_64BIT_ENV) || (defined(AFS_SGI61_ENV) && (_MIPS_SZPTR==64)) || defined(AFS_LINUX_64BIT_KERNEL) #define AFS_XLATOR_MAGIC 0x8765 /* XXX */ #else #define AFS_XLATOR_MAGIC 0x87654321 @@ -43,12 +43,8 @@ #if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) #define AFS_NFSXLATORREQ(cred) 0 #else -#ifdef AFS_OSF_ENV -#define AFS_NFSXLATORREQ(cred) ((cred)->cr_ruid == NFSXLATOR_CRED) -#else #define AFS_NFSXLATORREQ(cred) ((cred)->cr_rgid == NFSXLATOR_CRED) #endif -#endif struct afs_exporter; diff --git a/src/afs/lock.h b/src/afs/lock.h index d8e33a78c9..02a76734e2 100644 --- a/src/afs/lock.h +++ b/src/afs/lock.h @@ -19,20 +19,15 @@ * LICENSED MATERIALS - PROPERTY OF IBM */ -#if (defined(AFS_SUN5_ENV)) || defined(AFS_OSF_ENV) +#if (defined(AFS_SUN5_ENV)) #define AFS_NOBOZO_LOCK #endif -#if !defined(AFS_OSF20_ENV) || defined(AFS_OSF30_ENV) || defined(AFS_OSF32_ENV) - /* We do not instrument locks on osf20 because the vcache structure - ** exceeds the maximim possible limit for a vnode. - */ #define INSTRUMENT_LOCKS /* This is the max lock number in use. Please update it if you add any new * lock numbers. */ #define MAX_LOCK_NUMBER 780 -#endif struct afs_bozoLock { short count; /* count of excl locks */ diff --git a/src/afs/sysincludes.h b/src/afs/sysincludes.h index 06e230f7e2..d3ecd66682 100644 --- a/src/afs/sysincludes.h +++ b/src/afs/sysincludes.h @@ -8,180 +8,180 @@ */ #ifdef UKERNEL -#include +# include #else #ifndef __AFS_SYSINCLUDESH__ #define __AFS_SYSINCLUDESH__ 1 #ifdef AFS_OBSD_ENV -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#ifndef AFS_OBSD38_ENV -#include -#endif -#include -#ifndef MLEN -#include -#include -#endif -#include -#include -#include -#else /* AFS_OBSD_ENV */ -#ifdef AFS_LINUX22_ENV -#include -#ifdef CONFIG_H_EXISTS -#include -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#if defined(AFS_LINUX26_ENV) -#include -#include -#include -#ifdef STRUCT_INODE_HAS_I_SECURITY -#include -#endif -#include -#if defined(LINUX_KEYRING_SUPPORT) -#include -#include -#if defined(KEY_TYPE_H_EXISTS) -#include -#endif -#ifndef KEY_ALLOC_IN_QUOTA -#define KEY_ALLOC_IN_QUOTA 1 -#endif -#endif -#endif +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# ifndef AFS_OBSD38_ENV +# include +# endif +# include +# ifndef MLEN +# include +# include +# endif +# include +# include +# include + +#elif defined(AFS_LINUX22_ENV) +# include +# ifdef CONFIG_H_EXISTS +# include +# endif +# include +# include +# include +# include +# include +# include +# include +# include +# if defined(AFS_LINUX26_ENV) +# include +# include +# include +# ifdef STRUCT_INODE_HAS_I_SECURITY +# include +# endif +# include +# if defined(LINUX_KEYRING_SUPPORT) +# include +# include +# if defined(KEY_TYPE_H_EXISTS) +# include +# endif +# ifndef KEY_ALLOC_IN_QUOTA +# define KEY_ALLOC_IN_QUOTA 1 +# endif +# endif +# endif /* Avoid conflicts with coda overloading AFS type namespace. Must precede * inclusion of uaccess.h. */ -#ifndef _LINUX_CODA_FS_I -#define _LINUX_CODA_FS_I -#define _CODA_HEADER_ -#define _CFS_HEADER_ +# ifndef _LINUX_CODA_FS_I +# define _LINUX_CODA_FS_I +# define _CODA_HEADER_ +# define _CFS_HEADER_ struct coda_inode_info { }; -#endif -#ifndef _LINUX_XFS_FS_I -#define _LINUX_XFS_FS_I +# endif +# ifndef _LINUX_XFS_FS_I +# define _LINUX_XFS_FS_I struct xfs_inode_info { }; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#if defined(LINUX_SEMAPHORE_H) -#include -#else -#include -#endif -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16) -#include -#endif -#include -#ifdef COMPLETION_H_EXISTS -#include -#endif -#if defined(LINUX_USE_FH) -#include -#endif +# endif +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# if defined(LINUX_SEMAPHORE_H) +# include +# else +# include +# endif +# if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16) +# include +# endif +# include +# ifdef COMPLETION_H_EXISTS +# include +# endif +# if defined(LINUX_USE_FH) +# include +# endif #else /* AFS_LINUX22_ENV */ -#if defined(AFS_DARWIN_ENV) -#ifndef _MACH_ETAP_H_ -#define _MACH_ETAP_H_ +# if defined(AFS_DARWIN_ENV) +# ifndef _MACH_ETAP_H_ +# define _MACH_ETAP_H_ typedef unsigned short etap_event_t; -#endif -#endif -#if !defined(AFS_OSF_ENV) -#include "h/errno.h" -#include "h/types.h" -#include "h/param.h" +# endif +# endif -#ifdef AFS_AUX_ENV -#ifdef PAGING -#include "h/mmu.h" -#include "h/seg.h" -#include "h/page.h" -#include "h/region.h" -#endif /* PAGING */ -#include "h/sysmacros.h" -#include "h/signal.h" -#include "h/var.h" -#endif /* AFS_AUX_ENV */ +# include "h/errno.h" +# include "h/types.h" +# include "h/param.h" -#include "h/systm.h" -#include "h/time.h" +# ifdef AFS_AUX_ENV +# ifdef PAGING +# include "h/mmu.h" +# include "h/seg.h" +# include "h/page.h" +# include "h/region.h" +# endif /* PAGING */ +# include "h/sysmacros.h" +# include "h/signal.h" +# include "h/var.h" +# endif /* AFS_AUX_ENV */ -#ifdef AFS_AIX_ENV -#ifdef AFS_AIX41_ENV -#include "sys/statfs.h" -#endif -#ifdef AFS_AIX51_ENV -#include "sys/acl.h" -#endif -#include "../h/file.h" -#include "../h/fullstat.h" -#include "../h/vattr.h" -#include "../h/var.h" -#include "../h/access.h" -#endif /* AFS_AIX_ENV */ +# include "h/systm.h" +# include "h/time.h" -#if defined(AFS_SGI_ENV) -#include "values.h" -#include "sys/sema.h" -#include "sys/cmn_err.h" -#ifdef AFS_SGI64_ENV -#include +# ifdef AFS_AIX_ENV +# ifdef AFS_AIX41_ENV +# include "sys/statfs.h" +# endif +# ifdef AFS_AIX51_ENV +# include "sys/acl.h" +# endif +# include "../h/file.h" +# include "../h/fullstat.h" +# include "../h/vattr.h" +# include "../h/var.h" +# include "../h/access.h" +# endif /* AFS_AIX_ENV */ + +# if defined(AFS_SGI_ENV) +# include "values.h" +# include "sys/sema.h" +# include "sys/cmn_err.h" +# ifdef AFS_SGI64_ENV +# include /* in 6.5.20f, ksys/behavior.h doesn't bother to define BHV_IS_BHVL, * but sys/vnode.h uses it in VNODE_TO_FIRST_BHV. It looks like from * older headers like we want the old behavior, so we fake it. */ -#if defined(BHV_PREPARE) && !defined(CELL_CAPABLE) -#define BHV_IS_BHVL(bhp) (0) -#endif -#endif /* AFS_SGI64_ENV */ -#include "fs/efs_inode.h" -#include "sys/kmem.h" -#include "sys/cred.h" -#include "sys/resource.h" +# if defined(BHV_PREPARE) && !defined(CELL_CAPABLE) +# define BHV_IS_BHVL(bhp) (0) +# endif +# endif /* AFS_SGI64_ENV */ +# include "fs/efs_inode.h" +# include "sys/kmem.h" +# include "sys/cred.h" +# include "sys/resource.h" /* * ../sys/debug.h defines ASSERT(), but it is nontrivial only if DEBUG @@ -192,245 +192,195 @@ typedef unsigned short etap_event_t; * * Instead of using ASSERT(), we use our own osi_Assert(). */ -#if defined(AFS_SGI65_ENV) && !defined(DEBUG) -#define DEBUG -#include "sys/debug.h" -#undef DEBUG -#else -#include "sys/debug.h" -#endif +# if defined(AFS_SGI65_ENV) && !defined(DEBUG) +# define DEBUG +# include "sys/debug.h" +# undef DEBUG +# else +# include "sys/debug.h" +# endif -#include "sys/statvfs.h" -#include "sys/sysmacros.h" -#include "sys/fs_subr.h" -#include "sys/siginfo.h" -#endif /* AFS_SGI_ENV */ +# include "sys/statvfs.h" +# include "sys/sysmacros.h" +# include "sys/fs_subr.h" +# include "sys/siginfo.h" +# endif /* AFS_SGI_ENV */ -#if !defined(AFS_AIX_ENV) && !defined(AFS_SUN5_ENV) && !defined(AFS_SGI_ENV) +# if !defined(AFS_AIX_ENV) && !defined(AFS_SUN5_ENV) && !defined(AFS_SGI_ENV) # include "h/kernel.h" -#endif /* !SUN5 && !SGI */ +# endif /* !SUN5 && !SGI */ -#ifdef AFS_SUN5_ENV -#include /* for kernel printf() prototype */ -#endif +# ifdef AFS_SUN5_ENV +# include /* for kernel printf() prototype */ +# endif -#if defined(AFS_SUN56_ENV) -#include "h/vfs.h" /* stops SUN56 socketvar.h warnings */ -#include "h/stropts.h" /* stops SUN56 socketvar.h warnings */ -#include "h/stream.h" /* stops SUN56 socketvar.h errors */ -#endif +# if defined(AFS_SUN56_ENV) +# include "h/vfs.h" /* stops SUN56 socketvar.h warnings */ +# include "h/stropts.h" /* stops SUN56 socketvar.h warnings */ +# include "h/stream.h" /* stops SUN56 socketvar.h errors */ +# endif -#ifdef AFS_SUN510_ENV -#include -#include -#endif +# ifdef AFS_SUN510_ENV +# include +# include +# endif -#include "h/socket.h" -#include "h/socketvar.h" -#include "h/protosw.h" +# include "h/socket.h" +# include "h/socketvar.h" +# include "h/protosw.h" -#if defined(AFS_SGI_ENV) || defined(AFS_HPUX_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_FBSD_ENV) +# if defined(AFS_SGI_ENV) || defined(AFS_HPUX_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_FBSD_ENV) # include "h/dirent.h" # ifdef AFS_SUN5_ENV -# include "h/sysmacros.h" -# include "h/fs/ufs_fsdir.h" +# include "h/sysmacros.h" +# include "h/fs/ufs_fsdir.h" # endif /* AFS_SUN5_ENV */ -#else +# else # include "h/dir.h" -#endif /* SGI || SUN || HPUX */ +# endif /* SGI || SUN || HPUX */ -#if !defined(AFS_SGI64_ENV) && !defined(AFS_FBSD_ENV) && !defined(AFS_DARWIN80_ENV) -#include "h/user.h" -#endif /* AFS_SGI64_ENV */ -#define MACH_USER_API 1 -#if defined(AFS_FBSD50_ENV) -#include "h/bio.h" -#include "h/filedesc.h" -#endif -#include "h/file.h" -#include "h/uio.h" -#include "h/buf.h" -#include "h/stat.h" +# if !defined(AFS_SGI64_ENV) && !defined(AFS_FBSD_ENV) && !defined(AFS_DARWIN80_ENV) +# include "h/user.h" +# endif /* AFS_SGI64_ENV */ +# define MACH_USER_API 1 +# if defined(AFS_FBSD50_ENV) +# include "h/bio.h" +# include "h/filedesc.h" +# endif +# include "h/file.h" +# include "h/uio.h" +# include "h/buf.h" +# include "h/stat.h" /* ----- The following mainly deal with vnodes/inodes stuff ------ */ -# ifdef AFS_SUN5_ENV -# include "h/statvfs.h" -# endif /* AFS_SUN5_ENV */ -# ifdef AFS_HPUX_ENV -struct vfspage; /* for vnode.h compiler warnings */ -# include "h/swap.h" /* for struct swpdbd, for vnode.h compiler warnings */ -# include "h/dbd.h" /* for union idbd, for vnode.h compiler warnings */ -#ifdef AFS_HPUX110_ENV -# include "h/resource.h" -#endif -#ifdef AFS_HPUX1123_ENV -# include -# include -#endif -# endif /* AFS_HPUX_ENV */ -#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) +# ifdef AFS_SUN5_ENV +# include "h/statvfs.h" +# endif /* AFS_SUN5_ENV */ +# ifdef AFS_HPUX_ENV +struct vfspage; /* for vnode.h compiler warnings */ +# include "h/swap.h" /* for struct swpdbd, for vnode.h compiler warnings */ +# include "h/dbd.h" /* for union idbd, for vnode.h compiler warnings */ +# ifdef AFS_HPUX110_ENV +# include "h/resource.h" +# endif +# ifdef AFS_HPUX1123_ENV +# include +# include +# endif +# endif /* AFS_HPUX_ENV */ +# if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) # if defined(AFS_FBSD50_ENV) struct vop_getwritemount_args; # endif # include # include # include -#ifdef AFS_DARWIN80_ENV -# include -#include -#endif +# ifdef AFS_DARWIN80_ENV +# include +# include +# endif # include # include # include -#ifndef AFS_FBSD_ENV -# include -#define timeout_fcn_t mach_timeout_fcn_t -# include -#else +# ifndef AFS_FBSD_ENV +# include +# define timeout_fcn_t mach_timeout_fcn_t +# include +# else MALLOC_DECLARE(M_AFS); -# include -# include -# include -# include -# include -# include -# include -#endif -#undef timeout_fcn_t -#define _DIR_H_ -#define doff_t int32_t -#ifndef AFS_DARWIN80_ENV -# include -# include -# include -#endif -#else +# include +# include +# include +# include +# include +# include +# include +# endif +# undef timeout_fcn_t +# define _DIR_H_ +# define doff_t int32_t +# ifndef AFS_DARWIN80_ENV +# include +# include +# include +# endif +# else # include "h/vfs.h" # include "h/vnode.h" # ifdef AFS_SUN5_ENV -# include "h/fs/ufs_inode.h" -# include "h/fs/ufs_mount.h" +# include "h/fs/ufs_inode.h" +# include "h/fs/ufs_mount.h" # else -# if !defined(AFS_SGI_ENV) && !defined(AFS_AIX32_ENV) -# include "ufs/inode.h" -# if !defined(AFS_SGI_ENV) && !defined(AFS_HPUX_ENV) -# include "ufs/mount.h" -# endif /* !AFS_HPUX_ENV */ -# endif /* !AFS_AIX32_ENV */ +# if !defined(AFS_SGI_ENV) && !defined(AFS_AIX32_ENV) +# include "ufs/inode.h" +# if !defined(AFS_SGI_ENV) && !defined(AFS_HPUX_ENV) +# include "ufs/mount.h" +# endif /* !AFS_HPUX_ENV */ +# endif /* !AFS_AIX32_ENV */ # endif /* AFS_SUN5_ENV */ -#endif /* AFS_DARWIN_ENV || AFS_FBSD_ENV */ +# endif /* AFS_DARWIN_ENV || AFS_FBSD_ENV */ /* These mainly deal with networking and rpc headers */ -#include "netinet/in.h" -#undef MFREE /* defined at mount.h for AIX */ -#ifdef AFS_SUN5_ENV +# include "netinet/in.h" +# undef MFREE /* defined at mount.h for AIX */ +# ifdef AFS_SUN5_ENV # include "h/time.h" -#else -#if !defined(AFS_HPUX_ENV) -# include "h/mbuf.h" -#endif -#endif /* AFS_SUN5_ENV */ +# else +# if !defined(AFS_HPUX_ENV) +# include "h/mbuf.h" +# endif +# endif /* AFS_SUN5_ENV */ -#include "rpc/types.h" -#include "rx/xdr.h" +# include "rpc/types.h" +# include "rx/xdr.h" /* Miscellaneous headers */ -#include "h/proc.h" -#if !defined(AFS_FBSD_ENV) -#include "h/ioctl.h" -#endif /* AFS_FBSD_ENV */ +# include "h/proc.h" +# if !defined(AFS_FBSD_ENV) +# include "h/ioctl.h" +# endif /* AFS_FBSD_ENV */ -#if defined(AFS_HPUX101_ENV) && !defined(AFS_HPUX1123_ENV) -#include "h/proc_iface.h" -#include "h/vas.h" -#endif +# if defined(AFS_HPUX101_ENV) && !defined(AFS_HPUX1123_ENV) +# include "h/proc_iface.h" +# include "h/vas.h" +# endif -#if defined(AFS_HPUX102_ENV) -#include "h/unistd.h" -#include "h/tty.h" -#endif +# if defined(AFS_HPUX102_ENV) +# include "h/unistd.h" +# include "h/tty.h" +# endif -#if !defined(AFS_SGI_ENV) && !defined(AFS_AIX32_ENV) && !defined(AFS_HPUX_ENV) && !defined(AFS_SUN5_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV) +# if !defined(AFS_SGI_ENV) && !defined(AFS_AIX32_ENV) && !defined(AFS_HPUX_ENV) && !defined(AFS_SUN5_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV) # include "h/text.h" -#endif +# endif -#if defined(AFS_AIX_ENV) +# if defined(AFS_AIX_ENV) # include "h/flock.h" /* fcntl.h is a user-level include in aix */ -#else +# else # include "h/fcntl.h" -#endif /* AIX */ +# endif /* AIX */ -#if defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV) +# if defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV) # include "h/unistd.h" -#endif /* SGI || SUN */ +# endif /* SGI || SUN */ -#ifdef AFS_AIX32_ENV +# ifdef AFS_AIX32_ENV # include "h/vmuser.h" -#endif /* AFS_AIX32_ENV */ +# endif /* AFS_AIX32_ENV */ -#if defined(AFS_SUN5_ENV) -#include -#include -#include -#include -#include -#include -#endif +# if defined(AFS_SUN5_ENV) +# include +# include +# include +# include +# include +# include +# endif -#else /* ! AFS_OSF_ENV */ -/* All of the OSF/1 stuff is here */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#ifndef AFS_OSF30_ENV -#include -#endif -#include -#include - -/* These mainly deal with networking and rpc headers */ -#include -#include -#include - -#ifdef AFS_OSF_ENV -#undef kmem_alloc -#undef kmem_free -#undef mem_alloc -#undef mem_free -#undef register -#endif /* AFS_OSF_ENV */ - -#include -#include -#include - -#endif /* AFS_OSF_ENV */ #endif /* AFS_LINUX22_ENV */ -#endif /* AFS_OBSD_ENV */ #endif /* __AFS_SYSINCLUDESH__ so idempotent */