From 706530c295dcf528d7307a524020457a0a6d5f59 Mon Sep 17 00:00:00 2001 From: Derrick Brashear Date: Sun, 3 Apr 2005 19:09:05 +0000 Subject: [PATCH] openafs-kill-dead-code-20050403 Code ifdef'd any of AFS_MACH_ENV, AFS_GFS_ENV, AFS_DEC_ENV dies Code ifdef'd AFS_SUN_ENV either becomes AFS_SUN5_ENV or dies as appropriate, in the kernel only. The database servers etc are probably still buildable, and I still have a SunOS 4.1.4 machine. ;-) But the Solaris vnops get all SunOS 4 code nuked. Uses of AFS_ALPHA_ENV which secretly meant OSF/1,D/UX,Tru64 become AFS_OSF_ENV. Bozon lock use gets its own ifdef. OSF and Solaris define it. Darwin and any BSDs have bozon lock usage removed: note that only OSF and Solaris were bothering to *init* the bozon lock during NewVCache. Bozon locks are for platforms where basically we could end up deadlocking ourselves because of how locks are handled. Some nonsensical ifdefs removed. Some if 0'd code removed. Some obsolete code (hpux pre-10, for instance) removed. --- src/afs/DARWIN/osi_machdep.h | 5 + src/afs/DARWIN/osi_vm.c | 2 +- src/afs/DARWIN/osi_vnodeops.c | 12 -- src/afs/FBSD/osi_vm.c | 2 +- src/afs/FBSD/osi_vnodeops.c | 12 -- src/afs/NBSD/osi_vm.c | 2 +- src/afs/NBSD/osi_vnodeops.c | 8 - src/afs/SOLARIS/osi_vm.c | 3 - src/afs/SOLARIS/osi_vnodeops.c | 364 +------------------------------------- src/afs/VNOPS/afs_vnop_attrs.c | 95 ++-------- src/afs/VNOPS/afs_vnop_fid.c | 2 +- src/afs/VNOPS/afs_vnop_flock.c | 29 +-- src/afs/VNOPS/afs_vnop_open.c | 4 +- src/afs/VNOPS/afs_vnop_read.c | 2 - src/afs/VNOPS/afs_vnop_readdir.c | 17 +- src/afs/VNOPS/afs_vnop_remove.c | 4 +- src/afs/VNOPS/afs_vnop_rename.c | 4 +- src/afs/VNOPS/afs_vnop_strategy.c | 8 +- src/afs/VNOPS/afs_vnop_write.c | 36 +--- src/afs/afs.h | 4 +- src/afs/afs_buffer.c | 2 +- src/afs/afs_call.c | 43 ++--- src/afs/afs_daemons.c | 43 ----- src/afs/afs_dcache.c | 10 +- src/afs/afs_init.c | 10 +- src/afs/afs_memcache.c | 4 +- src/afs/afs_nfsclnt.c | 10 -- src/afs/afs_osi.c | 75 +------- src/afs/afs_pioctl.c | 47 ++--- src/afs/afs_vcache.c | 36 +--- src/afs/afsincludes.h | 11 +- src/afs/longc_procs.h | 87 +-------- src/afs/sysincludes.h | 38 +--- src/afsd/afsd.c | 57 +----- src/afsmonitor/afsmonitor.c | 5 - src/auth/cellconfig.c | 2 +- src/bucoord/commands.c | 4 - src/bucoord/dump.c | 4 - src/bucoord/restore.c | 4 - src/budb/db_text.c | 2 +- src/butc/dump.c | 4 - src/butm/file_tm.c | 2 +- src/config/param.alpha_dux40.h | 1 + src/config/param.alpha_dux50.h | 1 + src/config/param.alpha_dux51.h | 1 + src/config/param.sun4x_510.h | 1 + src/config/param.sun4x_55.h | 1 + src/config/param.sun4x_56.h | 1 + src/config/param.sun4x_57.h | 1 + src/config/param.sun4x_58.h | 1 + src/config/param.sun4x_59.h | 1 + src/config/param.sunx86_510.h | 1 + src/config/param.sunx86_57.h | 2 + src/config/param.sunx86_58.h | 2 + src/config/param.sunx86_59.h | 2 + src/dir/dir.c | 23 --- src/fsint/afsaux.c | 4 +- src/rx/rx.c | 4 +- src/rx/rx_clock.c | 4 - src/rx/rx_rdwr.c | 4 +- src/rx/xdr_afsuuid.c | 5 - src/rx/xdr_arrayn.c | 5 - src/rx/xdr_int64.c | 5 - src/rx/xdr_rx.c | 4 +- src/rxgen/rpc_main.c | 3 - src/venus/fstrace.c | 10 +- src/venus/kdump.c | 6 - src/vfsck/fsck.h | 5 +- src/vfsck/main.c | 172 +----------------- src/vfsck/pass2.c | 8 +- src/vfsck/pass5.c | 27 --- src/vfsck/setup.c | 42 ----- src/vfsck/utilities.c | 9 +- src/viced/afsfileprocs.c | 4 - src/vol/listinodes.c | 3 - 75 files changed, 160 insertions(+), 1318 deletions(-) diff --git a/src/afs/DARWIN/osi_machdep.h b/src/afs/DARWIN/osi_machdep.h index c7eeaf6..63e88de 100644 --- a/src/afs/DARWIN/osi_machdep.h +++ b/src/afs/DARWIN/osi_machdep.h @@ -106,6 +106,11 @@ extern struct lock__bsd__ afs_global_lock; extern ino_t VnodeToIno(vnode_t * vp); extern dev_t VnodeToDev(vnode_t * vp); +#define osi_curproc() current_proc() + +/* FIXME */ +#define osi_curcred() &afs_osi_cred + #endif /* KERNEL */ #endif /* _OSI_MACHDEP_H_ */ diff --git a/src/afs/DARWIN/osi_vm.c b/src/afs/DARWIN/osi_vm.c index f908c70..d6e159f 100644 --- a/src/afs/DARWIN/osi_vm.c +++ b/src/afs/DARWIN/osi_vm.c @@ -49,7 +49,7 @@ osi_VM_FlushVCache(struct vcache *avc, int *slept) return EBUSY; /* if a lock is held, give up */ - if (CheckLock(&avc->lock) || afs_CheckBozonLock(&avc->pvnLock)) + if (CheckLock(&avc->lock)) return EBUSY; AFS_GUNLOCK(); diff --git a/src/afs/DARWIN/osi_vnodeops.c b/src/afs/DARWIN/osi_vnodeops.c index 60abcbb..5eda837 100644 --- a/src/afs/DARWIN/osi_vnodeops.c +++ b/src/afs/DARWIN/osi_vnodeops.c @@ -331,9 +331,7 @@ afs_vop_open(ap) if (AFSTOV(vc) != vp) panic("AFS open changed vnode!"); #endif - afs_BozonLock(&vc->pvnLock, vc); osi_FlushPages(vc, ap->a_cred); - afs_BozonUnlock(&vc->pvnLock, vc); AFS_GUNLOCK(); #ifdef AFS_DARWIN14_ENV if (error && didhold) @@ -359,9 +357,7 @@ afs_vop_close(ap) code = afs_close(avc, ap->a_fflag, ap->a_cred, ap->a_p); else code = afs_close(avc, ap->a_fflag, &afs_osi_cred, ap->a_p); - afs_BozonLock(&avc->pvnLock, avc); osi_FlushPages(avc, ap->a_cred); /* hold bozon lock, but not basic vnode lock */ - afs_BozonUnlock(&avc->pvnLock, avc); AFS_GUNLOCK(); #ifdef AFS_DARWIN14_ENV if (UBCINFOEXISTS(ap->a_vp) && ap->a_vp->v_ubcinfo->ui_refcount < 2) { @@ -448,10 +444,8 @@ afs_vop_read(ap) int code; struct vcache *avc = VTOAFS(ap->a_vp); AFS_GLOCK(); - afs_BozonLock(&avc->pvnLock, avc); osi_FlushPages(avc, ap->a_cred); /* hold bozon lock, but not basic vnode lock */ code = afs_read(avc, ap->a_uio, ap->a_cred, 0, 0, 0); - afs_BozonUnlock(&avc->pvnLock, avc); AFS_GUNLOCK(); return code; } @@ -526,7 +520,6 @@ afs_vop_pagein(ap) auio.uio_resid = aiov.iov_len = size; aiov.iov_base = (caddr_t) ioaddr; AFS_GLOCK(); - afs_BozonLock(&tvc->pvnLock, tvc); osi_FlushPages(tvc, ap->a_cred); /* hold bozon lock, but not basic vnode lock */ code = afs_read(tvc, uio, cred, 0, 0, 0); if (code == 0) { @@ -534,7 +527,6 @@ afs_vop_pagein(ap) tvc->states |= CMAPPED; ReleaseWriteLock(&tvc->lock); } - afs_BozonUnlock(&tvc->pvnLock, tvc); AFS_GUNLOCK(); /* Zero out rest of last page if there wasn't enough data in the file */ @@ -569,7 +561,6 @@ afs_vop_write(ap) struct vcache *avc = VTOAFS(ap->a_vp); void *object; AFS_GLOCK(); - afs_BozonLock(&avc->pvnLock, avc); osi_FlushPages(avc, ap->a_cred); /* hold bozon lock, but not basic vnode lock */ if (UBCINFOEXISTS(ap->a_vp)) ubc_clean(ap->a_vp, 1); @@ -578,7 +569,6 @@ afs_vop_write(ap) ap->a_uio->uio_resid); code = afs_write(VTOAFS(ap->a_vp), ap->a_uio, ap->a_ioflag, ap->a_cred, 0); - afs_BozonUnlock(&avc->pvnLock, avc); AFS_GUNLOCK(); return code; } @@ -713,7 +703,6 @@ afs_vop_pageout(ap) #endif /* ] USV */ AFS_GLOCK(); - afs_BozonLock(&tvc->pvnLock, tvc); osi_FlushPages(tvc, ap->a_cred); /* hold bozon lock, but not basic vnode lock */ ObtainWriteLock(&tvc->lock, 1); afs_FakeOpen(tvc); @@ -724,7 +713,6 @@ afs_vop_pageout(ap) ObtainWriteLock(&tvc->lock, 1); afs_FakeClose(tvc, cred); ReleaseWriteLock(&tvc->lock); - afs_BozonUnlock(&tvc->pvnLock, tvc); AFS_GUNLOCK(); kernel_upl_unmap(kernel_map, pl); if (!nocommit) { diff --git a/src/afs/FBSD/osi_vm.c b/src/afs/FBSD/osi_vm.c index a487562..1b57c76 100644 --- a/src/afs/FBSD/osi_vm.c +++ b/src/afs/FBSD/osi_vm.c @@ -89,7 +89,7 @@ osi_VM_FlushVCache(struct vcache *avc, int *slept) return EBUSY; /* if a lock is held, give up */ - if (CheckLock(&avc->lock) || afs_CheckBozonLock(&avc->pvnLock)) + if (CheckLock(&avc->lock)) return EBUSY; AFS_GUNLOCK(); diff --git a/src/afs/FBSD/osi_vnodeops.c b/src/afs/FBSD/osi_vnodeops.c index 0676fe8..767b05f 100644 --- a/src/afs/FBSD/osi_vnodeops.c +++ b/src/afs/FBSD/osi_vnodeops.c @@ -435,9 +435,7 @@ afs_vop_open(ap) if (AFSTOV(vc) != ap->a_vp) panic("AFS open changed vnode!"); #endif - afs_BozonLock(&vc->pvnLock, vc); osi_FlushPages(vc, ap->a_cred); - afs_BozonUnlock(&vc->pvnLock, vc); AFS_GUNLOCK(); return error; } @@ -458,9 +456,7 @@ afs_vop_close(ap) code = afs_close(avc, ap->a_fflag, ap->a_cred); else code = afs_close(avc, ap->a_fflag, afs_osi_credp); - afs_BozonLock(&avc->pvnLock, avc); osi_FlushPages(avc, ap->a_cred); /* hold bozon lock, but not basic vnode lock */ - afs_BozonUnlock(&avc->pvnLock, avc); AFS_GUNLOCK(); return code; } @@ -526,10 +522,8 @@ afs_vop_read(ap) int code; struct vcache *avc = VTOAFS(ap->a_vp); AFS_GLOCK(); - afs_BozonLock(&avc->pvnLock, avc); osi_FlushPages(avc, ap->a_cred); /* hold bozon lock, but not basic vnode lock */ code = afs_read(avc, ap->a_uio, ap->a_cred, 0, 0, 0); - afs_BozonUnlock(&avc->pvnLock, avc); AFS_GUNLOCK(); return code; } @@ -620,10 +614,8 @@ afs_vop_getpages(struct vop_getpages_args *ap) #endif AFS_GLOCK(); - afs_BozonLock(&avc->pvnLock, avc); osi_FlushPages(avc, osi_curcred()); /* hold bozon lock, but not basic vnode lock */ code = afs_read(avc, &uio, osi_curcred(), 0, 0, 0); - afs_BozonUnlock(&avc->pvnLock, avc); AFS_GUNLOCK(); pmap_qremove(kva, npages); @@ -716,11 +708,9 @@ afs_vop_write(ap) int code; struct vcache *avc = VTOAFS(ap->a_vp); AFS_GLOCK(); - afs_BozonLock(&avc->pvnLock, avc); osi_FlushPages(avc, ap->a_cred); /* hold bozon lock, but not basic vnode lock */ code = afs_write(VTOAFS(ap->a_vp), ap->a_uio, ap->a_ioflag, ap->a_cred, 0); - afs_BozonUnlock(&avc->pvnLock, avc); AFS_GUNLOCK(); return code; } @@ -798,9 +788,7 @@ afs_vop_putpages(struct vop_putpages_args *ap) * sync |= IO_INVAL; */ AFS_GLOCK(); - afs_BozonLock(&avc->pvnLock, avc); code = afs_write(avc, &uio, sync, osi_curcred(), 0); - afs_BozonUnlock(&avc->pvnLock, avc); AFS_GUNLOCK(); pmap_qremove(kva, npages); diff --git a/src/afs/NBSD/osi_vm.c b/src/afs/NBSD/osi_vm.c index 888982d..7935ab8 100644 --- a/src/afs/NBSD/osi_vm.c +++ b/src/afs/NBSD/osi_vm.c @@ -58,7 +58,7 @@ osi_VM_FlushVCache(struct vcache *avc, int *slept) return EBUSY; /* if a lock is held, give up */ - if (CheckLock(&avc->lock) || afs_CheckBozonLock(&avc->pvnLock)) + if (CheckLock(&avc->lock)) return EBUSY; AFS_GUNLOCK(); diff --git a/src/afs/NBSD/osi_vnodeops.c b/src/afs/NBSD/osi_vnodeops.c index a8e1933..a5bd347 100644 --- a/src/afs/NBSD/osi_vnodeops.c +++ b/src/afs/NBSD/osi_vnodeops.c @@ -454,7 +454,6 @@ mp_afs_ubcrdwr(avc, uio, ioflag, cred) AFS_GUNLOCK(); return EISDIR; /* can't read or write other things */ } - afs_BozonLock(&avc->pvnLock, avc); osi_FlushPages(avc); /* hold bozon lock, but not basic vnode lock */ ObtainWriteLock(&avc->lock, 162); /* adjust parameters when appending files */ @@ -649,7 +648,6 @@ mp_afs_ubcrdwr(avc, uio, ioflag, cred) code = afs_DoPartialWrite(avc, &treq); } ReleaseWriteLock(&avc->lock); - afs_BozonUnlock(&avc->pvnLock, avc); if (DO_FLUSH || (!newpage && (cnt < 10))) { AFS_GUNLOCK(); ubc_flush_dirty(((struct vnode *)avc)->v_object, flags); @@ -721,9 +719,7 @@ mp_afs_mmap(avc, offset, map, addrp, len, prot, maxprot, flags, cred) AFS_GUNLOCK(); return code; } - afs_BozonLock(&avc->pvnLock, avc); osi_FlushPages(avc); /* ensure old pages are gone */ - afs_BozonUnlock(&avc->pvnLock, avc); ObtainWriteLock(&avc->lock, 166); avc->states |= CMAPPED; ReleaseWriteLock(&avc->lock); @@ -780,7 +776,6 @@ mp_afs_getpage(vop, offset, len, protp, pl, plsz, mape, addr, rw, cred) ubc_flush_dirty(vop, 0); AFS_GLOCK(); - afs_BozonLock(&avc->pvnLock, avc); ObtainWriteLock(&avc->lock, 167); afs_Trace4(afs_iclSetp, CM_TRACE_PAGEIN, ICL_TYPE_POINTER, avc, ICL_TYPE_LONG, offset, ICL_TYPE_LONG, len, ICL_TYPE_INT32, @@ -846,7 +841,6 @@ mp_afs_getpage(vop, offset, len, protp, pl, plsz, mape, addr, rw, cred) out: pl[i] = VM_PAGE_NULL; ReleaseWriteLock(&avc->lock); - afs_BozonUnlock(&avc->pvnLock, avc); afs_Trace3(afs_iclSetp, CM_TRACE_PAGEINDONE, ICL_TYPE_INT32, code, ICL_TYPE_POINTER, *pagep, ICL_TYPE_INT32, flags); code = afs_CheckCode(code, &treq, 40); @@ -889,7 +883,6 @@ mp_afs_putpage(vop, pl, pcnt, flags, cred) } /* first, obtain the proper lock for the VM system */ - afs_BozonLock(&avc->pvnLock, avc); ObtainWriteLock(&avc->lock, 170); for (i = 0; i < pcnt; i++) { vm_page_t page = pl[i]; @@ -916,7 +909,6 @@ mp_afs_putpage(vop, pl, pcnt, flags, cred) } done: ReleaseWriteLock(&avc->lock); - afs_BozonUnlock(&avc->pvnLock, avc); afs_Trace2(afs_iclSetp, CM_TRACE_PAGEOUTDONE, ICL_TYPE_INT32, code, ICL_TYPE_INT32, avc->m.Length); AFS_GUNLOCK(); diff --git a/src/afs/SOLARIS/osi_vm.c b/src/afs/SOLARIS/osi_vm.c index f473214..5f2ab31 100644 --- a/src/afs/SOLARIS/osi_vm.c +++ b/src/afs/SOLARIS/osi_vm.c @@ -18,7 +18,6 @@ RCSID #include "afs/afs_stats.h" /* statistics */ #include "afs/nfsclient.h" -#if defined(AFS_SUN5_ENV) /* This file contains Solaris VM-related code for the cache manager. */ #include @@ -199,5 +198,3 @@ osi_VM_Truncate(struct vcache *avc, int alen, struct AFS_UCRED *acred) pvn_vplist_dirty(AFSTOV(avc), alen, afs_putapage, B_TRUNC | B_INVAL, acred); } - -#endif /* SUN5 && !NCR */ diff --git a/src/afs/SOLARIS/osi_vnodeops.c b/src/afs/SOLARIS/osi_vnodeops.c index 07600f8..212b10f 100644 --- a/src/afs/SOLARIS/osi_vnodeops.c +++ b/src/afs/SOLARIS/osi_vnodeops.c @@ -13,7 +13,6 @@ RCSID ("$Header$"); -#if defined(AFS_SUN_ENV) || defined(AFS_SUN5_ENV) /* * SOLARIS/osi_vnodeops.c * @@ -48,18 +47,11 @@ RCSID #include #include #include -#if defined(AFS_SUN5_ENV) #include #include -#else -#include -#endif #include -#if defined(AFS_SUN5_ENV) #include -#endif -#if defined(AFS_SUN5_ENV) /* * XXX Temporary fix for problems with Solaris rw_tryupgrade() lock. * It isn't very persistent in getting the upgrade when others are @@ -79,7 +71,6 @@ AFS_TRYUP(lock) } } #endif -#endif /* Translate a faultcode_t as returned by some of the vm routines @@ -111,8 +102,6 @@ int afs_dump(), afs_cmp(), afs_realvp(), afs_GetOnePage(); int afs_pvn_vptrunc; -#ifdef AFS_SUN5_ENV - int afs_addmap(avp, offset, asp, addr, length, prot, maxprot, flags, credp) register struct vnode *avp; @@ -194,8 +183,6 @@ afs_vmwrite(avp, auio, ioflag, acred) return code; } -#endif /* AFS_SUN5_ENV */ - int afs_getpage(vp, off, len, protp, pl, plsz, seg, addr, rw, acred) struct vnode *vp; @@ -204,23 +191,16 @@ afs_getpage(vp, off, len, protp, pl, plsz, seg, addr, rw, acred) struct page *pl[]; u_int plsz; struct seg *seg; -#ifdef AFS_SUN5_ENV offset_t off; caddr_t addr; -#else - u_int off; - addr_t addr; -#endif enum seg_rw rw; struct AFS_UCRED *acred; { register afs_int32 code = 0; AFS_STATCNT(afs_getpage); -#ifdef AFS_SUN5_ENV if (vp->v_flag & VNOMAP) /* File doesn't allow mapping */ return (ENOSYS); -#endif AFS_GLOCK(); @@ -230,23 +210,16 @@ afs_getpage(vp, off, len, protp, pl, plsz, seg, addr, rw, acred) afs_GetOnePage(vp, off, len, protp, pl, plsz, seg, addr, rw, acred); #else -#ifdef AFS_SUN5_ENV if (len <= PAGESIZE) code = afs_GetOnePage(vp, (u_int) off, len, protp, pl, plsz, seg, addr, rw, acred); -#else - if (len == PAGESIZE) - code = afs_GetOnePage(vp, off, protp, pl, plsz, seg, addr, rw, acred); -#endif #endif else { struct vcache *vcp = VTOAFS(vp); -#ifdef AFS_SUN5_ENV ObtainWriteLock(&vcp->vlock, 548); vcp->multiPage++; ReleaseWriteLock(&vcp->vlock); -#endif afs_BozonLock(&vcp->pvnLock, vcp); #if defined(AFS_SUN56_ENV) code = @@ -258,25 +231,18 @@ afs_getpage(vp, off, len, protp, pl, plsz, seg, addr, rw, acred) plsz, seg, addr, rw, acred); #endif afs_BozonUnlock(&vcp->pvnLock, vcp); -#ifdef AFS_SUN5_ENV ObtainWriteLock(&vcp->vlock, 549); vcp->multiPage--; ReleaseWriteLock(&vcp->vlock); -#endif } AFS_GUNLOCK(); return code; } /* Return all the pages from [off..off+len) in file */ -#ifdef AFS_SUN5_ENV int afs_GetOnePage(vp, off, alen, protp, pl, plsz, seg, addr, rw, acred) u_int alen; -#else -int -afs_GetOnePage(vp, off, protp, pl, plsz, seg, addr, rw, acred) -#endif struct vnode *vp; #if defined(AFS_SUN56_ENV) u_offset_t off; @@ -287,11 +253,7 @@ afs_GetOnePage(vp, off, protp, pl, plsz, seg, addr, rw, acred) struct page *pl[]; u_int plsz; struct seg *seg; -#ifdef AFS_SUN5_ENV caddr_t addr; -#else - addr_t addr; -#endif enum seg_rw rw; struct AFS_UCRED *acred; { @@ -307,37 +269,23 @@ afs_GetOnePage(vp, off, protp, pl, plsz, seg, addr, rw, acred) afs_size_t offset, nlen; struct vrequest treq; afs_int32 mapForRead = 0, Code = 0; -#if defined(AFS_SUN56_ENV) u_offset_t toffset; -#else - afs_int32 toffset; -#endif if (!acred) -#ifdef AFS_SUN5_ENV osi_Panic("GetOnePage: !acred"); -#else - acred = u.u_cred; /* better than nothing */ -#endif avc = VTOAFS(vp); /* cast to afs vnode */ -#ifdef AFS_SUN5_ENV if (avc->credp /*&& AFS_NFSXLATORREQ(acred) */ && AFS_NFSXLATORREQ(avc->credp)) { acred = avc->credp; } -#endif if (code = afs_InitReq(&treq, acred)) return code; if (!pl) { /* This is a read-ahead request, e.g. due to madvise. */ -#ifdef AFS_SUN5_ENV int plen = alen; -#else - int plen = PAGESIZE; -#endif ObtainReadLock(&avc->lock); while (plen > 0 && !afs_BBusy()) { @@ -405,32 +353,17 @@ afs_GetOnePage(vp, off, protp, pl, plsz, seg, addr, rw, acred) if (protp) *protp = PROT_ALL; -#ifndef AFS_SUN5_ENV - if (AFS_NFSXLATORREQ(acred)) { - if (rw == S_READ) { - if (!afs_AccessOK - (avc, PRSFS_READ, &treq, - CHECK_MODE_BITS | CMB_ALLOW_EXEC_AS_READ)) { - return EACCES; - } - } - } -#endif retry: -#ifdef AFS_SUN5_ENV if (rw == S_WRITE || rw == S_CREATE) tdc = afs_GetDCache(avc, (afs_offs_t) off, &treq, &offset, &nlen, 5); else tdc = afs_GetDCache(avc, (afs_offs_t) off, &treq, &offset, &nlen, 1); if (!tdc) return EINVAL; -#endif code = afs_VerifyVCache(avc, &treq); if (code) { -#ifdef AFS_SUN5_ENV afs_PutDCache(tdc); -#endif return afs_CheckCode(code, &treq, 44); /* failed to get it */ } @@ -444,7 +377,6 @@ afs_GetOnePage(vp, off, protp, pl, plsz, seg, addr, rw, acred) tlen = len; slot = 0; toffset = off; -#ifdef AFS_SUN5_ENV /* Check to see if we're in the middle of a VM purge, and if we are, release * the locks and try again when the VM purge is done. */ ObtainWriteLock(&avc->vlock, 550); @@ -466,7 +398,6 @@ afs_GetOnePage(vp, off, protp, pl, plsz, seg, addr, rw, acred) goto retry; } ReleaseWriteLock(&avc->vlock); -#endif /* We're about to do stuff with our dcache entry.. Lock it. */ ObtainReadLock(&tdc->lock); @@ -493,7 +424,6 @@ afs_GetOnePage(vp, off, protp, pl, plsz, seg, addr, rw, acred) /* if we make it here, we can't find the page in memory. Do a real disk read * from the cache to get the data */ Code |= 0x200; /* XXX */ -#ifdef AFS_SUN5_ENV #if defined(AFS_SUN54_ENV) /* use PG_EXCL because we know the page does not exist already. If it * actually does exist, we have somehow raced between lookup and create. @@ -517,86 +447,38 @@ afs_GetOnePage(vp, off, protp, pl, plsz, seg, addr, rw, acred) } if (alen < PAGESIZE) pagezero(page, alen, PAGESIZE - alen); -#else - page = rm_allocpage(seg, addr, PAGESIZE, 1); /* can't fail */ - if (!page) - osi_Panic("afs_getpage alloc page"); - /* we get a circularly-linked list of pages back, but we expect only - * one, since that's what we asked for */ - if (page->p_next != page) - osi_Panic("afs_getpage list"); - /* page enter returns a locked page; we'll drop the lock as a side-effect - * of the pvn_done done by afs_ustrategy. If we decide not to call - * strategy, we must be sure to call pvn_fail, at least, to release the - * page locks and otherwise reset the pages. The page, while locked, is - * not held, for what it is worth */ - page->p_intrans = 1; /* set appropriate flags */ - page->p_pagein = 1; - /* next call shouldn't fail, since we have pvnLock set */ - if (page_enter(page, vp, toffset)) - osi_Panic("afs_getpage enter race"); -#endif /* AFS_SUN5_ENV */ - -#ifdef AFS_SUN5_ENV + if (rw == S_CREATE) { /* XXX Don't read from AFS in write only cases XXX */ page_io_unlock(page); } else -#else - if (0) { - /* XXX Don't read from AFS in write only cases XXX */ - page->p_intrans = page->p_pagein = 0; - page_unlock(page); /* XXX */ - } else -#endif { -#ifndef AFS_SUN5_ENV - PAGE_HOLD(page); -#endif /* now it is time to start I/O operation */ buf = pageio_setup(page, PAGESIZE, vp, B_READ); /* allocate a buf structure */ -#if defined(AFS_SUN5_ENV) buf->b_edev = 0; -#endif buf->b_dev = 0; buf->b_blkno = btodb(toffset); bp_mapin(buf); /* map it in to our address space */ -#if defined(AFS_SUN5_ENV) AFS_GLOCK(); /* afs_ustrategy will want to lock the dcache entry */ ReleaseReadLock(&tdc->lock); code = afs_ustrategy(buf, acred); /* do the I/O */ ObtainReadLock(&tdc->lock); AFS_GUNLOCK(); -#else - ReleaseReadLock(&tdc->lock); - ReleaseReadLock(&avc->lock); - code = afs_ustrategy(buf); /* do the I/O */ - ObtainReadLock(&avc->lock); - ObtainReadLock(&tdc->lock); -#endif -#ifdef AFS_SUN5_ENV /* Before freeing unmap the buffer */ bp_mapout(buf); pageio_done(buf); -#endif if (code) { -#ifndef AFS_SUN5_ENV - PAGE_RELE(page); -#endif goto bad; } -#ifdef AFS_SUN5_ENV page_io_unlock(page); -#endif } /* come here when we have another page (already held) to enter */ nextpage: /* put page in array and continue */ -#ifdef AFS_SUN5_ENV /* The p_selock must be downgraded to a shared lock after the page is read */ #if defined(AFS_SUN56_ENV) if ((rw != S_CREATE) && !(PAGE_SHARED(page))) @@ -606,11 +488,8 @@ afs_GetOnePage(vp, off, protp, pl, plsz, seg, addr, rw, acred) { page_downgrade(page); } -#endif pl[slot++] = page; -#ifdef AFS_SUN5_ENV code = page_iolock_assert(page); -#endif code = 0; toffset += PAGESIZE; addr += PAGESIZE; @@ -630,7 +509,6 @@ afs_GetOnePage(vp, off, protp, pl, plsz, seg, addr, rw, acred) } ReleaseReadLock(&avc->lock); -#ifdef AFS_SUN5_ENV ObtainWriteLock(&afs_xdcache, 246); if (!mapForRead) { /* track that we have dirty (or dirty-able) pages for this chunk. */ @@ -638,11 +516,8 @@ afs_GetOnePage(vp, off, protp, pl, plsz, seg, addr, rw, acred) } afs_indexFlags[tdc->index] |= IFAnyPages; ReleaseWriteLock(&afs_xdcache); -#endif afs_BozonUnlock(&avc->pvnLock, avc); -#ifdef AFS_SUN5_ENV afs_PutDCache(tdc); -#endif afs_Trace3(afs_iclSetp, CM_TRACE_PAGEINDONE, ICL_TYPE_LONG, code, ICL_TYPE_LONG, (int)page, ICL_TYPE_LONG, Code); return 0; @@ -652,23 +527,15 @@ afs_GetOnePage(vp, off, protp, pl, plsz, seg, addr, rw, acred) afs_Trace3(afs_iclSetp, CM_TRACE_PAGEINDONE, ICL_TYPE_LONG, code, ICL_TYPE_LONG, (int)page, ICL_TYPE_LONG, Code); /* release all pages, drop locks, return code */ -#ifdef AFS_SUN5_ENV if (page) pvn_read_done(page, B_ERROR); -#else - for (i = 0; i < slot; i++) - PAGE_RELE(pl[i]); -#endif ReleaseReadLock(&avc->lock); afs_BozonUnlock(&avc->pvnLock, avc); -#ifdef AFS_SUN5_ENV ReleaseReadLock(&tdc->lock); afs_PutDCache(tdc); -#endif return code; } -#ifdef AFS_SUN5_ENV int afs_putpage(vp, off, len, flags, cred) struct vnode *vp; @@ -838,132 +705,6 @@ afs_putapage(struct vnode *vp, struct page *pages, return code; } -#else /* AFS_SUN5_ENV */ - -int -afs_putpage(vp, off, len, flags, cred) - struct vnode *vp; - u_int off; - u_int len; - int flags; - struct AFS_UCRED *cred; -{ - int wholeEnchilada; /* true if we must get all of the pages */ - struct vcache *avc; - struct page *pages; - struct page *tpage; - struct buf *tbuf; - afs_int32 tlen; - afs_int32 code = 0, rcode; - afs_int32 poffset; - afs_int32 clusterStart, clusterEnd, endPos; - - /* In the wholeEnchilada case, we must ensure that we get all of the pages - * from the system, since we're doing this to shutdown the use of a vnode */ - - AFS_STATCNT(afs_putpage); - wholeEnchilada = (off == 0 && len == 0 - && (flags & (B_INVAL | B_ASYNC)) == B_INVAL); - - avc = VTOAFS(vp); - afs_BozonLock(&avc->pvnLock, avc); - ObtainWriteLock(&avc->lock, 248); - - while (1) { - /* in whole enchilada case, loop until call to pvn_getdirty can't find - * any more modified pages */ - - /* first we try to get a list of modified (or whatever) pages */ - if (len == 0) { - pages = pvn_vplist_dirty(vp, off, flags); - } else { - endPos = off + len; /* position we're supposed to write up to */ - if (endPos > avc->m.Length) - endPos = avc->m.Length; /* bound by this */ - clusterStart = off & ~(PAGESIZE - 1); /* round down to nearest page */ - clusterEnd = ((endPos - 1) | (PAGESIZE - 1)) + 1; /* round up to nearest page */ - pages = - pvn_range_dirty(vp, off, endPos, clusterStart, clusterEnd, - flags); - } - - /* Now we've got the modified pages. All pages are locked and held */ - rcode = 0; /* return code */ - while (pages) { /* look over all pages in the returned set */ - tpage = pages; /* get first page in the list */ - - /* write out the page */ - poffset = tpage->p_offset; /* where the page starts in the file */ - /* tlen will represent the end of the range to write, for a while */ - tlen = PAGESIZE + poffset; /* basic place to end tpage write */ - /* but we also don't want to write past end of off..off+len range */ - if (len != 0 && tlen > off + len) - tlen = off + len; - /* and we don't want to write past the end of the file */ - if (tlen > avc->m.Length) - tlen = avc->m.Length; - /* and we don't want to write at all if page starts after end */ - if (poffset >= tlen) { - pvn_fail(pages, B_WRITE | flags); - goto done; - } - /* finally change tlen from end position to length */ - tlen -= poffset; /* compute bytes to write from this page */ - page_sub(&pages, tpage); /* remove tpage from "pages" list */ - tbuf = pageio_setup(tpage, tlen, vp, B_WRITE | flags); - if (!tbuf) { - pvn_fail(tpage, B_WRITE | flags); - pvn_fail(pages, B_WRITE | flags); - goto done; - } - tbuf->b_dev = 0; - tbuf->b_blkno = btodb(tpage->p_offset); - bp_mapin(tbuf); - ReleaseWriteLock(&avc->lock); /* can't hold during strategy call */ - code = afs_ustrategy(tbuf); /* unlocks page */ - ObtainWriteLock(&avc->lock, 249); /* re-obtain */ - if (code) { - /* unlocking of tpage is done by afs_ustrategy */ - rcode = code; - if (pages) /* may have already removed last page */ - pvn_fail(pages, B_WRITE | flags); - goto done; - } - } /* for (tpage=pages....) */ - - /* see if we've gotten all of the pages in the whole enchilada case */ - if (!wholeEnchilada || !vp->v_pages) - break; - } /* while(1) obtaining all pages */ - - /* - * If low on chunks, and if writing the last byte of a chunk, try to - * free some. Note that afs_DoPartialWrite calls osi_SyncVM which now - * calls afs_putpage, so this is recursion. It stops there because we - * insist on len being non-zero. - */ - if (afs_stats_cmperf.cacheCurrDirtyChunks > - afs_stats_cmperf.cacheMaxDirtyChunks && len != 0 - && AFS_CHUNKOFFSET((off + len)) == 0) { - struct vrequest treq; - if (!afs_InitReq(&treq, cred ? cred : u.u_cred)) { - rcode = afs_DoPartialWrite(avc, &treq); /* XXX */ - } - } - - done: - - if (rcode && !avc->vc_error) - avc->vc_error = rcode; - - /* when we're here, we just return code. */ - ReleaseWriteLock(&avc->lock); - afs_BozonUnlock(&avc->pvnLock, avc); - return rcode; -} - -#endif /* AFS_SUN5_ENV */ - int afs_nfsrdwr(avc, auio, arw, ioflag, acred) register struct vcache *avc; @@ -1010,13 +751,9 @@ afs_nfsrdwr(avc, auio, arw, ioflag, acred) return (EFBIG); #endif -#ifdef AFS_SUN5_ENV if (!acred) osi_Panic("rdwr: !acred"); -#else - if (!acred) - acred = u.u_cred; -#endif + if (code = afs_InitReq(&treq, acred)) return code; @@ -1135,13 +872,11 @@ afs_nfsrdwr(avc, auio, arw, ioflag, acred) return EACCES; } } -#ifdef AFS_SUN5_ENV crhold(acred); if (avc->credp) { crfree(avc->credp); } avc->credp = acred; -#endif } counter = 0; /* don't call afs_DoPartialWrite first time through. */ while (1) { @@ -1170,7 +905,6 @@ afs_nfsrdwr(avc, auio, arw, ioflag, acred) } sflags = 0; } else { -#ifdef AFS_SUN5_ENV /* Purge dirty chunks of file if there are too many dirty * chunks. Inside the write loop, we only do this at a chunk * boundary. Clean up partial chunk if necessary at end of loop. @@ -1180,7 +914,6 @@ afs_nfsrdwr(avc, auio, arw, ioflag, acred) if (code) break; } -#endif /* AFS_SUN5_ENV */ /* write case, we ask segmap_release to call putpage. Really, we * don't have to do this on every page mapin, but for now we're * lazy, and don't modify the rest of AFS to scan for modified @@ -1193,7 +926,6 @@ afs_nfsrdwr(avc, auio, arw, ioflag, acred) code = 0; break; /* nothing to transfer, we're done */ } -#ifdef AFS_SUN5_ENV if (arw == UIO_WRITE) avc->states |= CDirty; /* may have been cleared by DoPartialWrite */ @@ -1226,31 +958,13 @@ afs_nfsrdwr(avc, auio, arw, ioflag, acred) break; } } -#endif ReleaseWriteLock(&avc->lock); /* uiomove may page fault */ AFS_GUNLOCK(); #if defined(AFS_SUN56_ENV) data = segmap_getmap(segkmap, AFSTOV(avc), (u_offset_t) pageBase); -#else - data = segmap_getmap(segkmap, AFSTOV(avc), pageBase); -#endif -#ifndef AFS_SUN5_ENV - code = - afs_fc2errno(as_fault - (&kas, data + pageOffset, tsize, F_SOFTLOCK, mode)); - if (code == 0) { - AFS_UIOMOVE(data + pageOffset, tsize, arw, auio, code); - as_fault(&kas, data + pageOffset, tsize, F_SOFTUNLOCK, mode); - code2 = segmap_release(segkmap, data, sflags); - if (!code) - code = code2; - } else { - (void)segmap_release(segkmap, data, 0); - } -#else -#if defined(AFS_SUN56_ENV) raddr = (caddr_t) (((uintptr_t) data + pageOffset) & PAGEMASK); #else + data = segmap_getmap(segkmap, AFSTOV(avc), pageBase); raddr = (caddr_t) (((u_int) data + pageOffset) & PAGEMASK); #endif rsize = @@ -1313,27 +1027,22 @@ afs_nfsrdwr(avc, auio, arw, ioflag, acred) } else { (void)segmap_release(segkmap, data, 0); } -#endif /* AFS_SUN5_ENV */ AFS_GLOCK(); ObtainWriteLock(&avc->lock, 253); -#ifdef AFS_SUN5_ENV counter++; if (dcp) afs_PutDCache(dcp); -#endif /* AFS_SUN5_ENV */ if (code) break; } if (didFakeOpen) { afs_FakeClose(avc, acred); } -#ifdef AFS_SUN5_ENV if (arw == UIO_WRITE && (avc->states & CDirty)) { code2 = afs_DoPartialWrite(avc, &treq); if (!code) code = code2; } -#endif /* AFS_SUN5_ENV */ if (!code && avc->vc_error) { code = avc->vc_error; @@ -1365,19 +1074,10 @@ afs_nfsrdwr(avc, auio, arw, ioflag, acred) afs_map(vp, off, as, addr, len, prot, maxprot, flags, cred) struct vnode *vp; struct as *as; -#ifdef AFS_SUN5_ENV offset_t off; caddr_t *addr; -#else - u_int off; - addr_t *addr; -#endif u_int len; -#ifdef AFS_SUN5_ENV u_char prot, maxprot; -#else - u_int prot, maxprot; -#endif u_int flags; struct AFS_UCRED *cred; { @@ -1400,13 +1100,12 @@ afs_map(vp, off, as, addr, len, prot, maxprot, flags, cred) } #endif -#if defined(AFS_SUN5_ENV) if (vp->v_flag & VNOMAP) /* File isn't allowed to be mapped */ return (ENOSYS); if (vp->v_filocks) /* if locked, disallow mapping */ return (EAGAIN); -#endif + AFS_GLOCK(); if (code = afs_InitReq(&treq, cred)) goto out; @@ -1426,9 +1125,7 @@ afs_map(vp, off, as, addr, len, prot, maxprot, flags, cred) afs_BozonUnlock(&avc->pvnLock, avc); AFS_GUNLOCK(); -#ifdef AFS_SUN5_ENV as_rangelock(as); -#endif if ((flags & MAP_FIXED) == 0) { #if defined(AFS_SUN57_ENV) map_addr(addr, len, off, 1, flags); @@ -1438,9 +1135,7 @@ afs_map(vp, off, as, addr, len, prot, maxprot, flags, cred) map_addr(addr, len, (off_t) off, 1); #endif if (*addr == NULL) { -#ifdef AFS_SUN5_ENV as_rangeunlock(as); -#endif code = ENOMEM; goto out1; } @@ -1454,14 +1149,10 @@ afs_map(vp, off, as, addr, len, prot, maxprot, flags, cred) crargs.prot = prot; crargs.maxprot = maxprot; crargs.amp = (struct anon_map *)0; -#if defined(AFS_SUN5_ENV) crargs.flags = flags & ~MAP_TYPE; -#endif code = as_map(as, *addr, len, segvn_create, (char *)&crargs); -#ifdef AFS_SUN5_ENV as_rangeunlock(as); -#endif out1: AFS_GLOCK(); code = afs_CheckCode(code, &treq, 47); @@ -1473,42 +1164,13 @@ afs_map(vp, off, as, addr, len, prot, maxprot, flags, cred) return code; } -/* Sun 4.0.X-specific code. It computes the number of bytes that need - to be zeroed at the end of a page by pvn_vptrunc, given that you're - trying to get vptrunc to truncate a file to alen bytes. The result - will be passed to pvn_vptrunc by the truncate code */ -#ifndef AFS_SUN5_ENV /* Not good for Solaris */ -afs_PageLeft(alen) - register afs_int32 alen; -{ - register afs_int32 nbytes; - - AFS_STATCNT(afs_PageLeft); - nbytes = PAGESIZE - (alen & PAGEOFFSET); /* amount to zap in last page */ - /* now check if we'd zero the entire last page. Don't need to do this - * since pvn_vptrunc will handle this case properly (it will invalidate - * this page) */ - if (nbytes == PAGESIZE) - nbytes = 0; - if (nbytes < 0) - nbytes = 0; /* just in case */ - return nbytes; -} -#endif - /* * For Now We use standard local kernel params for AFS system values. Change this * at some point. */ -#if defined(AFS_SUN5_ENV) afs_pathconf(vp, cmd, outdatap, credp) register struct AFS_UCRED *credp; -#else -afs_cntl(vp, cmd, indatap, outdatap, inflag, outflag) - int inflag, outflag; - char *indatap; -#endif struct vnode *vp; int cmd; u_long *outdatap; @@ -1530,27 +1192,12 @@ afs_cntl(vp, cmd, indatap, outdatap, inflag, outflag) case _PC_NO_TRUNC: *outdatap = 1; break; -#if !defined(AFS_SUN5_ENV) - case _PC_MAX_CANON: - *outdatap = CANBSIZ; - break; - case _PC_VDISABLE: - *outdatap = VDISABLE; - break; - case _PC_PIPE_BUF: - return EINVAL; - break; -#endif default: return EINVAL; } return 0; } -#endif /* AFS_SUN_ENV */ - -#if defined(AFS_SUN5_ENV) - afs_ioctl(vnp, com, arg, flag, credp, rvalp) struct vnode *vnp; int com, arg, flag; @@ -1680,9 +1327,6 @@ afs_space(vnp, cmd, ap, flag, off, credp) return (code); } - -#endif - int afs_dump(vp, addr, i1, i2) struct vnode *vp; diff --git a/src/afs/VNOPS/afs_vnop_attrs.c b/src/afs/VNOPS/afs_vnop_attrs.c index e2855ea..fd15059 100644 --- a/src/afs/VNOPS/afs_vnop_attrs.c +++ b/src/afs/VNOPS/afs_vnop_attrs.c @@ -51,17 +51,12 @@ afs_CopyOutAttrs(register struct vcache *avc, register struct vattr *attrs) AFS_STATCNT(afs_CopyOutAttrs); if (afs_fakestat_enable && avc->mvstat == 1) fakedir = 1; -#if defined(AFS_MACH_ENV ) - attrs->va_mode = - fakedir ? VDIR | 0755 : vType(avc) | (avc->m.Mode & ~VFMT); -#else /* AFS_MACH_ENV */ attrs->va_type = fakedir ? VDIR : vType(avc); #if defined(AFS_SGI_ENV) || defined(AFS_AIX32_ENV) || defined(AFS_SUN5_ENV) attrs->va_mode = fakedir ? 0755 : (mode_t) (avc->m.Mode & 0xffff); #else attrs->va_mode = fakedir ? VDIR | 0755 : avc->m.Mode; #endif -#endif /* AFS_MACH_ENV */ if (avc->m.Mode & (VSUID | VSGID)) { /* setuid or setgid, make sure we're allowed to run them from this cell */ @@ -94,24 +89,15 @@ afs_CopyOutAttrs(register struct vcache *avc, register struct vattr *attrs) #endif /* AFS_DARWIN_ENV */ attrs->va_uid = fakedir ? 0 : avc->m.Owner; attrs->va_gid = fakedir ? 0 : avc->m.Group; /* yeah! */ -#if defined(AFS_SUN56_ENV) +#if defined(AFS_SUN56_ENV) attrs->va_fsid = avc->v.v_vfsp->vfs_fsid.val[0]; -#else -#ifdef AFS_SUN5_ENV - /* XXX We try making this match the vfs's dev field XXX */ - attrs->va_fsid = 1; -#else -#ifdef AFS_OSF_ENV +#elif defined(AFS_OSF_ENV) attrs->va_fsid = avc->v.v_mount->m_stat.f_fsid.val[0]; -#else -#ifdef AFS_DARWIN70_ENV +#elif defined(AFS_DARWIN70_ENV) attrs->va_fsid = avc->v.v_mount->mnt_stat.f_fsid.val[0]; -#else /* ! AFS_DARWIN70_ENV */ +#else attrs->va_fsid = 1; -#endif /* AFS_DARWIN70_ENV */ -#endif -#endif -#endif /* AFS_SUN56_ENV */ +#endif if (avc->mvstat == 2) { tvp = afs_GetVolume(&avc->fid, 0, READ_LOCK); /* The mount point's vnode. */ @@ -160,18 +146,7 @@ afs_CopyOutAttrs(register struct vcache *avc, register struct vattr *attrs) #else attrs->va_blocksize = PAGESIZE; /* XXX Was 8192 XXX */ #endif -#ifdef AFS_DEC_ENV - /* Have to use real device #s in Ultrix, since that's how FS type is - * encoded. If rdev doesn't match Ultrix equivalent of statfs's rdev, then - * "df ." doesn't work. - */ - if (afs_globalVFS && afs_globalVFS->vfs_data) - attrs->va_rdev = ((struct mount *)(afs_globalVFS->vfs_data))->m_dev; - else - attrs->va_rdev = 1; /* better than nothing */ -#else attrs->va_rdev = 1; -#endif #if defined(AFS_HPUX110_ENV) if (afs_globalVFS) attrs->va_fstype = afs_globalVFS->vfs_mtype; @@ -206,23 +181,6 @@ afs_CopyOutAttrs(register struct vcache *avc, register struct vattr *attrs) /* And linux has its own stash as well. */ vattr2inode(AFSTOV(avc), attrs); #endif -#ifdef notdef -#ifdef AFS_AIX51_ENV - afs_Trace2(afs_iclSetp, CM_TRACE_STATACLX, ICL_TYPE_POINTER, - attrs->va_acl, ICL_TYPE_INT32, attrs->va_aclsiz); - if (attrs->va_acl && attrs->va_aclsiz >= 12) { - struct acl *ap; - - ap = (struct acl *)attrs->va_acl; - ap->acl_len = 8; - ap->acl_mode = ACL_MODE; - ap->acl_rsvd = 0; - ap->u_access = 7; - } - /* temporary fix ? */ - attrs->va_aclsiz = 1; -#endif -#endif return 0; } @@ -278,7 +236,7 @@ afs_getattr(OSI_VC_DECL(avc), struct vattr *attrs, struct AFS_UCRED *acred) } #endif -#if defined(AFS_SUN_ENV) || defined(AFS_ALPHA_ENV) || defined(AFS_SUN5_ENV) +#ifdef AFS_BOZONLOCK_ENV afs_BozonLock(&avc->pvnLock, avc); #endif @@ -293,7 +251,7 @@ afs_getattr(OSI_VC_DECL(avc), struct vattr *attrs, struct AFS_UCRED *acred) } else code = 0; -#if defined(AFS_SUN_ENV) || defined(AFS_ALPHA_ENV) || defined(AFS_SUN5_ENV) +#ifdef AFS_BOZONLOCK_ENV if (code == 0) osi_FlushPages(avc, acred); afs_BozonUnlock(&avc->pvnLock, avc); @@ -317,22 +275,6 @@ afs_getattr(OSI_VC_DECL(avc), struct vattr *attrs, struct AFS_UCRED *acred) CMB_ALLOW_EXEC_AS_READ)) { return EACCES; } -#if 0 -/* The effect of the following is to force the NFS client to refetch the - * volume root every time, since the mtime changes. For Solaris 9 NFSv3 - * clients, this means looping forever, since for some reason (related - * to caching?) it wants the mtime to be consistent two reads in a row. - * Why are volume roots special??? - * --jhutz 2-May-2004 - */ - if (avc->mvstat == 2) { -#if defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_AIX41_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) - attrs->va_mtime.tv_nsec += ((++avc->xlatordv) * 1000); -#else - attrs->va_mtime.tv_usec += ++avc->xlatordv; -#endif - } -#endif } if ((au = afs_FindUser(treq.uid, -1, READ_LOCK))) { register struct afs_exporter *exporter = au->exporter; @@ -419,7 +361,7 @@ afs_VAttrToAS(register struct vcache *avc, register struct vattr *av, if (av->va_mask & ATTR_GID) { #elif defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) if (av->va_mask & AT_GID) { -#elif (defined(AFS_HPUX_ENV) || defined(AFS_SUN_ENV)) +#elif defined(AFS_HPUX_ENV) #if defined(AFS_HPUX102_ENV) if (av->va_gid != GID_NO_CHANGE) { #else @@ -437,7 +379,7 @@ afs_VAttrToAS(register struct vcache *avc, register struct vattr *av, if (av->va_mask & ATTR_UID) { #elif defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) if (av->va_mask & AT_UID) { -#elif (defined(AFS_HPUX_ENV) || defined(AFS_SUN_ENV)) +#elif defined(AFS_HPUX_ENV) #if defined(AFS_HPUX102_ENV) if (av->va_uid != UID_NO_CHANGE) { #elif defined(AFS_XBSD_ENV) @@ -453,13 +395,11 @@ afs_VAttrToAS(register struct vcache *avc, register struct vattr *av, } #if defined(AFS_LINUX22_ENV) if (av->va_mask & ATTR_MTIME) { -#else -#if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) +#elif defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) if (av->va_mask & AT_MTIME) { #else if (av->va_mtime.tv_sec != -1) { #endif -#endif mask |= AFS_SETMODTIME; #ifndef AFS_SGI_ENV #if defined(AFS_SUN5_ENV) || defined(AFS_AIX41_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) @@ -526,15 +466,9 @@ afs_setattr(OSI_VC_DECL(avc), register struct vattr *attrs, if (flags & ATTR_LAZY) goto done; #endif -#ifndef AFS_DEC_ENV /* if file size has changed, we need write access, otherwise (e.g. * chmod) give it a shot; if it fails, we'll discard the status * info. - * - * Note that Ultrix actually defines ftruncate of a file you have open to - * be O.K., and does the proper access checks itself in the truncate - * path (unlike BSD or SUNOS), so we skip this check for Ultrix. - * */ #if defined(AFS_LINUX22_ENV) if (attrs->va_mask & ATTR_SIZE) { @@ -552,11 +486,10 @@ afs_setattr(OSI_VC_DECL(avc), register struct vattr *attrs, goto done; } } -#endif afs_VAttrToAS(avc, attrs, &astat); /* interpret request */ code = 0; -#if defined(AFS_SUN_ENV) || defined(AFS_ALPHA_ENV) || defined(AFS_SUN5_ENV) +#ifdef AFS_BOZONLOCK_ENV afs_BozonLock(&avc->pvnLock, avc); #endif #if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) @@ -600,10 +533,6 @@ afs_setattr(OSI_VC_DECL(avc), register struct vattr *attrs, ReleaseWriteLock(&avc->lock); hzero(avc->flushDV); osi_FlushText(avc); /* do this after releasing all locks */ -#ifdef AFS_DEC_ENV - /* in case we changed the size here, propagate it to gp->g_size */ - afs_gfshack((struct gnode *)avc); -#endif } if (code == 0) { ObtainSharedLock(&avc->lock, 16); /* lock entry */ @@ -624,7 +553,7 @@ afs_setattr(OSI_VC_DECL(avc), register struct vattr *attrs, avc->execsOrWriters--; } #endif -#if defined(AFS_SUN_ENV) || defined(AFS_OSF_ENV) || defined(AFS_SUN5_ENV) +#ifdef AFS_BOZONLOCK_ENV afs_BozonUnlock(&avc->pvnLock, avc); #endif #if defined(AFS_SGI_ENV) diff --git a/src/afs/VNOPS/afs_vnop_fid.c b/src/afs/VNOPS/afs_vnop_fid.c index 28728b6..a558212 100644 --- a/src/afs/VNOPS/afs_vnop_fid.c +++ b/src/afs/VNOPS/afs_vnop_fid.c @@ -67,7 +67,7 @@ int afs_iauth_initd = 0; extern int afs_NFSRootOnly; /* 1 => only allow NFS mounts of /afs. */ -#if !defined(AFS_DEC_ENV) && !defined(AFS_ATHENA_ENV) +#if !defined(AFS_ATHENA_ENV) int #ifdef AFS_AIX41_ENV afs_fid(OSI_VC_DECL(avc), struct fid *fidpp, struct ucred *credp) diff --git a/src/afs/VNOPS/afs_vnop_flock.c b/src/afs/VNOPS/afs_vnop_flock.c index e462c5b..c0cb5a8 100644 --- a/src/afs/VNOPS/afs_vnop_flock.c +++ b/src/afs/VNOPS/afs_vnop_flock.c @@ -82,7 +82,7 @@ lockIdSet(struct AFS_FLOCK *flock, struct SimpleLocks *slp, int clid) #endif slp->pid = clid; #else -#if defined(AFS_SUN_ENV) || defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) +#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) slp->pid = clid; #else #if defined(AFS_LINUX20_ENV) || defined(AFS_HPUX_ENV) @@ -121,7 +121,7 @@ lockIdSet(struct AFS_FLOCK *flock, struct SimpleLocks *slp, int clid) #endif flock->l_pid = clid; #else -#if defined(AFS_SUN_ENV) || defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) +#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) flock->l_pid = clid; #else #if defined(AFS_LINUX20_ENV) || defined(AFS_HPUX_ENV) @@ -471,7 +471,7 @@ DoLockWarning(void) #ifdef AFS_OSF_ENV int afs_lockctl(struct vcache * avc, struct eflock * af, int flag, struct AFS_UCRED * acred, pid_t clid, off_t offset) -#elif defined(AFS_SGI_ENV) || (defined(AFS_SUN_ENV) && !defined(AFS_SUN5_ENV)) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) +#elif defined(AFS_SGI_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) int afs_lockctl(struct vcache * avc, struct AFS_FLOCK * af, int acmd, struct AFS_UCRED * acred, pid_t clid) #else @@ -509,7 +509,7 @@ int afs_lockctl(struct vcache * avc, struct AFS_FLOCK * af, int acmd, acmd = F_SETLK; } #endif -#if (defined(AFS_SUN_ENV) || defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV)) && !defined(AFS_SUN58_ENV) +#if (defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV)) && !defined(AFS_SUN58_ENV) if ((acmd == F_GETLK) || (acmd == F_RGETLK)) { #else if (acmd == F_GETLK) { @@ -525,7 +525,7 @@ int afs_lockctl(struct vcache * avc, struct AFS_FLOCK * af, int acmd, afs_PutFakeStat(&fakestate); return code; } else if ((acmd == F_SETLK) || (acmd == F_SETLKW) -#if (defined(AFS_SUN_ENV) || defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV)) && !defined(AFS_SUN58_ENV) +#if (defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV)) && !defined(AFS_SUN58_ENV) || (acmd == F_RSETLK) || (acmd == F_RSETLKW)) { #else ) { @@ -564,12 +564,12 @@ int afs_lockctl(struct vcache * avc, struct AFS_FLOCK * af, int acmd, return EINVAL; /* unknown lock type */ } if (((acmd == F_SETLK) -#if (defined(AFS_SGI_ENV) || defined(AFS_SUN_ENV)) && !defined(AFS_SUN58_ENV) +#if (defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV)) && !defined(AFS_SUN58_ENV) || (acmd == F_RSETLK) #endif ) && code != LOCK_UN) code |= LOCK_NB; /* non-blocking, s.v.p. */ -#if (defined(AFS_SUN_ENV) && !defined(AFS_SUN5_ENV)) || defined(AFS_OSF_ENV) +#if defined(AFS_OSF_ENV) code = HandleFlock(avc, code, &treq, clid, 0 /*!onlymine */ ); #elif defined(AFS_SGI_ENV) AFS_RWLOCK((vnode_t *) avc, VRWLOCK_WRITE); @@ -885,17 +885,6 @@ afs_xflock(void) tvc = VTOAFS(fd->f_data); /* valid, given a vnode */ if (IsAfsVnode(AFSTOV(tvc))) { /* This is an AFS vnode, so do the work */ -#ifdef AFS_DEC_ENV - /* find real vcache entry; shouldn't be null if gnode ref count - * is greater than 0. - */ - tvc = VTOAFS(afs_gntovn) (tvc); - if (!tvc) { - u.u_error = ENOENT; - afs_PutFakeStat(&fakestate); - return; - } -#endif code = afs_EvalFakeStat(&tvc, &fakestate, &treq); if (code) { afs_PutFakeStat(&fakestate); @@ -903,7 +892,7 @@ afs_xflock(void) } 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) || (defined(AFS_SUN_ENV) && !defined(AFS_SUN5_ENV)) +#if defined(AFS_SGI_ENV) || defined(AFS_OSF_ENV) HandleFlock(tvc, LOCK_UN, &treq, u.u_procp->p_pid, 0 /*!onlymine */ ); #else @@ -913,7 +902,7 @@ afs_xflock(void) } /* now try the requested operation */ -#if defined(AFS_SGI_ENV) || defined(AFS_OSF_ENV) || (defined(AFS_SUN_ENV) && !defined(AFS_SUN5_ENV)) +#if defined(AFS_SGI_ENV) || defined(AFS_OSF_ENV) code = HandleFlock(tvc, uap->com, &treq, u.u_procp->p_pid, 0 /*!onlymine */ ); diff --git a/src/afs/VNOPS/afs_vnop_open.c b/src/afs/VNOPS/afs_vnop_open.c index 04c707e..cab75bb 100644 --- a/src/afs/VNOPS/afs_vnop_open.c +++ b/src/afs/VNOPS/afs_vnop_open.c @@ -123,11 +123,11 @@ afs_open(struct vcache **avcp, afs_int32 aflags, struct AFS_UCRED *acred) #endif /* normal file or symlink */ osi_FlushText(tvc); /* only needed to flush text if text locked last time */ -#if defined(AFS_SUN_ENV) || defined(AFS_ALPHA_ENV) || defined(AFS_SUN5_ENV) +#ifdef AFS_BOZONLOCK_ENV afs_BozonLock(&tvc->pvnLock, tvc); #endif osi_FlushPages(tvc, acred); -#if defined(AFS_SUN_ENV) || defined(AFS_ALPHA_ENV) || defined(AFS_SUN5_ENV) +#ifdef AFS_BOZONLOCK_ENV afs_BozonUnlock(&tvc->pvnLock, tvc); #endif } diff --git a/src/afs/VNOPS/afs_vnop_read.c b/src/afs/VNOPS/afs_vnop_read.c index aa2ed8d..0d7ab8a 100644 --- a/src/afs/VNOPS/afs_vnop_read.c +++ b/src/afs/VNOPS/afs_vnop_read.c @@ -782,8 +782,6 @@ afs_UFSRead(register struct vcache *avc, struct uio *auio, AFS_GUNLOCK(); VOP_READ(tfile->vnode, &tuio, 0, afs_osi_credp, code); AFS_GLOCK(); -#elif defined(AFS_SUN_ENV) - code = VOP_RDWR(tfile->vnode, &tuio, UIO_READ, 0, afs_osi_credp); #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 8bbd74b..a7a3e87 100644 --- a/src/afs/VNOPS/afs_vnop_readdir.c +++ b/src/afs/VNOPS/afs_vnop_readdir.c @@ -148,23 +148,20 @@ struct min_direct { /* miniature direct structure */ u_short d_reclen; u_char d_type; u_char d_namlen; -#else -#ifdef AFS_SUN5_ENV +#elif defined(AFS_SUN5_ENV) afs_uint32 d_fileno; afs_int32 d_off; u_short d_reclen; #else -#if defined(AFS_SUN_ENV) || defined(AFS_AIX32_ENV) +#if defined(AFS_AIX32_ENV) afs_int32 d_off; -#endif -#if defined(AFS_HPUX100_ENV) +#elif defined(AFS_HPUX100_ENV) unsigned long long d_off; #endif afs_uint32 d_fileno; u_short d_reclen; u_short d_namlen; #endif -#endif }; #endif /* AFS_SGI_ENV */ @@ -478,7 +475,7 @@ afs_readdir_move(de, vc, auio, slen, rlen, off) #if !defined(AFS_SGI_ENV) sdirEntry.d_namlen = slen; #endif -#if defined(AFS_SUN_ENV) || defined(AFS_AIX32_ENV) || defined(AFS_SGI_ENV) +#if defined(AFS_AIX32_ENV) || defined(AFS_SGI_ENV) sdirEntry.d_off = off; #endif #if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) @@ -726,7 +723,7 @@ afs_readdir(OSI_VC_ARG(avc), auio, acred) FIXUPSTUPIDINODE(sdirEntry->d_fileno); sdirEntry->d_reclen = rlen = auio->afsio_resid; sdirEntry->d_namlen = o_slen; -#if defined(AFS_SUN_ENV) || defined(AFS_AIX32_ENV) || defined(AFS_HPUX100_ENV) +#if defined(AFS_SUN5_ENV) || defined(AFS_AIX32_ENV) || defined(AFS_HPUX100_ENV) sdirEntry->d_off = origOffset; #endif AFS_UIOMOVE((char *)sdirEntry, sizeof(*sdirEntry), UIO_READ, @@ -795,7 +792,7 @@ afs_readdir(OSI_VC_ARG(avc), auio, acred) FIXUPSTUPIDINODE(sdirEntry->d_fileno); sdirEntry->d_reclen = rlen = auio->afsio_resid; sdirEntry->d_namlen = o_slen; -#if defined(AFS_SUN_ENV) || defined(AFS_AIX32_ENV) || defined(AFS_HPUX100_ENV) +#if defined(AFS_SUN5_ENV) || defined(AFS_AIX32_ENV) || defined(AFS_HPUX100_ENV) sdirEntry->d_off = origOffset; #endif AFS_UIOMOVE((char *)sdirEntry, sizeof(*sdirEntry), UIO_READ, @@ -850,7 +847,7 @@ afs_readdir(OSI_VC_ARG(avc), auio, acred) FIXUPSTUPIDINODE(sdirEntry->d_fileno); sdirEntry->d_reclen = rlen = len; sdirEntry->d_namlen = o_slen; -#if defined(AFS_SUN_ENV) || defined(AFS_AIX32_ENV) || defined(AFS_HPUX100_ENV) +#if defined(AFS_SUN5_ENV) || defined(AFS_AIX32_ENV) || defined(AFS_HPUX100_ENV) sdirEntry->d_off = origOffset; #endif AFS_UIOMOVE((char *)sdirEntry, sizeof(*sdirEntry), UIO_READ, auio, diff --git a/src/afs/VNOPS/afs_vnop_remove.c b/src/afs/VNOPS/afs_vnop_remove.c index 0650a39..5a1fb9d 100644 --- a/src/afs/VNOPS/afs_vnop_remove.c +++ b/src/afs/VNOPS/afs_vnop_remove.c @@ -169,7 +169,7 @@ afsremove(register struct vcache *adp, register struct dcache *tdc, * call FindVCache instead of GetVCache since if the file's really * gone, we won't be able to fetch the status info anyway. */ if (tvc) { -#if defined(AFS_SUN_ENV) || defined(AFS_ALPHA_ENV) || defined(AFS_SUN5_ENV) +#ifdef AFS_BOZONLOCK_ENV afs_BozonLock(&tvc->pvnLock, tvc); /* Since afs_TryToSmush will do a pvn_vptrunc */ #endif @@ -183,7 +183,7 @@ afsremove(register struct vcache *adp, register struct dcache *tdc, afs_TryToSmush(tvc, acred, 0); } ReleaseWriteLock(&tvc->lock); -#if defined(AFS_SUN_ENV) || defined(AFS_ALPHA_ENV) || defined(AFS_SUN5_ENV) +#ifdef AFS_BOZONLOCK_ENV afs_BozonUnlock(&tvc->pvnLock, tvc); #endif afs_PutVCache(tvc); diff --git a/src/afs/VNOPS/afs_vnop_rename.c b/src/afs/VNOPS/afs_vnop_rename.c index ae4aea2..2fe49ab 100644 --- a/src/afs/VNOPS/afs_vnop_rename.c +++ b/src/afs/VNOPS/afs_vnop_rename.c @@ -299,7 +299,7 @@ afsrename(struct vcache *aodp, char *aname1, struct vcache *andp, tvc = afs_GetVCache(&unlinkFid, areq, NULL, NULL); if (tvc) { -#if defined(AFS_SUN_ENV) || defined(AFS_ALPHA_ENV) || defined(AFS_SUN5_ENV) +#ifdef AFS_BOZONLOCK_ENV afs_BozonLock(&tvc->pvnLock, tvc); /* Since afs_TryToSmush will do a pvn_vptrunc */ #endif ObtainWriteLock(&tvc->lock, 151); @@ -318,7 +318,7 @@ afsrename(struct vcache *aodp, char *aname1, struct vcache *andp, afs_TryToSmush(tvc, acred, 0); } ReleaseWriteLock(&tvc->lock); -#if defined(AFS_SUN_ENV) || defined(AFS_ALPHA_ENV) || defined(AFS_SUN5_ENV) +#ifdef AFS_BOZONLOCK_ENV afs_BozonUnlock(&tvc->pvnLock, tvc); #endif afs_PutVCache(tvc); diff --git a/src/afs/VNOPS/afs_vnop_strategy.c b/src/afs/VNOPS/afs_vnop_strategy.c index c6f5890..20cd673 100644 --- a/src/afs/VNOPS/afs_vnop_strategy.c +++ b/src/afs/VNOPS/afs_vnop_strategy.c @@ -78,7 +78,7 @@ afs_ustrategy(abp) */ tuio.afsio_iov = tiovec; tuio.afsio_iovcnt = 1; -#if defined(AFS_SUN_ENV) || defined(AFS_ALPHA_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_XBSD_ENV) +#if defined(AFS_OSF_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_XBSD_ENV) #ifdef AFS_64BIT_CLIENT tuio.afsio_offset = (afs_offs_t) dbtob(abp->b_blkno); #else /* AFS_64BIT_CLIENT */ @@ -136,7 +136,7 @@ afs_ustrategy(abp) } else { tuio.afsio_iov = tiovec; tuio.afsio_iovcnt = 1; -#if defined(AFS_SUN_ENV) || defined(AFS_ALPHA_ENV) || defined(AFS_SUN5_ENV) +#if defined(AFS_OSF_ENV) || defined(AFS_SUN5_ENV) #ifdef AFS_64BIT_CLIENT tuio.afsio_offset = (afs_offs_t) dbtob(abp->b_blkno); #else /* AFS_64BIT_CLIENT */ @@ -166,11 +166,11 @@ afs_ustrategy(abp) */ len = MIN(len, tvc->m.Length - dbtob(abp->b_blkno)); #endif -#ifdef AFS_ALPHA_ENV +#ifdef AFS_OSF_ENV len = MIN(abp->b_bcount, (VTOAFS(abp->b_vp))->m.Length - dbtob(abp->b_blkno)); -#endif /* AFS_ALPHA_ENV */ +#endif /* AFS_OSF_ENV */ tuio.afsio_resid = len; #if defined(AFS_XBSD_ENV) tiovec[0].iov_base = abp->b_saveaddr; diff --git a/src/afs/VNOPS/afs_vnop_write.c b/src/afs/VNOPS/afs_vnop_write.c index 80297ac..22e0feb 100644 --- a/src/afs/VNOPS/afs_vnop_write.c +++ b/src/afs/VNOPS/afs_vnop_write.c @@ -159,16 +159,12 @@ afs_MemWrite(register struct vcache *avc, struct uio *auio, int aio, */ avc->m.Date = startDate; -#if defined(AFS_HPUX_ENV) || defined(AFS_GFS_ENV) +#if defined(AFS_HPUX_ENV) #if defined(AFS_HPUX101_ENV) if ((totalLength + filePos) >> 9 > (p_rlimit(u.u_procp))[RLIMIT_FSIZE].rlim_cur) { #else -#ifdef AFS_HPUX_ENV if ((totalLength + filePos) >> 9 > u.u_rlimit[RLIMIT_FSIZE].rlim_cur) { -#else - if (totalLength + filePos > u.u_rlimit[RLIMIT_FSIZE].rlim_cur) { -#endif #endif if (!noLock) ReleaseWriteLock(&avc->lock); @@ -327,11 +323,6 @@ afs_MemWrite(register struct vcache *avc, struct uio *auio, int aio, if (!noLock) ReleaseWriteLock(&avc->lock); osi_FreeSmallSpace(tvec); -#ifdef AFS_DEC_ENV - /* next, on GFS systems, we update g_size so that lseek's relative to EOF will - * work. GFS is truly a poorly-designed interface! */ - afs_gfshack((struct gnode *)avc); -#endif error = afs_CheckCode(error, &treq, 6); return error; } @@ -410,16 +401,12 @@ afs_UFSWrite(register struct vcache *avc, struct uio *auio, int aio, */ avc->m.Date = startDate; -#if defined(AFS_HPUX_ENV) || defined(AFS_GFS_ENV) +#if defined(AFS_HPUX_ENV) #if defined(AFS_HPUX101_ENV) if ((totalLength + filePos) >> 9 > p_rlimit(u.u_procp)[RLIMIT_FSIZE].rlim_cur) { #else -#ifdef AFS_HPUX_ENV if ((totalLength + filePos) >> 9 > u.u_rlimit[RLIMIT_FSIZE].rlim_cur) { -#else - if (totalLength + filePos > u.u_rlimit[RLIMIT_FSIZE].rlim_cur) { -#endif #endif if (!noLock) ReleaseWriteLock(&avc->lock); @@ -664,11 +651,6 @@ afs_UFSWrite(register struct vcache *avc, struct uio *auio, int aio, if (!noLock) ReleaseWriteLock(&avc->lock); osi_FreeSmallSpace(tvec); -#ifdef AFS_DEC_ENV - /* next, on GFS systems, we update g_size so that lseek's relative to EOF will - * work. GFS is truly a poorly-designed interface! */ - afs_gfshack((struct gnode *)avc); -#endif #ifndef AFS_VM_RDWR_ENV /* * If write is implemented via VM, afs_fsync() is called from the high-level @@ -770,11 +752,7 @@ afs_closex(register struct file *afd) if (flags) HandleFlock(tvc, LOCK_UN, &treq, u.u_procp->p_pid, 1 /*onlymine */ ); -#ifdef AFS_DEC_ENV - grele((struct gnode *)tvc); -#else AFS_RELE(AFSTOV(tvc)); -#endif closeDone = 1; } } @@ -807,13 +785,9 @@ afs_close(OSI_VC_ARG(avc), aflags, lastclose, struct flid *flp; #endif #endif -#elif defined(AFS_SUN_ENV) || defined(AFS_SUN5_ENV) -#ifdef AFS_SUN5_ENV +#elif defined(AFS_SUN5_ENV) afs_close(OSI_VC_ARG(avc), aflags, count, offset, acred) offset_t offset; -#else -afs_close(OSI_VC_ARG(avc), aflags, count, acred) -#endif int count; #else afs_close(OSI_VC_ARG(avc), aflags, acred) @@ -853,7 +827,7 @@ afs_close(OSI_VC_ARG(avc), aflags, acred) afs_PutFakeStat(&fakestat); return 0; } -#elif defined(AFS_SUN_ENV) || defined(AFS_SGI_ENV) +#elif defined(AFS_SUN5_ENV) || defined(AFS_SGI_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. */ afs_PutFakeStat(&fakestat); @@ -880,7 +854,7 @@ afs_close(OSI_VC_ARG(avc), aflags, acred) afs_chkpgoob(&avc->v, btoc(avc->m.Length)); #else /* AFS_SGI_ENV */ if (avc->flockCount) { /* Release Lock */ -#if defined(AFS_OSF_ENV) || defined(AFS_SUN_ENV) +#if defined(AFS_OSF_ENV) HandleFlock(avc, LOCK_UN, &treq, u.u_procp->p_pid, 1 /*onlymine */ ); #else HandleFlock(avc, LOCK_UN, &treq, 0, 1 /*onlymine */ ); diff --git a/src/afs/afs.h b/src/afs/afs.h index c509db7..0b851aa 100644 --- a/src/afs/afs.h +++ b/src/afs/afs.h @@ -29,7 +29,7 @@ extern int afs_shuttingdown; * Macros to uniquely identify the AFS vfs struct */ #define AFS_VFSMAGIC 0x1234 -#if defined(AFS_SUN_ENV) || defined(AFS_HPUX90_ENV) || defined(AFS_LINUX20_ENV) +#if defined(AFS_SUN5_ENV) || defined(AFS_HPUX90_ENV) || defined(AFS_LINUX20_ENV) #define AFS_VFSFSID 99 #else #if defined(AFS_SGI_ENV) @@ -641,7 +641,7 @@ struct vcache { krwlock_t rwlock; struct cred *credp; #endif -#if defined(AFS_SUN_ENV) || defined(AFS_ALPHA_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) +#ifdef AFS_BOZONLOCK_ENV afs_bozoLock_t pvnLock; /* see locks.x */ #endif #ifdef AFS_AIX32_ENV diff --git a/src/afs/afs_buffer.c b/src/afs/afs_buffer.c index a3c1a6d..f8894e7 100644 --- a/src/afs/afs_buffer.c +++ b/src/afs/afs_buffer.c @@ -19,7 +19,7 @@ RCSID #include "h/param.h" #include "h/types.h" #include "h/time.h" -#if defined(AFS_AIX31_ENV) || defined(AFS_DEC_ENV) +#if defined(AFS_AIX31_ENV) #include "h/limits.h" #endif #if !defined(AFS_AIX_ENV) && !defined(AFS_SUN5_ENV) && !defined(AFS_SGI_ENV) && !defined(AFS_LINUX20_ENV) diff --git a/src/afs/afs_call.c b/src/afs/afs_call.c index 6262ebf..5260e4f 100644 --- a/src/afs/afs_call.c +++ b/src/afs/afs_call.c @@ -31,7 +31,7 @@ RCSID #endif -#if defined(AFS_AIX_ENV) || defined(AFS_SGI_ENV) || defined(AFS_SUN_ENV) || defined(AFS_HPUX_ENV) +#if defined(AFS_SUN5_ENV) || defined(AFS_AIX_ENV) || defined(AFS_SGI_ENV) || defined(AFS_HPUX_ENV) #define AFS_MINBUFFERS 100 #else #define AFS_MINBUFFERS 50 @@ -505,7 +505,7 @@ afs_syscall_call(parm, parm2, parm3, parm4, parm5, parm6) while (!afs_InitSetup_done) afs_osi_Sleep(&afs_InitSetup_done); -#if defined(AFS_SUN_ENV) || defined(AFS_SGI_ENV) || defined(AFS_HPUX_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) +#if defined(AFS_SGI_ENV) || defined(AFS_HPUX_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) || defined(AFS_SUN5_ENV) temp = AFS_MINBUFFERS; /* Should fix this soon */ #else /* number of 2k buffers we could get from all of the buffer space */ @@ -694,7 +694,7 @@ afs_syscall_call(parm, parm2, parm3, parm4, parm5, parm6) afs_initState = 101; afs_setTime = parm2; afs_osi_Wakeup(&afs_initState); -#if (!defined(AFS_NONFSTRANS) && !defined(AFS_DEC_ENV)) || defined(AFS_AIX_IAUTH_ENV) +#if (!defined(AFS_NONFSTRANS)) || defined(AFS_AIX_IAUTH_ENV) afs_nfsclient_init(); #endif printf("found %d non-empty cache files (%d%%).\n", @@ -1276,11 +1276,7 @@ Afs_syscall() } *uap = (struct a *)u.u_ap; #else /* UKERNEL */ int -#if defined(AFS_SUN_ENV) && !defined(AFS_SUN5_ENV) -afs_syscall() -#else Afs_syscall() -#endif /* SUN && !SUN5 */ { register struct a { long syscall; @@ -1292,9 +1288,7 @@ Afs_syscall() long parm6; } *uap = (struct a *)u.u_ap; #endif /* UKERNEL */ -#if defined(AFS_DEC_ENV) - int *retval = &u.u_r.r_val1; -#elif defined(AFS_HPUX_ENV) +#if defined(AFS_HPUX_ENV) long *retval = &u.u_rval1; #else int *retval = &u.u_rval1; @@ -1632,11 +1626,8 @@ afs_shutdown(void) shutdown_vfsops(); shutdown_exporter(); shutdown_memcache(); -#if !defined(AFS_NONFSTRANS) || defined(AFS_AIX_IAUTH_ENV) -#if !defined(AFS_DEC_ENV) && !defined(AFS_OSF_ENV) - /* this routine does not exist in Ultrix systems... 93.01.19 */ +#if (!defined(AFS_NONFSTRANS) || defined(AFS_AIX_IAUTH_ENV)) && !defined(AFS_OSF_ENV) shutdown_nfsclnt(); -#endif /* AFS_DEC_ENV */ #endif shutdown_afstest(); /* The following hold the cm stats */ @@ -1671,7 +1662,7 @@ afs_shutdown_BKG(void) } -#if defined(AFS_ALPHA_ENV) || defined(AFS_SGI61_ENV) +#if defined(AFS_OSF_ENV) || 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; @@ -2106,16 +2097,16 @@ afs_icl_AppendString(struct afs_icl_log *logp, char *astr) (lp)->logElements++; \ MACRO_END -#if defined(AFS_ALPHA_ENV) || (defined(AFS_SGI61_ENV) && (_MIPS_SZLONG==64)) || (defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL)) +#if defined(AFS_OSF_ENV) || (defined(AFS_SGI61_ENV) && (_MIPS_SZLONG==64)) || (defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL)) #define ICL_APPENDLONG(lp, x) \ MACRO_BEGIN \ ICL_APPENDINT32((lp), ((x) >> 32) & 0xffffffffL); \ ICL_APPENDINT32((lp), (x) & 0xffffffffL); \ MACRO_END -#else /* AFS_ALPHA_ENV */ +#else /* AFS_OSF_ENV */ #define ICL_APPENDLONG(lp, x) ICL_APPENDINT32((lp), (x)) -#endif /* AFS_ALPHA_ENV */ +#endif /* AFS_OSF_ENV */ /* routine to tell whether we're dealing with the address or the * object itself @@ -2260,10 +2251,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_ALPHA_ENV) || (defined(AFS_SGI61_ENV) && (_MIPS_SZLONG==64)) || (defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL)) +#if defined(AFS_OSF_ENV) || (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_ALPHA_ENV */ +#endif /* AFS_OSF_ENV */ else ICL_APPENDLONG(logp, p1); } @@ -2300,10 +2291,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_ALPHA_ENV) || (defined(AFS_SGI61_ENV) && (_MIPS_SZLONG==64)) || (defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL)) +#if defined(AFS_OSF_ENV) || (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_ALPHA_ENV */ +#endif /* AFS_OSF_ENV */ else ICL_APPENDLONG(logp, p2); } @@ -2340,10 +2331,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_ALPHA_ENV) || (defined(AFS_SGI61_ENV) && (_MIPS_SZLONG==64)) || (defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL)) +#if defined(AFS_OSF_ENV) || (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_ALPHA_ENV */ +#endif /* AFS_OSF_ENV */ else ICL_APPENDLONG(logp, p3); } @@ -2380,10 +2371,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_ALPHA_ENV) || (defined(AFS_SGI61_ENV) && (_MIPS_SZLONG==64)) || (defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL)) +#if defined(AFS_OSF_ENV) || (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_ALPHA_ENV */ +#endif /* AFS_OSF_ENV */ else ICL_APPENDLONG(logp, p4); } diff --git a/src/afs/afs_daemons.c b/src/afs/afs_daemons.c index 373216b..b8c01b3 100644 --- a/src/afs/afs_daemons.c +++ b/src/afs/afs_daemons.c @@ -338,29 +338,6 @@ afs_CheckRootVolume(void) afs_osi_Wakeup(&afs_initState); afs_PutVolume(tvp, READ_LOCK); } -#ifdef AFS_DEC_ENV -/* This is to make sure that we update the root gnode */ -/* every time root volume gets released */ - { - struct gnode *rootgp; - struct mount *mp; - int code; - - /* Only do this if afs_globalVFS is properly set due to race conditions - * this routine could be called before the gfs_mount is performed! - * Furthermore, afs_root (called below) *waits* until - * initState >= 200, so we don't try this until we've gotten - * at least that far */ - if (afs_globalVFS && afs_initState >= 200) { - if (code = afs_root(afs_globalVFS, &rootgp)) - return code; - mp = (struct mount *)afs_globalVFS->vfs_data; - mp->m_rootgp = gget(mp, 0, 0, (char *)rootgp); - afs_unlock(mp->m_rootgp); /* unlock basic gnode */ - afs_vrele(VTOAFS(rootgp)); /* zap afs_root's vnode hold */ - } - } -#endif if (afs_rootFid.Fid.Volume) return 0; else @@ -400,37 +377,25 @@ BPath(register struct brequest *ab) if (!tvn || !IsAfsVnode(tvn)) { /* release it and give up */ if (tvn) { -#ifdef AFS_DEC_ENV - grele(tvn); -#else #ifdef AFS_LINUX22_ENV dput(dp); #else AFS_RELE(tvn); #endif -#endif } return; } -#ifdef AFS_DEC_ENV - tvc = VTOAFS(afs_gntovn(tvn)); -#else tvc = VTOAFS(tvn); -#endif /* here we know its an afs vnode, so we can get the data for the chunk */ tdc = afs_GetDCache(tvc, ab->size_parm[0], &treq, &offset, &len, 1); if (tdc) { afs_PutDCache(tdc); } -#ifdef AFS_DEC_ENV - grele(tvn); -#else #ifdef AFS_LINUX22_ENV dput(dp); #else AFS_RELE(tvn); #endif -#endif } /* size_parm 0 to the fetch is the chunk number, @@ -570,11 +535,7 @@ afs_BQueue(register short aopcode, register struct vcache *avc, tb->cred = acred; crhold(tb->cred); if (avc) { -#ifdef AFS_DEC_ENV - avc->vrefCount++; -#else VN_HOLD(AFSTOV(avc)); -#endif } tb->refCount = ause + 1; tb->size_parm[0] = asparm0; @@ -1295,11 +1256,7 @@ afs_BackgroundDaemon(void) else panic("background bop"); if (tb->vc) { -#ifdef AFS_DEC_ENV - tb->vc->vrefCount--; /* fix up reference count */ -#else AFS_RELE(AFSTOV(tb->vc)); /* MUST call vnode layer or could lose vnodes */ -#endif tb->vc = NULL; } if (tb->cred) { diff --git a/src/afs/afs_dcache.c b/src/afs/afs_dcache.c index e19999a..54f3955 100644 --- a/src/afs/afs_dcache.c +++ b/src/afs/afs_dcache.c @@ -625,9 +625,7 @@ afs_GetDownD(int anumber, int *aneedSpace) ICL_TYPE_POINTER, tvc, ICL_TYPE_INT32, 3, ICL_TYPE_INT32, tdc->index, ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(tchunkoffset)); -#ifndef AFS_DEC_ENV AFS_STATCNT(afs_gget); -#endif afs_HashOutDCache(tdc); if (tdc->f.chunkBytes != 0) { discard = 1; @@ -682,9 +680,7 @@ afs_HashOutDCache(struct dcache *adc) { int i, us; -#ifndef AFS_DEC_ENV AFS_STATCNT(afs_glink); -#endif /* we know this guy's in the LRUQ. We'll move dude into DCQ below */ DZap(adc); /* if this guy is in the hash table, pull him out */ @@ -1857,7 +1853,7 @@ afs_GetDCache(register struct vcache *avc, afs_size_t abyte, #endif /* AFS_SGI_ENV */ if (AFS_CHUNKTOBASE(chunk) + adjustsize >= avc->m.Length && #else /* defined(AFS_AIX32_ENV) || defined(AFS_SGI_ENV) */ -#if defined(AFS_SUN_ENV) || defined(AFS_OSF_ENV) +#if defined(AFS_SUN5_ENV) || defined(AFS_OSF_ENV) if ((doAdjustSize || (AFS_CHUNKTOBASE(chunk) >= avc->m.Length)) && #else if (AFS_CHUNKTOBASE(chunk) >= avc->m.Length && @@ -3025,11 +3021,7 @@ afs_InitCacheFile(char *afile, ino_t ainode) dput(filevp); #else tdc->f.inode = afs_vnodeToInumber(filevp); -#ifdef AFS_DEC_ENV - grele(filevp); -#else AFS_RELE(filevp); -#endif #endif /* AFS_LINUX22_ENV */ } else { tdc->f.inode = ainode; diff --git a/src/afs/afs_init.c b/src/afs/afs_init.c index ce8e80e..2c872c9 100644 --- a/src/afs/afs_init.c +++ b/src/afs/afs_init.c @@ -27,7 +27,7 @@ RCSID /* Exported variables */ struct osi_dev cacheDev; /*Cache device */ afs_int32 cacheInfoModTime; /*Last time cache info modified */ -#if defined(AFS_OSF_ENV) || defined(AFS_DEC_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) +#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) struct mount *afs_cacheVfsp = 0; #elif defined(AFS_LINUX20_ENV) struct super_block *afs_cacheSBp = 0; @@ -251,11 +251,7 @@ LookupInodeByPath(char *filename, ino_t * inode, struct vnode **fvpp) if (fvpp) *fvpp = filevp; else { -#if defined(AFS_DEC_ENV) - grele(filevp); -#else AFS_RELE(filevp); -#endif } #endif /* AFS_LINUX22_ENV */ @@ -691,7 +687,7 @@ shutdown_cache(void) void shutdown_vnodeops(void) { -#if !defined(AFS_SGI_ENV) && !defined(AFS_SUN_ENV) && !defined(AFS_SUN5_ENV) +#if !defined(AFS_SGI_ENV) && !defined(AFS_SUN5_ENV) struct buf *afs_bread_freebp = 0; #endif @@ -704,7 +700,7 @@ shutdown_vnodeops(void) #ifndef AFS_LINUX20_ENV afs_rd_stash_i = 0; #endif -#if !defined(AFS_SGI_ENV) && !defined(AFS_SUN_ENV) && !defined(AFS_SUN5_ENV) +#if !defined(AFS_SGI_ENV) && !defined(AFS_SUN5_ENV) afs_bread_freebp = 0; #endif shutdown_mariner(); diff --git a/src/afs/afs_memcache.c b/src/afs/afs_memcache.c index a5ffe96..786ec62 100644 --- a/src/afs/afs_memcache.c +++ b/src/afs/afs_memcache.c @@ -17,13 +17,13 @@ RCSID #ifndef AFS_LINUX22_ENV #include "rpc/types.h" #endif -#ifdef AFS_ALPHA_ENV +#ifdef AFS_OSF_ENV #undef kmem_alloc #undef kmem_free #undef mem_alloc #undef mem_free #undef register -#endif /* AFS_ALPHA_ENV */ +#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 b433dd2..5f16f66 100644 --- a/src/afs/afs_nfsclnt.c +++ b/src/afs/afs_nfsclnt.c @@ -14,7 +14,6 @@ RCSID ("$Header$"); #if !defined(AFS_NONFSTRANS) || defined(AFS_AIX_IAUTH_ENV) -#ifndef AFS_DEC_ENV #include "afs/sysincludes.h" /* Standard vendor system headers */ #include "afsincludes.h" /* Afs-based standard headers */ #include "afs/afs_stats.h" /* statistics */ @@ -460,10 +459,6 @@ afs_iauth_unregister() shutdown_nfsclnt() { -#if 0 - extern int afs_allnfsreqs, afs_nfscalls; -#endif - #if defined(AFS_SGIMP_ENV) osi_Assert(ISAFS_GLOCK()); #endif @@ -473,10 +468,5 @@ shutdown_nfsclnt() #endif afs_nfsclient_GC(afs_nfsexporter, -1); init_nfsexporter = 0; -#if 0 - /* The following are for the nfs/afs server */ - afs_allnfsreqs = afs_nfscalls = 0; -#endif } -#endif /* AFS_DEC_ENV */ #endif /* AFS_NONFSTRANS */ diff --git a/src/afs/afs_osi.c b/src/afs/afs_osi.c index e03e494..3ea337a 100644 --- a/src/afs/afs_osi.c +++ b/src/afs/afs_osi.c @@ -98,13 +98,9 @@ int osi_Active(register struct vcache *avc) { AFS_STATCNT(osi_Active); -#if defined(AFS_SUN_ENV) || 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_OSF_ENV) || defined(AFS_SUN5_ENV) || (AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) if ((avc->opens > 0) || (avc->states & CMAPPED)) return 1; /* XXX: Warning, verify this XXX */ -#elif defined(AFS_MACH_ENV) - if (avc->opens > 0 - || ((avc->v.v_flag & VTEXT) && !inode_uncache_try(avc))) - return 1; #elif defined(AFS_SGI_ENV) if ((avc->opens > 0) || AFS_VN_MAPPED(AFSTOV(avc))) return 1; @@ -189,14 +185,6 @@ osi_FlushText_really(register struct vcache *vp) if (hcmp(vp->m.DataVersion, vp->flushDV) <= 0) return; -#ifdef AFS_DEC_ENV - { - void afs_gfs_FlushText(); - afs_gfs_FlushText(vp); - return; - } -#else - MObtainWriteLock(&afs_ftf, 317); hset(fdv, vp->m.DataVersion); @@ -239,60 +227,7 @@ osi_FlushText_really(register struct vcache *vp) hset(vp->flushDV, fdv); MReleaseWriteLock(&afs_ftf); -#endif /* AFS_DEC_ENV */ } - -#ifdef AFS_DEC_ENV -/* I don't really like using xinval() here, because it kills processes - * a bit aggressively. Previous incarnations of this functionality - * used to use xrele() instead of xinval, and didn't invoke - * cacheinval(). But they would panic. So it might be worth looking - * into some middle ground... - */ -static void -afs_gfs_FlushText(register struct vcache *vp) -{ - afs_hyper_t fdv; /* version before which we'll flush */ - register struct text *xp; - struct gnode *gp; - - MObtainWriteLock(&afs_ftf, 318); - hset(fdv, vp->m.DataVersion); - gp = afs_vntogn(vp); - - if (!gp) { - /* this happens frequently after cores are created. */ - MReleaseWriteLock(&afs_ftf); - return; - } - - if (gp->g_flag & GTEXT) { - if (gp->g_textp) { - xp = (struct text *)gp->g_textp; - /* if text object is locked, give up */ - if (xp && (xp->x_flag & XLOCK)) { - MReleaseWriteLock(&afs_ftf); - return; - } - } else - xp = NULL; - - if (gp->g_flag & GTEXT) { /* still has a text object? */ - xinval(gp); - } - } - - /* next do the stuff that need not check for deadlock problems */ - /* maybe xinval(gp); here instead of above */ - binval(NODEV, gp); - cacheinval(gp); - /* finally, record that we've done it */ - hset(vp->flushDV, fdv); - - MReleaseWriteLock(&afs_ftf); -} -#endif /* AFS_DEC_ENV */ - #endif /* AFS_TEXT_ENV */ /* mask signals in afsds */ @@ -345,8 +280,6 @@ afs_osi_Invisible(void) { #ifdef AFS_LINUX22_ENV afs_osi_MaskSignals(); -#elif defined(AFS_DEC_ENV) - u.u_procp->p_type |= SSYS; #elif defined(AFS_SUN5_ENV) curproc->p_flag |= SSYS; #elif defined(AFS_HPUX101_ENV) && !defined(AFS_HPUX1123_ENV) @@ -465,7 +398,7 @@ afs_osi_Alloc(size_t x) #else size = x; tm = (struct osimem *)AFS_KALLOC(size); -#ifdef AFS_SUN_ENV +#ifdef AFS_SUN5_ENV if (!tm) osi_Panic("osi_Alloc: Couldn't allocate %d bytes; out of memory!\n", size); @@ -474,7 +407,7 @@ afs_osi_Alloc(size_t x) #endif } -#if defined(AFS_SUN_ENV) || defined(AFS_SGI_ENV) +#if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) void * afs_osi_Alloc_NoSleep(size_t x) @@ -577,7 +510,7 @@ osi_VMDirty_p(struct vcache *avc) #endif #endif /* AFS_AIX32_ENV */ -#if defined (AFS_SUN_ENV) +#if defined (AFS_SUN5_ENV) if (avc->states & CMAPPED) { struct page *pg; for (pg = avc->v.v_s.v_Pages; pg; pg = pg->p_vpnext) { diff --git a/src/afs/afs_pioctl.c b/src/afs/afs_pioctl.c index 1987ea2..6b508d5 100644 --- a/src/afs/afs_pioctl.c +++ b/src/afs/afs_pioctl.c @@ -597,13 +597,6 @@ afs_xioctl(void) #endif #endif /* AFS_LINUX22_ENV */ if (tvc && IsAfsVnode(AFSTOV(tvc))) { -#ifdef AFS_DEC_ENV - tvc = VTOAFS(afs_gntovn((struct gnode *)tvc)); - if (!tvc) { /* shouldn't happen with held gnodes */ - u.u_error = ENOENT; - return; - } -#endif /* This is an AFS vnode */ if (((uap->com >> 8) & 0xff) == 'V') { register struct afs_ioctl *datap; @@ -860,9 +853,6 @@ afs_syscall_pioctl(path, com, cmarg, follow) struct AFS_UCRED *foreigncreds = NULL; register afs_int32 code = 0; struct vnode *vp = NULL; -#ifdef AFS_DEC_ENV - struct vnode *gp; -#endif #ifdef AFS_AIX41_ENV struct ucred *credp = crref(); /* don't free until done! */ #endif @@ -976,18 +966,7 @@ afs_syscall_pioctl(path, com, cmarg, follow) /* now make the call if we were passed no file, or were passed an AFS file */ if (!vp || IsAfsVnode(vp)) { -#if defined(AFS_DEC_ENV) - /* Ultrix 4.0: can't get vcache entry unless we've got an AFS gnode. - * So, we must test in this part of the code. Also, must arrange to - * GRELE the original gnode pointer when we're done, since in Ultrix 4.0, - * we hold gnodes, whose references hold our vcache entries. - */ - if (vp) { - gp = vp; /* remember for "put" */ - vp = (struct vnode *)afs_gntovn(vp); /* get vcache from gp */ - } else - gp = NULL; -#elif defined(AFS_SUN5_ENV) +#if defined(AFS_SUN5_ENV) code = afs_HandlePioctl(vp, com, &data, follow, &credp); #elif defined(AFS_AIX41_ENV) { @@ -1026,12 +1005,6 @@ afs_syscall_pioctl(path, com, cmarg, follow) #else code = EINVAL; /* not in /afs */ #endif -#ifdef AFS_DEC_ENV - if (vp) { - GRELE(vp); - vp = NULL; - } -#endif } rescred: @@ -1682,7 +1655,7 @@ DECL_PIOCTL(PFlush) AFS_STATCNT(PFlush); if (!avc) return EINVAL; -#if defined(AFS_SUN_ENV) || defined(AFS_ALPHA_ENV) || defined(AFS_SUN5_ENV) +#ifdef AFS_BOZONLOCK_ENV afs_BozonLock(&avc->pvnLock, avc); /* Since afs_TryToSmush will do a pvn_vptrunc */ #endif ObtainWriteLock(&avc->lock, 225); @@ -1699,7 +1672,7 @@ DECL_PIOCTL(PFlush) avc->linkData = NULL; } ReleaseWriteLock(&avc->lock); -#if defined(AFS_SUN_ENV) || defined(AFS_ALPHA_ENV) || defined(AFS_SUN5_ENV) +#ifdef AFS_BOZONLOCK_ENV afs_BozonUnlock(&avc->pvnLock, avc); #endif return 0; @@ -2570,17 +2543,17 @@ DECL_PIOCTL(PFlushVolumeData) for (i = 0; i < VCSIZE; i++) { for (tvc = afs_vhashT[i]; tvc; tvc = tvc->hnext) { if (tvc->fid.Fid.Volume == volume && tvc->fid.Cell == cell) { -#if defined(AFS_SGI_ENV) || defined(AFS_ALPHA_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_HPUX_ENV) || defined(AFS_LINUX20_ENV) +#if defined(AFS_SGI_ENV) || defined(AFS_OSF_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_HPUX_ENV) || defined(AFS_LINUX20_ENV) VN_HOLD(AFSTOV(tvc)); #else #if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) osi_vnhold(tvc, 0); #else - VREFCOUNT_INC(tvc); + VREFCOUNT_INC(tvc); /* AIX, apparently */ #endif #endif ReleaseReadLock(&afs_xvcache); -#if defined(AFS_SUN_ENV) || defined(AFS_ALPHA_ENV) || defined(AFS_SUN5_ENV) +#ifdef AFS_BOZONLOCK_ENV afs_BozonLock(&tvc->pvnLock, tvc); /* Since afs_TryToSmush will do a pvn_vptrunc */ #endif ObtainWriteLock(&tvc->lock, 232); @@ -2593,7 +2566,7 @@ DECL_PIOCTL(PFlushVolumeData) osi_dnlc_purgedp(tvc); afs_TryToSmush(tvc, *acred, 1); ReleaseWriteLock(&tvc->lock); -#if defined(AFS_SUN_ENV) || defined(AFS_ALPHA_ENV) || defined(AFS_SUN5_ENV) +#ifdef AFS_BOZONLOCK_ENV afs_BozonUnlock(&tvc->pvnLock, tvc); #endif ObtainReadLock(&afs_xvcache); @@ -3374,7 +3347,7 @@ HandleClientContext(struct afs_ioctl *ablob, int *com, newcred->cr_groups[i] = NOGROUP; #endif #endif -#if !defined(AFS_OSF_ENV) && !defined(AFS_DEC_ENV) +#if !defined(AFS_OSF_ENV) afs_nfsclient_init(); /* before looking for exporter, ensure one exists */ #endif if (!(exporter = exporter_find(exporter_type))) { @@ -3540,7 +3513,7 @@ DECL_PIOCTL(PFlushMount) code = EINVAL; goto out; } -#if defined(AFS_SUN_ENV) || defined(AFS_ALPHA_ENV) || defined(AFS_SUN5_ENV) +#ifdef AFS_BOZONLOCK_ENV afs_BozonLock(&tvc->pvnLock, tvc); /* Since afs_TryToSmush will do a pvn_vptrunc */ #endif ObtainWriteLock(&tvc->lock, 649); @@ -3557,7 +3530,7 @@ DECL_PIOCTL(PFlushMount) tvc->linkData = NULL; } ReleaseWriteLock(&tvc->lock); -#if defined(AFS_SUN_ENV) || defined(AFS_ALPHA_ENV) || defined(AFS_SUN5_ENV) +#ifdef AFS_BOZONLOCK_ENV afs_BozonUnlock(&tvc->pvnLock, tvc); #endif afs_PutVCache(tvc); diff --git a/src/afs/afs_vcache.c b/src/afs/afs_vcache.c index 5188a17..0b72cca 100644 --- a/src/afs/afs_vcache.c +++ b/src/afs/afs_vcache.c @@ -581,9 +581,6 @@ afs_NewVCache(struct VenusFid *afid, struct server *serverp) #ifdef AFS_AIX_ENV struct gnode *gnodepnt; #endif -#ifdef AFS_MACH_ENV - struct vm_info *vm_info_ptr; -#endif /* AFS_MACH_ENV */ #ifdef AFS_OSF_ENV struct vcache *nvc; #endif /* AFS_OSF_ENV */ @@ -770,14 +767,6 @@ restart: #ifdef KERNEL_HAVE_PIN pin((char *)tvc, sizeof(struct vcache)); /* XXX */ #endif -#ifdef AFS_MACH_ENV - /* In case it still comes here we need to fill this */ - tvc->v.v_vm_info = VM_INFO_NULL; - vm_info_init(tvc->v.v_vm_info); - /* perhaps we should also do close_flush on non-NeXT mach systems; - * who knows; we don't currently have the sources. - */ -#endif /* AFS_MACH_ENV */ #if defined(AFS_SGI_ENV) { char name[METER_NAMSZ]; @@ -803,10 +792,6 @@ restart: } #endif /* AFS_OSF_ENV */ -#ifdef AFS_MACH_ENV - vm_info_ptr = tvc->v.v_vm_info; -#endif /* AFS_MACH_ENV */ - #if defined(AFS_XBSD_ENV) if (tvc->v) panic("afs_NewVCache(): free vcache with vnode attached"); @@ -823,10 +808,6 @@ restart: RWLOCK_INIT(&tvc->vlock, "vcache vlock"); #endif /* defined(AFS_SUN5_ENV) */ -#ifdef AFS_MACH_ENV - tvc->v.v_vm_info = vm_info_ptr; - tvc->v.v_vm_info->pager = MEMORY_OBJECT_NULL; -#endif /* AFS_MACH_ENV */ #ifdef AFS_OBSD_ENV AFS_GUNLOCK(); afs_nbsd_getnewvnode(tvc); /* includes one refcount */ @@ -977,7 +958,7 @@ restart: tvc->vmh = tvc->segid = NULL; tvc->credp = NULL; #endif -#if defined(AFS_SUN_ENV) || defined(AFS_ALPHA_ENV) || defined(AFS_SUN5_ENV) +#ifdef AFS_BOZONLOCK_ENV #if defined(AFS_SUN5_ENV) rw_init(&tvc->rwlock, "vcache rwlock", RW_DEFAULT, NULL); @@ -1070,9 +1051,6 @@ restart: tvc->v.v_next = gnodepnt->gn_vnode; /*Single vnode per gnode for us! */ gnodepnt->gn_vnode = &tvc->v; #endif -#ifdef AFS_DEC_ENV - tvc->v.g_dev = ((struct mount *)afs_globalVFS->vfs_data)->m_dev; -#endif #if defined(AFS_DUX40_ENV) insmntque(tvc, afs_globalVFS, &afs_ubcops); #else @@ -1193,7 +1171,7 @@ afs_FlushActiveVcaches(register afs_int32 doflocks) */ osi_vnhold(tvc, 0); ReleaseReadLock(&afs_xvcache); -#if defined(AFS_SUN_ENV) || defined(AFS_ALPHA_ENV) +#ifdef AFS_BOZONLOCK_ENV afs_BozonLock(&tvc->pvnLock, tvc); #endif #if defined(AFS_SGI_ENV) @@ -1215,7 +1193,7 @@ afs_FlushActiveVcaches(register afs_int32 doflocks) tvc->execsOrWriters); code = afs_StoreOnLastReference(tvc, &ureq); ReleaseWriteLock(&tvc->lock); -#if defined(AFS_SUN_ENV) || defined(AFS_ALPHA_ENV) +#ifdef AFS_BOZONLOCK_ENV afs_BozonUnlock(&tvc->pvnLock, tvc); #endif hzero(tvc->flushDV); @@ -1230,7 +1208,7 @@ afs_FlushActiveVcaches(register afs_int32 doflocks) * Ignore errors */ ReleaseWriteLock(&tvc->lock); -#if defined(AFS_SUN_ENV) || defined(AFS_ALPHA_ENV) +#ifdef AFS_BOZONLOCK_ENV afs_BozonUnlock(&tvc->pvnLock, tvc); #endif #if defined(AFS_SGI_ENV) @@ -1243,7 +1221,7 @@ afs_FlushActiveVcaches(register afs_int32 doflocks) } else { /* lost (or won, perhaps) the race condition */ ReleaseWriteLock(&tvc->lock); -#if defined(AFS_SUN_ENV) || defined(AFS_ALPHA_ENV) +#ifdef AFS_BOZONLOCK_ENV afs_BozonUnlock(&tvc->pvnLock, tvc); #endif } @@ -1253,11 +1231,7 @@ afs_FlushActiveVcaches(register afs_int32 doflocks) ObtainReadLock(&afs_xvcache); AFS_FAST_RELE(tvc); if (didCore) { -#ifdef AFS_GFS_ENV - VREFCOUNT_DEC(tvc); -#else AFS_RELE(AFSTOV(tvc)); -#endif /* Matches write code setting CCore flag */ crfree(cred); } diff --git a/src/afs/afsincludes.h b/src/afs/afsincludes.h index 98bb633..72c68db 100644 --- a/src/afs/afsincludes.h +++ b/src/afs/afsincludes.h @@ -17,16 +17,9 @@ #include "afs/stds.h" #ifdef AFS_AIX_ENV #include "osi_vfs.h" -#else -#ifdef AFS_DEC_ENV -#include "afs/gfs_vfs.h" -#include "afs/gfs_vnode.h" -#else -#ifdef AFS_HPUX_ENV +#elif defined(AFS_HPUX_ENV) #include "osi_vfs.h" -#endif /* AFS_HPUX_ENV */ -#endif /* AFS_DEC_ENV */ -#endif /* AFS_AIX_ENV */ +#endif #if defined(AFS_SGI_ENV) || defined(AFS_LINUX20_ENV) #include "osi_vfs.h" #endif diff --git a/src/afs/longc_procs.h b/src/afs/longc_procs.h index 6f8d242..58ba37f 100644 --- a/src/afs/longc_procs.h +++ b/src/afs/longc_procs.h @@ -10,7 +10,7 @@ #ifndef _longc_procs_h_ #define _longc_procs_h_ 1 -#if !defined(LONGCALL_DEFS) && defined(KERNEL) && defined(DYNEL) && (defined(AFS_DEC_ENV) || defined(AFS_DECOSF_ENV)) +#if !defined(LONGCALL_DEFS) && defined(KERNEL) && defined(DYNEL) && defined(AFS_DECOSF_ENV) #define LONGCALL_DEFS @@ -67,49 +67,6 @@ struct afs_longcall_procs { #ifdef XDR_CHAR_IN_KERNEL int (*LC_xdr_char) (); #endif -#ifdef AFS_DEC_ENV - - int (*LC_gfs_unlock) (); - int (*LC_gfs_lock) (); - int (*LC_gput) (); - struct inode *(*LC_ufs_galloc) (); - int (*LC_gno_close) (); - int (*LC_km_alloc) (); - int (*LC_km_free) (); - - int (*LC_nuxi_l) (); - int (*LC_nuxi_s) (); - - struct inode *(*LC_gfs_gget) (); - int (*LC_binval) (); - int (*LC_splclock) (); - int (*LC_xumount) (); - int (*LC_bflush) (); - int (*LC_blkclr) (); - int (*LC_vmaccess) (); - struct gnode *(*LC_gfs_namei) (); - int (*LC_getpdev) (); - int (*LC_check_mountp) (); - int (*LC_access) (); - int (*LC_ovbcopy) (); - int (*LC_groupmember) (); - int (*LC_imin) (); - int (*LC_setjmp) (); - - struct gnode *(*LC_gget) (); - void (*LC_grele) (); - void (*LC_gref) (); - int (*LC_xdr_char) (); - int (*LC_smp_lock_once) (); - int (*LC_smp_lock_long) (); - int (*LC_smp_lock_retry) (); - int (*LC_smp_unlock_long) (); - int (*LC_smp_owner) (); - int (*LC_xinval) (); - int (*LC_cacheinvalall) (); - int (*LC_psignal) (); - int (*LC_ufs_rwgp_lock) (); -#else int (*LC_iunlock) (); int (*LC_ilock) (); int (*LC_iput) (); @@ -129,7 +86,6 @@ struct afs_longcall_procs { struct inode *(*LC_iget) (); struct mbuf *(*LC_m_more) (); int (*LC__spl1) (); -#endif int (*LC_rdwri) (); struct file *(*LC_falloc) (); int (*LC_rmfree) (); @@ -238,46 +194,6 @@ extern struct afs_longcall_procs afs_longcall_procs; #define xdr_char (*afs_longcall_procs.LC_xdr_char) #endif -#ifdef AFS_DEC_ENV -#define psignal (*afs_longcall_procs.LC_psignal) -#define ufs_rwgp_lock (*afs_longcall_procs.LC_ufs_rwgp_lock) -#define gput (*afs_longcall_procs.LC_gput) -#define ufs_galloc (*afs_longcall_procs.LC_ufs_galloc) -#define gno_close (*afs_longcall_procs.LC_gno_close) - -#define km_alloc (*afs_longcall_procs.LC_km_alloc) -#define km_free (*afs_longcall_procs.LC_km_free) - -#define nuxi_l (*afs_longcall_procs.LC_nuxi_l) -#define nuxi_s (*afs_longcall_procs.LC_nuxi_s) - -#define gfs_gget (*afs_longcall_procs.LC_gfs_gget) -#define binval (*afs_longcall_procs.LC_binval) -#define splclock (*afs_longcall_procs.LC_splclock) -#define xumount (*afs_longcall_procs.LC_xumount) -#define bflush (*afs_longcall_procs.LC_bflush) -#define blkclr (*afs_longcall_procs.LC_blkclr) -#define vmaccess (*afs_longcall_procs.LC_vmaccess) -#define gfs_namei (*afs_longcall_procs.LC_gfs_namei) -#define getpdev (*afs_longcall_procs.LC_getpdev) -#define check_mountp (*afs_longcall_procs.LC_check_mountp) -#define access (*afs_longcall_procs.LC_access) -#define ovbcopy (*afs_longcall_procs.LC_ovbcopy) -#define groupmember (*afs_longcall_procs.LC_groupmember) -#define imin (*afs_longcall_procs.LC_imin) -#define setjmp (*afs_longcall_procs.LC_setjmp) -#define gget (*afs_longcall_procs.LC_gget) -#define grele (*afs_longcall_procs.LC_grele) -#define gref (*afs_longcall_procs.LC_gref) -#define xdr_char (*afs_longcall_procs.LC_xdr_char) -#define smp_lock_once (*afs_longcall_procs.LC_smp_lock_once) -#define smp_lock_long (*afs_longcall_procs.LC_smp_lock_long) -#define smp_lock_retry (*afs_longcall_procs.LC_smp_lock_retry) -#define smp_unlock_long (*afs_longcall_procs.LC_smp_unlock_long) -#define smp_owner (*afs_longcall_procs.LC_smp_owner) -#define xinval (*afs_longcall_procs.LC_xinval) -#define cacheinvalall (*afs_longcall_procs.LC_cacheinvalall) -#else #define iunlock (*afs_longcall_procs.LC_iunlock) #define ilock (*afs_longcall_procs.LC_ilock) #define iput (*afs_longcall_procs.LC_iput) @@ -300,7 +216,6 @@ extern struct afs_longcall_procs afs_longcall_procs; #define iget (*afs_longcall_procs.LC_iget) #define m_more (*afs_longcall_procs.LC_m_more) #define _spl1 (*afs_longcall_procs.LC__spl1) -#endif #define bcmp (*afs_longcall_procs.LC_bcmp) #if !defined(AFS_DECOSF_ENV) diff --git a/src/afs/sysincludes.h b/src/afs/sysincludes.h index d592679..7274e7c 100644 --- a/src/afs/sysincludes.h +++ b/src/afs/sysincludes.h @@ -204,7 +204,7 @@ typedef unsigned short etap_event_t; #include "h/socketvar.h" #include "h/protosw.h" -#if defined(AFS_SGI_ENV) || defined(AFS_SUN_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" @@ -214,11 +214,6 @@ typedef unsigned short etap_event_t; # include "h/dir.h" #endif /* SGI || SUN || HPUX */ -#ifdef AFS_DEC_ENV -# include "h/smp_lock.h" -#endif /* AFS_DEC_ENV */ - - #if !defined(AFS_SGI64_ENV) && !defined(AFS_FBSD_ENV) #include "h/user.h" #endif /* AFS_SGI64_ENV */ @@ -234,24 +229,6 @@ typedef unsigned short etap_event_t; /* ----- The following mainly deal with vnodes/inodes stuff ------ */ -#ifdef AFS_DEC_ENV -# include "h/mount.h" -# include "machine/psl.h" -# include "afs/gfs_vnode.h" -#endif - -#ifdef AFS_MACH_ENV -# include -# include -# include -# include -# include -# include -# include -# include -#endif /* AFS_MACH_ENV */ - -#ifndef AFS_DEC_ENV # ifdef AFS_SUN5_ENV # include "h/statvfs.h" # endif /* AFS_SUN5_ENV */ @@ -312,7 +289,6 @@ MALLOC_DECLARE(M_AFS); # endif /* !AFS_AIX32_ENV */ # endif /* AFS_SUN5_ENV */ #endif /* AFS_DARWIN_ENV || AFS_FBSD_ENV */ -#endif /* AFS_DEC_ENV */ /* These mainly deal with networking and rpc headers */ #include "netinet/in.h" @@ -348,19 +324,19 @@ MALLOC_DECLARE(M_AFS); #include "h/tty.h" #endif -#if !defined(AFS_SGI_ENV) && !defined(AFS_SUN_ENV) && !defined(AFS_MACH_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 -#if defined(AFS_AIX_ENV) || defined(AFS_DEC_ENV) +#if defined(AFS_AIX_ENV) # include "h/flock.h" /* fcntl.h is a user-level include in aix */ #else # include "h/fcntl.h" -#endif /* AIX || DEC */ +#endif /* AIX */ -#if defined(AFS_SGI_ENV) || defined(AFS_SUN_ENV) || defined(AFS_SUN5_ENV) +#if defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV) # include "h/unistd.h" #endif /* SGI || SUN */ @@ -413,13 +389,13 @@ MALLOC_DECLARE(M_AFS); #include #include -#ifdef AFS_ALPHA_ENV +#ifdef AFS_OSF_ENV #undef kmem_alloc #undef kmem_free #undef mem_alloc #undef mem_free #undef register -#endif /* AFS_ALPHA_ENV */ +#endif /* AFS_OSF_ENV */ #include #include diff --git a/src/afsd/afsd.c b/src/afsd/afsd.c index bfc60b6..44d4f21 100644 --- a/src/afsd/afsd.c +++ b/src/afsd/afsd.c @@ -2034,69 +2034,24 @@ mainproc(as, arock) if (afsd_verbose) printf("%s: Mounting the AFS root on '%s', flags: %d.\n", rn, cacheMountDir, mountFlags); -#ifdef AFS_DEC_ENV - if ((mount("AFS", cacheMountDir, mountFlags, GT_AFS, (caddr_t) 0)) < - 0) { -#else #ifdef AFS_FBSD_ENV if ((mount("AFS", cacheMountDir, mountFlags, (caddr_t) 0)) < 0) { -#else -#ifdef AFS_AUX_ENV - if ((fsmount(MOUNT_AFS, cacheMountDir, mountFlags, (caddr_t) 0)) < 0) { -#else -#ifdef AFS_AIX_ENV +#elif defined(AFS_AIX_ENV) if (aix_vmount()) { -#else -#if defined(AFS_HPUX100_ENV) +#elif defined(AFS_HPUX100_ENV) if ((mount("", cacheMountDir, mountFlags, "afs", NULL, 0)) < 0) { -#else -#ifdef AFS_HPUX_ENV -#if defined(AFS_HPUX90_ENV) - { - char buffer[80]; - int code; - - strcpy(buffer, "afs"); - code = vfsmount(-1, cacheMountDir, mountFlags, (caddr_t) buffer); - sscanf(buffer, "%d", &vfs1_type); - if (code < 0) { - printf - ("Can't find 'afs' type in the registered filesystem table!\n"); - exit(1); - } - sscanf(buffer, "%d", &vfs1_type); - if (afsd_verbose) - printf("AFS vfs slot number is %d\n", vfs1_type); - } - if ((vfsmount(vfs1_type, cacheMountDir, mountFlags, (caddr_t) 0)) < 0) { -#else - if (call_syscall - (AFSOP_AFS_VFSMOUNT, MOUNT_AFS, cacheMountDir, mountFlags, - (caddr_t) NULL) < 0) { -#endif -#else -#ifdef AFS_SUN5_ENV +#elif defined(AFS_SUN5_ENV) if ((mount("AFS", cacheMountDir, mountFlags, "afs", NULL, 0)) < 0) { -#else -#if defined(AFS_SGI_ENV) +#elif defined(AFS_SGI_ENV) mountFlags = MS_FSS; if ((mount(MOUNT_AFS, cacheMountDir, mountFlags, (caddr_t) MOUNT_AFS)) < 0) { -#else -#ifdef AFS_LINUX20_ENV +#elif defined(AFS_LINUX20_ENV) if ((mount("AFS", cacheMountDir, MOUNT_AFS, 0, NULL)) < 0) { #else /* This is the standard mount used by the suns and rts */ if ((mount(MOUNT_AFS, cacheMountDir, mountFlags, (caddr_t) 0)) < 0) { -#endif /* AFS_LINUX20_ENV */ -#endif /* AFS_SGI_ENV */ -#endif /* AFS_SUN5_ENV */ -#endif /* AFS_HPUX100_ENV */ -#endif /* AFS_HPUX_ENV */ -#endif /* AFS_AIX_ENV */ -#endif /* AFS_AUX_ENV */ -#endif /* AFS_FBSD_ENV */ -#endif /* AFS_DEC_ENV */ +#endif printf("%s: Can't mount AFS on %s(%d)\n", rn, cacheMountDir, errno); exit(1); diff --git a/src/afsmonitor/afsmonitor.c b/src/afsmonitor/afsmonitor.c index dc470d2..1a724ad 100644 --- a/src/afsmonitor/afsmonitor.c +++ b/src/afsmonitor/afsmonitor.c @@ -30,17 +30,12 @@ RCSID #undef IN #include #include -#ifndef AFS_DEC_ENV #include #include -#endif #include #include /*Generic window package */ #include /*Object definitions */ -#if 0 -#include /*Text object interface */ -#endif #include /*Light object interface */ #include /*Curses window package */ #include /*Dumb terminal window package */ diff --git a/src/auth/cellconfig.c b/src/auth/cellconfig.c index 0e3a632..b05f6fc 100644 --- a/src/auth/cellconfig.c +++ b/src/auth/cellconfig.c @@ -122,7 +122,7 @@ afsconf_FindService(register const char *aname) struct servent *ts; register struct afsconf_servPair *tsp; -#if defined(AFS_OSF_ENV) || defined(AFS_DEC_ENV) +#if defined(AFS_OSF_ENV) ts = getservbyname(aname, ""); #else ts = getservbyname(aname, NULL); diff --git a/src/bucoord/commands.c b/src/bucoord/commands.c index 49c0877..a78fc2e 100644 --- a/src/bucoord/commands.c +++ b/src/bucoord/commands.c @@ -60,11 +60,7 @@ extern statusP createStatusNode(); char *loadFile; extern afs_int32 lastTaskCode; -#ifdef AFS_DEC_ENV -#define HOSTADDR(sockaddr) (sockaddr)->sin_addr.S_un.S_addr -#else #define HOSTADDR(sockaddr) (sockaddr)->sin_addr.s_addr -#endif int bc_EvalVolumeSet(aconfig, avs, avols, uclient) diff --git a/src/bucoord/dump.c b/src/bucoord/dump.c index 28af8cb..f96384f 100644 --- a/src/bucoord/dump.c +++ b/src/bucoord/dump.c @@ -52,11 +52,7 @@ extern afs_int32 bc_jobNumber(); extern afs_int32 lastTaskCode; -#ifdef AFS_DEC_ENV -#define HOSTADDR(sockaddr) (sockaddr)->sin_addr.S_un.S_addr -#else #define HOSTADDR(sockaddr) (sockaddr)->sin_addr.s_addr -#endif /* bc_Dumper * called (indirectly) to make a dump diff --git a/src/bucoord/restore.c b/src/bucoord/restore.c index 513de7e..8b1fbb7 100644 --- a/src/bucoord/restore.c +++ b/src/bucoord/restore.c @@ -44,11 +44,7 @@ extern char *whoami; #define BC_MAXLEVELS 20 #define MAXTAPESATONCE 10 -#ifdef AFS_DEC_ENV -#define HOSTADDR(sockaddr) (sockaddr)->sin_addr.S_un.S_addr -#else #define HOSTADDR(sockaddr) (sockaddr)->sin_addr.s_addr -#endif /* local structure to keep track of volumes and the dumps from which * they should be restored diff --git a/src/budb/db_text.c b/src/budb/db_text.c index a9cabc8..be3ad81 100644 --- a/src/budb/db_text.c +++ b/src/budb/db_text.c @@ -519,7 +519,7 @@ saveTextToFile(ut, tbPtr) } -#if (defined(AFS_DEC_ENV) || defined(AFS_HPUX_ENV)) || defined(AFS_NT40_ENV) +#if (defined(AFS_HPUX_ENV)) || defined(AFS_NT40_ENV) /* mkstemp * entry: diff --git a/src/butc/dump.c b/src/butc/dump.c index 19363f2..5f5b95f 100644 --- a/src/butc/dump.c +++ b/src/butc/dump.c @@ -827,11 +827,7 @@ xbsaDumpVolume(struct tc_dumpDesc * curDump, struct dumpRock * dparamsPtr) #endif } -#ifdef AFS_DEC_ENV -#define HOSTADDR(sockaddr) (sockaddr)->sin_addr.S_un.S_addr -#else #define HOSTADDR(sockaddr) (sockaddr)->sin_addr.s_addr -#endif /* dumpPass * Go through the list of volumes to dump, dumping each one. The action diff --git a/src/butm/file_tm.c b/src/butm/file_tm.c index 2b3cac7..17f7a0c 100644 --- a/src/butm/file_tm.c +++ b/src/butm/file_tm.c @@ -659,7 +659,7 @@ incPosition(info, fid, dataSize) if (info->posCount >= 2147467264) { /* 2GB - 16K */ info->posCount = 0; -#if (defined(AFS_SUN_ENV) || defined(AFS_DEC_ENV) || defined(AFS_LINUX24_ENV)) +#if (defined(AFS_SUN_ENV) || defined(AFS_LINUX24_ENV)) if (!isafile) { afs_hyper_t off; hset64(off, 0, 0); diff --git a/src/config/param.alpha_dux40.h b/src/config/param.alpha_dux40.h index bfe4ccd..88a4523 100644 --- a/src/config/param.alpha_dux40.h +++ b/src/config/param.alpha_dux40.h @@ -23,6 +23,7 @@ #define AFS_ALPHA_ENV 1 #define AFS_DECOSF_ENV 1 #define AFS_64BIT_ENV 1 +#define AFS_BOZONLOCK_ENV 1 #include diff --git a/src/config/param.alpha_dux50.h b/src/config/param.alpha_dux50.h index c5de508..8ce02fb 100644 --- a/src/config/param.alpha_dux50.h +++ b/src/config/param.alpha_dux50.h @@ -23,6 +23,7 @@ #define __alpha 1 #define AFS_ALPHA_ENV 1 #define AFS_DECOSF_ENV 1 +#define AFS_BOZONLOCK_ENV 1 #define AFS_64BIT_ENV 1 #define AFS_64BIT_CLIENT 1 diff --git a/src/config/param.alpha_dux51.h b/src/config/param.alpha_dux51.h index e042e39..704c873 100644 --- a/src/config/param.alpha_dux51.h +++ b/src/config/param.alpha_dux51.h @@ -24,6 +24,7 @@ #define __alpha 1 #define AFS_ALPHA_ENV 1 #define AFS_DECOSF_ENV 1 +#define AFS_BOZONLOCK_ENV 1 #define AFS_64BIT_ENV 1 #define AFS_64BIT_CLIENT 1 diff --git a/src/config/param.sun4x_510.h b/src/config/param.sun4x_510.h index a321585..f9e5f3e 100644 --- a/src/config/param.sun4x_510.h +++ b/src/config/param.sun4x_510.h @@ -21,6 +21,7 @@ #define AFS_SUN58_ENV 1 #define AFS_SUN59_ENV 1 #define AFS_SUN510_ENV 1 +#define AFS_BOZONLOCK_ENV 1 #define AFS_64BIT_ENV 1 /* Defines afs_int32 as int, not long. */ /* diff --git a/src/config/param.sun4x_55.h b/src/config/param.sun4x_55.h index 40a7916..a0f3020 100644 --- a/src/config/param.sun4x_55.h +++ b/src/config/param.sun4x_55.h @@ -26,6 +26,7 @@ #define AFS_SUN54_ENV 1 #define AFS_SUN55_ENV 1 +#define AFS_BOZONLOCK_ENV 1 #define AFS_HAVE_FLOCK_SYSID 1 #include diff --git a/src/config/param.sun4x_56.h b/src/config/param.sun4x_56.h index 859756c..9785526 100644 --- a/src/config/param.sun4x_56.h +++ b/src/config/param.sun4x_56.h @@ -28,6 +28,7 @@ #define AFS_SUN54_ENV 1 #define AFS_SUN55_ENV 1 #define AFS_SUN56_ENV 1 +#define AFS_BOZONLOCK_ENV 1 #define AFS_GLOBAL_SUNLOCK 1 /* For global locking */ #define RXK_LISTENER_ENV 1 #define AFS_GCPAGS 1 /* if nonzero, garbage collect PAGs */ diff --git a/src/config/param.sun4x_57.h b/src/config/param.sun4x_57.h index b29af99..577fb80 100644 --- a/src/config/param.sun4x_57.h +++ b/src/config/param.sun4x_57.h @@ -27,6 +27,7 @@ #define AFS_SUN55_ENV 1 #define AFS_SUN56_ENV 1 #define AFS_SUN57_ENV 1 +#define AFS_BOZONLOCK_ENV 1 #define AFS_64BIT_ENV 1 /* Defines afs_int32 as int, not long. */ diff --git a/src/config/param.sun4x_58.h b/src/config/param.sun4x_58.h index 6c058ab..abe8d46 100644 --- a/src/config/param.sun4x_58.h +++ b/src/config/param.sun4x_58.h @@ -19,6 +19,7 @@ #define AFS_SUN56_ENV 1 #define AFS_SUN57_ENV 1 #define AFS_SUN58_ENV 1 +#define AFS_BOZONLOCK_ENV 1 #define AFS_64BIT_ENV 1 /* Defines afs_int32 as int, not long. */ /* diff --git a/src/config/param.sun4x_59.h b/src/config/param.sun4x_59.h index d322042..e492a12 100644 --- a/src/config/param.sun4x_59.h +++ b/src/config/param.sun4x_59.h @@ -20,6 +20,7 @@ #define AFS_SUN57_ENV 1 #define AFS_SUN58_ENV 1 #define AFS_SUN59_ENV 1 +#define AFS_BOZONLOCK_ENV 1 #define AFS_64BIT_ENV 1 /* Defines afs_int32 as int, not long. */ /* diff --git a/src/config/param.sunx86_510.h b/src/config/param.sunx86_510.h index 629fd32..d45a789 100644 --- a/src/config/param.sunx86_510.h +++ b/src/config/param.sunx86_510.h @@ -30,6 +30,7 @@ #define AFS_SUN58_ENV 1 #define AFS_SUN59_ENV 1 #define AFS_SUN510_ENV 1 +#define AFS_BOZONLOCK_ENV 1 #define AFS_X86_ENV 1 #define AFS_64BIT_ENV 1 /* Defines afs_int32 as int, not long. */ diff --git a/src/config/param.sunx86_57.h b/src/config/param.sunx86_57.h index ece6261..0814f10 100644 --- a/src/config/param.sunx86_57.h +++ b/src/config/param.sunx86_57.h @@ -27,6 +27,8 @@ #define AFS_SUN55_ENV 1 #define AFS_SUN56_ENV 1 #define AFS_SUN57_ENV 1 +#define AFS_BOZONLOCK_ENV 1 + #define AFS_X86_ENV 1 #define AFS_64BIT_ENV 1 /* Defines afs_int32 as int, not long. */ diff --git a/src/config/param.sunx86_58.h b/src/config/param.sunx86_58.h index 5e6a9f9..18c08e0 100644 --- a/src/config/param.sunx86_58.h +++ b/src/config/param.sunx86_58.h @@ -28,6 +28,8 @@ #define AFS_SUN56_ENV 1 #define AFS_SUN57_ENV 1 #define AFS_SUN58_ENV 1 +#define AFS_BOZONLOCK_ENV 1 + #define AFS_X86_ENV 1 #define AFS_64BIT_ENV 1 /* Defines afs_int32 as int, not long. */ diff --git a/src/config/param.sunx86_59.h b/src/config/param.sunx86_59.h index d051d78..457ce5a 100644 --- a/src/config/param.sunx86_59.h +++ b/src/config/param.sunx86_59.h @@ -29,6 +29,8 @@ #define AFS_SUN57_ENV 1 #define AFS_SUN58_ENV 1 #define AFS_SUN59_ENV 1 +#define AFS_BOZONLOCK_ENV 1 + #define AFS_X86_ENV 1 #define AFS_64BIT_ENV 1 /* Defines afs_int32 as int, not long. */ diff --git a/src/dir/dir.c b/src/dir/dir.c index 4a48dd8..22bd3f3 100644 --- a/src/dir/dir.c +++ b/src/dir/dir.c @@ -47,33 +47,10 @@ RCSID #include "h/user.h" #endif /* AFS_SGI64_ENV */ #include "h/uio.h" -#ifdef AFS_DEC_ENV -#include "afs/gfs_vfs.h" -#include "afs/gfs_vnode.h" -#else -#ifdef AFS_MACH_ENV -#ifdef NeXT -#include -#include -#include -#else -#include -#include -#include -#endif /* NeXT */ -#else /* AFS_MACH_ENV */ #ifdef AFS_OSF_ENV #include #include #include -#else /* AFS_OSF_ENV */ -#ifdef AFS_SUN5_ENV -#else -#if !defined(AFS_SGI_ENV) -#endif -#endif /* AFS_OSF_ENV */ -#endif /* AFS_MACH_ENV */ -#endif #endif #if !defined(AFS_SUN5_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_HPUX110_ENV) #include "h/mbuf.h" diff --git a/src/fsint/afsaux.c b/src/fsint/afsaux.c index ecde217..cc919e5 100644 --- a/src/fsint/afsaux.c +++ b/src/fsint/afsaux.c @@ -23,7 +23,7 @@ RCSID #include "afsincludes.h" #include "rx/xdr.h" #else /* defined(UKERNEL) */ -#if defined(AFS_ALPHA_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) +#if defined(AFS_OSF_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) #include "afs/sysincludes.h" #include "afsincludes.h" #else @@ -63,7 +63,7 @@ static afs_int32 bslosers = 0; #ifdef AFS_AIXNFS11 #define AUTH_DES 1 #endif -#if (defined(AFS_AIX_ENV) && !defined(AUTH_DES)) || (!defined(AFS_SUN_ENV)) && !defined(AFS_SGI_ENV) && !defined(AFS_ALPHA_ENV) && !defined(AFS_SUN5_ENV) +#if (defined(AFS_AIX_ENV) && !defined(AUTH_DES)) || (!defined(AFS_SUN_ENV)) && !defined(AFS_SGI_ENV) && !defined(AFS_OSF_ENV) && !defined(AFS_SUN5_ENV) #ifndef AFS_AIX32_ENV #if !defined(AFS_HPUX110_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_XBSD_ENV) /* diff --git a/src/rx/rx.c b/src/rx/rx.c index 19b14fb..173cbc5 100644 --- a/src/rx/rx.c +++ b/src/rx/rx.c @@ -48,13 +48,13 @@ RCSID #include "sys/debug.h" #endif #include "afsint.h" -#ifdef AFS_ALPHA_ENV +#ifdef AFS_OSF_ENV #undef kmem_alloc #undef kmem_free #undef mem_alloc #undef mem_free #undef register -#endif /* AFS_ALPHA_ENV */ +#endif /* AFS_OSF_ENV */ #else /* !UKERNEL */ #include "afs/sysincludes.h" #include "afsincludes.h" diff --git a/src/rx/rx_clock.c b/src/rx/rx_clock.c index 06d6a59..a455419 100644 --- a/src/rx/rx_clock.c +++ b/src/rx/rx_clock.c @@ -49,11 +49,7 @@ RCSID #ifndef KERNEL -#if defined(AFS_GFS_ENV) -#define STARTVALUE 8000000 /* Ultrix bounds smaller, too small for general use */ -#else #define STARTVALUE 100000000 /* Max number of seconds setitimer allows, for some reason */ -#endif static int startvalue = STARTVALUE; struct clock clock_now; /* The last elapsed time ready by clock_GetTimer */ diff --git a/src/rx/rx_rdwr.c b/src/rx/rx_rdwr.c index 449289f..c4a835f 100644 --- a/src/rx/rx_rdwr.c +++ b/src/rx/rx_rdwr.c @@ -59,13 +59,13 @@ RCSID #include "rx/rx_globals.h" #include "afs/lock.h" #include "afsint.h" -#ifdef AFS_ALPHA_ENV +#ifdef AFS_OSF_ENV #undef kmem_alloc #undef kmem_free #undef mem_alloc #undef mem_free #undef register -#endif /* AFS_ALPHA_ENV */ +#endif /* AFS_OSF_ENV */ #else /* KERNEL */ # include #ifndef AFS_NT40_ENV diff --git a/src/rx/xdr_afsuuid.c b/src/rx/xdr_afsuuid.c index fac8d69..a149cfa 100644 --- a/src/rx/xdr_afsuuid.c +++ b/src/rx/xdr_afsuuid.c @@ -31,11 +31,6 @@ RCSID #include #endif #include "xdr.h" -#if defined(KERNEL) && !defined(UKERNEL) -#ifdef AFS_DEC_ENV -#include -#endif -#endif int xdr_afsUUID(XDR * xdrs, afsUUID * objp) diff --git a/src/rx/xdr_arrayn.c b/src/rx/xdr_arrayn.c index cf4f7ca..1b9e06e 100644 --- a/src/rx/xdr_arrayn.c +++ b/src/rx/xdr_arrayn.c @@ -57,11 +57,6 @@ RCSID #include #endif #include "xdr.h" -#if defined(KERNEL) && !defined(UKERNEL) -#ifdef AFS_DEC_ENV -#include -#endif -#endif #define LASTUNSIGNED ((u_int)0-1) diff --git a/src/rx/xdr_int64.c b/src/rx/xdr_int64.c index c7afdf0..460cf39 100644 --- a/src/rx/xdr_int64.c +++ b/src/rx/xdr_int64.c @@ -20,11 +20,6 @@ RCSID #include #endif #include "xdr.h" -#if defined(KERNEL) && !defined(UKERNEL) -#ifdef AFS_DEC_ENV -#include -#endif -#endif #ifdef AFS_64BIT_ENV /* diff --git a/src/rx/xdr_rx.c b/src/rx/xdr_rx.c index 514c3ed..a970b4e 100644 --- a/src/rx/xdr_rx.c +++ b/src/rx/xdr_rx.c @@ -33,13 +33,13 @@ RCSID #else #include "rpc/types.h" #endif -#ifdef AFS_ALPHA_ENV +#ifdef AFS_OSF_ENV #undef kmem_alloc #undef kmem_free #undef mem_alloc #undef mem_free #undef register -#endif /* AFS_ALPHA_ENV */ +#endif /* AFS_OSF_ENV */ #ifdef AFS_LINUX22_ENV #ifndef quad_t #define quad_t __quad_t diff --git a/src/rxgen/rpc_main.c b/src/rxgen/rpc_main.c index ae98591..d7bbcc0 100644 --- a/src/rxgen/rpc_main.c +++ b/src/rxgen/rpc_main.c @@ -476,9 +476,6 @@ h_output(char *infile, char *define, int extend, char *outfile, int append) f_print(fout, "#include \"h/socket.h\"\n"); f_print(fout, "#endif\n"); f_print(fout, "#ifndef DTYPE_SOCKET /* XXXXX */\n"); - f_print(fout, "#ifdef AFS_DEC_ENV\n"); - f_print(fout, "#include \"h/smp_lock.h\"\n"); - f_print(fout, "#endif\n"); f_print(fout, "#ifndef AFS_LINUX22_ENV\n"); f_print(fout, "#include \"h/file.h\"\n"); f_print(fout, "#endif\n"); diff --git a/src/venus/fstrace.c b/src/venus/fstrace.c index ec89d4d..8d0b584 100644 --- a/src/venus/fstrace.c +++ b/src/venus/fstrace.c @@ -41,7 +41,7 @@ RCSID #include #include -#if defined(AFS_ALPHA_ENV) || defined(AFS_SGI61_ENV) || (defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL)) +#if defined(AFS_OSF_ENV) || defined(AFS_SGI61_ENV) || (defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL)) /* For SGI 6.2, this is changed to 1 if it's a 32 bit kernel. */ int afs_icl_sizeofLong = 2; #else @@ -312,14 +312,12 @@ DisplayRecord(outFilep, alp, rsize) printfParms[pfpix] <<= 32; printfParms[pfpix] |= alp[pix + 1]; } -#else /* AFS_SGI61_ENV */ -#ifdef AFS_ALPHA_ENV +#elif defined(AFS_OSF_ENV) printfParms[pfpix] = alp[pix + 1]; printfParms[pfpix] |= (alp[pix] <<= 32); -#else /* AFS_ALPHA_ENV */ +#else /* !AFS_OSF_ENV && !AFS_SGI61_ENV */ printfParms[pfpix] = alp[pix]; -#endif /* AFS_ALPHA_ENV */ -#endif /* AFS_SGI61_ENV */ +#endif pfpix++; break; case ICL_TYPE_INT32: diff --git a/src/venus/kdump.c b/src/venus/kdump.c index 5b8d5e2..c44ad92 100644 --- a/src/venus/kdump.c +++ b/src/venus/kdump.c @@ -230,11 +230,6 @@ typedef struct adaptive_mutex2 adaptive_mutex2_t; #include #endif /* AFS_SGI_ENV */ #else -#ifdef AFS_MACH_ENV -#include -#include -#include -#else /* AFS_MACH_ENV */ #if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) #include #include @@ -352,7 +347,6 @@ typedef enum _spustate { /* FROM /etc/conf/h/_types.h */ #endif #endif #endif -#endif /* AFS_MACH_ENV */ #include #endif diff --git a/src/vfsck/fsck.h b/src/vfsck/fsck.h index 52479c2..ffac32e 100644 --- a/src/vfsck/fsck.h +++ b/src/vfsck/fsck.h @@ -194,9 +194,6 @@ int qflag; /* less verbose flag */ int debug; /* output debugging info */ int cvtflag; /* convert to old file system format */ char preen; /* just fix normal inconsistencies */ -#if defined(AFS_DEC_ENV) -char only_when_needed; /* check filesystems only when needed */ -#endif char hotroot; /* checking root device */ char havesb; /* superblock has been read */ @@ -236,7 +233,7 @@ int isconvert; /* converting */ #ifdef VICE int nViceFiles; /* number of vice files seen */ -#if defined(AFS_SUN_ENV) || defined(AFS_DEC_ENV) +#if defined(AFS_SUN_ENV) int iscorrupt; /* known to be corrupt/inconsistent */ #endif #ifdef AFS_SUN_ENV diff --git a/src/vfsck/main.c b/src/vfsck/main.c index 6ac601c..5ce904e 100644 --- a/src/vfsck/main.c +++ b/src/vfsck/main.c @@ -80,10 +80,6 @@ RCSID #endif /* AFS_VFSINCL_ENV */ #endif /* AFS_OSF_ENV */ -#ifdef AFS_DEC_ENV -#include -#endif - #include #include #ifdef AFS_SUN5_ENV @@ -215,20 +211,7 @@ main(argc, argv) preen++; break; #endif -#if defined(AFS_DEC_ENV) - /* On the late versions of Ultrix they changed the defn of '-p' a bit. Particularly, - * -p is used to check a file system that was not unmounted cleanly, and they added, - * -P to check a file system regardless of how it was unmounted; this, unfortunately, - * is identical to '-p' on the rest of the systems but we have to maintain vendor's - * semantics so we leave it the way Dec likes it. - */ - case 'p': - only_when_needed++; - /* P is for Ultrix compatibility */ - case 'P': -#else case 'p': -#endif preen++; break; #if defined(AFS_HPUX100_ENV) @@ -453,11 +436,6 @@ main(argc, argv) && strcmp(fsp->fs_type, FSTAB_RO) && strcmp(fsp->fs_type, FSTAB_RQ)) continue; -#ifdef AFS_DEC_ENV - /* Only check local (i.e. ufs) file systems */ - if (strcmp(fsp->fs_name, "4.2") && strcmp(fsp->fs_name, "ufs")) - continue; -#endif #ifdef AFS_OSF_ENV if (strcmp(fsp->fs_vfstype, "ufs") || fsp->fs_passno == 0) { continue; @@ -644,11 +622,6 @@ checkfilesys(filesys, parname) struct zlncnt *zlnp; char devbuffer[128]; int ret_val; -#ifdef AFS_DEC_ENV - int retries = 3; /* # of retries fora clean fsck pass */ - int fsdirty = 0; /* file system was or is dirty */ - int rootdirty = 0; /* Root was or is dirty */ -#endif #ifdef AFS_OSF_ENV int temp; @@ -672,9 +645,6 @@ checkfilesys(filesys, parname) EnsureDevice(devname); /* canonicalize name */ if (debug && preen) pinfo("starting\n"); -#ifdef AFS_DEC_ENV - for (; retries > 0; retries--) { /* 003 - Loop for NUMRETRIES or until clean */ -#endif ret_val = setup(devname); @@ -695,7 +665,7 @@ checkfilesys(filesys, parname) } else if (ret_val == -1) { /* pclean && FS_CLEAN */ return (1); #endif -#if defined(AFS_DEC_ENV) || defined(AFS_OSF_ENV) +#if defined(AFS_OSF_ENV) } else if (ret_val == FS_CLEAN) { /* pclean && FS_CLEAN */ return (1); #endif @@ -774,108 +744,7 @@ checkfilesys(filesys, parname) msgprintf("** Phase 5 - Check Cyl groups\n"); pass5(); -#ifdef AFS_DEC_ENV - if (fsmodified || (sblk.b_dirty) || (cgblk.b_dirty)) { - fsdirty = 1; - if (hotroot) - rootdirty = 1; - if (retries <= 1) { - /* - * 003 - Number of retry attempts have been - * exhausted. Mark super block as dirty. - */ - (void)time(&sblock.fs_time); - sbdirty(); - } - } else { - /* - * 003 - If checking root file system, and it was - * modified during any pass, don't assume it is ok. Must reboot. - */ - if (rootdirty) { - sbdirty(); - retries = 0; - } else { - if ((!hotroot) && (!bflag) && (!nflag) && (!iscorrupt)) { - sblock.fs_fmod = 0; - sblock.fs_clean = FS_CLEAN; - (void)time(&sblock.fs_time); - (void)time(&sblock.fs_lastfsck); - if ((sblock.fs_deftimer) && (sblock.fs_deftimer > 0) - && (sblock.fs_deftimer < 255)) - sblock.fs_cleantimer = sblock.fs_deftimer; - else - sblock.fs_cleantimer = sblock.fs_deftimer = - FSCLEAN_TIMEOUTFACTOR; - sbdirty(); - } - /* - * 006 - If an alternate super block was used, - * we want to re fsck the partition after - * updating the primary super block. - */ - if (!bflag) - retries = 0; - } - } - /* Unless no updates are to be done, write out maps. */ - if (nflag) - retries = 0; - else - ckfini(); - if (debug) { - daddr_t nn_files = n_files; - daddr_t nn_blks = n_blks; - - n_ffree = sblock.fs_cstotal.cs_nffree; - n_bfree = sblock.fs_cstotal.cs_nbfree; - if (nn_files -= maxino - ROOTINO - sblock.fs_cstotal.cs_nifree) - printf("%d files missing\n", nn_files); - nn_blks += - sblock.fs_ncg * (cgdmin(&sblock, 0) - cgsblock(&sblock, 0)); - nn_blks += cgsblock(&sblock, 0) - cgbase(&sblock, 0); - nn_blks += howmany(sblock.fs_cssize, sblock.fs_fsize); - if (nn_blks -= maxfsblock - (n_ffree + sblock.fs_frag * n_bfree)) - printf("%d blocks missing\n", nn_blks); - } - if (duplist != NULL) { - if (debug) - printf("The following duplicate blocks remain:"); - for (dp = duplist; dp; dp = dp->next) { - if (debug) - printf(" %d,", dp->dup); - free(dp); - } - if (debug) - printf("\n"); - } - if (zlnhead != NULL) { - if (debug) - printf("The following zero link count inodes remain:"); - for (zlnp = zlnhead; zlnp; zlnp = zlnp->next) { - if (debug) - printf(" %d,", zlnp->zlncnt); - free(zlnp); - } - if (debug) - printf("\n"); - } - zlnhead = NULL; - duplist = NULL; - - free(blockmap); - free(statemap); - free((char *)lncntp); - /* Print out retry message, and fsck file system again. */ - if (retries > 1) - if (preen) - printf("%s: FILE SYSTEM MODIFIED, VERIFYING\n", filesys); - else - printf("**** FILE SYSTEM MODIFIED, VERIFYING\n"); - } /* for retries */ -#endif - -#if defined(AFS_SUN_ENV) && !defined(AFS_SUN3_ENV) +#if defined(AFS_SUN_ENV) updateclean(); if (debug) printclean(); @@ -908,19 +777,6 @@ checkfilesys(filesys, parname) n printf("(%d frags, %d blocks, %.1f%% fragmentation)\n", n_ffree, n_bfree, (float)(n_ffree * 100) / sblock.fs_dsize); #endif /* VICE */ -#ifdef AFS_DEC_ENV - if ((!fsdirty) && (!rootdirty)) - return; - if (!preen) { - printf("\n***** FILE SYSTEM WAS MODIFIED *****\n"); - if (hotroot) - printf("\n***** HALT PROCESSOR WITHOUT SYNCING DISK *****\n"); - } - if (hotroot) { - sync(); - exit(4); - } -#else if (debug && (n_files -= maxino - ROOTINO - sblock.fs_cstotal.cs_nifree)) msgprintf("%d files missing\n", n_files); if (debug) { @@ -942,7 +798,6 @@ checkfilesys(filesys, parname) msgprintf("\n"); } } -#endif #ifdef AFS_HPUX_ENV /* if user's specification denotes that the file system block * is going to be modified (nflag == 0) then fsck store the @@ -1040,7 +895,6 @@ checkfilesys(filesys, parname) } #endif #endif -#ifndef AFS_DEC_ENV ckfini(); free(blockmap); free(statemap); @@ -1077,16 +931,13 @@ checkfilesys(filesys, parname) exit(4); #endif } -#endif #ifdef VICE (void)close(fsreadfd); (void)close(fswritefd); if (nViceFiles || tryForce) { /* Modified file system with vice files: force full salvage */ /* Salvager recognizes the file FORCESALVAGE in the root of each partition */ -#if !defined(AFS_DEC_ENV) struct ufs_args ufsargs; -#endif char pname[100], fname[100], *special; int fd, code, failed = 0; @@ -1135,30 +986,22 @@ checkfilesys(filesys, parname) if (failed && parname) { strcpy(pname, parname); } -#if !defined(AFS_DEC_ENV) && !defined(AFS_HPUX_ENV) +#if !defined(AFS_HPUX_ENV) #ifdef AFS_SUN5_ENV ufsargs.flags = UFSMNT_NOINTR; #else ufsargs.fspec = devname; #endif -#ifdef AFS_SUN_ENV #ifdef AFS_SUN5_ENV if (mount (devname, pname, MS_DATA, "ufs", (char *)&ufsargs, sizeof(ufsargs)) < 0) { #else - if (mount("4.2", pname, M_NEWTYPE, &ufsargs) < 0) { -#endif -#else if (mount(MOUNT_UFS, pname, 0, &ufsargs) < 0) { #endif #else -#ifdef AFS_DEC_ENV - if (mount(devname, pname, 0, GT_ULTRIX, NULL)) { -#else if (mount(devname, pname, 0) < 0) { #endif -#endif printf ("Couldn't mount %s on %s to force FULL SALVAGE; continuing anyway (%d)!\n", devname, pname, errno); @@ -1168,26 +1011,19 @@ checkfilesys(filesys, parname) fd = open(fname, O_CREAT, 0); if (fd == -1) { errexit("Couldn't create %s to force full salvage!\n", fname); -#if defined(AFS_DEC_ENV) - stat(".", &tstat); -#endif } else { fstat(fd, &tstat); close(fd); } -#if /*defined(AFS_VFS_ENV) &&*/ !defined(AFS_DEC_ENV) && !defined(AFS_HPUX_ENV) && !defined(AFS_SUN5_ENV) && !defined(AFS_OSF_ENV) +#if !defined(AFS_HPUX_ENV) && !defined(AFS_SUN5_ENV) && !defined(AFS_OSF_ENV) unmount(pname); #else -#if defined(AFS_DEC_ENV) - umount(tstat.st_dev); -#else #if defined(AFS_OSF_ENV) umount(pname, MNT_NOFORCE); #else /* AFS_OSF_ENV */ umount(devname); #endif #endif -#endif } rmdir(pname); } diff --git a/src/vfsck/pass2.c b/src/vfsck/pass2.c index db11c9b..d35c5f6 100644 --- a/src/vfsck/pass2.c +++ b/src/vfsck/pass2.c @@ -198,12 +198,12 @@ pass2check(idesc) if (dirp->d_ino != 0 && strcmp(dirp->d_name, "..") != 0) { pfatal("CANNOT FIX, FIRST ENTRY IN DIRECTORY CONTAINS %s\n", dirp->d_name); -#if defined(AFS_SUN_ENV) || defined(AFS_DEC_ENV) +#if defined(AFS_SUN_ENV) iscorrupt = 1; #endif } else if (dirp->d_reclen < entrysize) { pfatal("CANNOT FIX, INSUFFICIENT SPACE TO ADD '.'\n"); -#if defined(AFS_SUN_ENV) || defined(AFS_DEC_ENV) +#if defined(AFS_SUN_ENV) iscorrupt = 1; #endif } else if (dirp->d_reclen < 2 * entrysize) { @@ -255,12 +255,12 @@ pass2check(idesc) if (dirp->d_ino != 0 && strcmp(dirp->d_name, ".") != 0) { pfatal("CANNOT FIX, SECOND ENTRY IN DIRECTORY CONTAINS %s\n", dirp->d_name); -#if defined(AFS_SUN_ENV) || defined(AFS_DEC_ENV) +#if defined(AFS_SUN_ENV) iscorrupt = 1; #endif } else if (dirp->d_reclen < entrysize) { pfatal("CANNOT FIX, INSUFFICIENT SPACE TO ADD '..'\n"); -#if defined(AFS_SUN_ENV) || defined(AFS_DEC_ENV) +#if defined(AFS_SUN_ENV) iscorrupt = 1; #endif } else { diff --git a/src/vfsck/pass5.c b/src/vfsck/pass5.c index 9fca98f..ab78313 100644 --- a/src/vfsck/pass5.c +++ b/src/vfsck/pass5.c @@ -372,18 +372,6 @@ pass5() sbfine(fs); sbdirty(); } -#if defined(AFS_DEC_ENV) - if (sbfine(fs)) { - int oldmod; - /* don't change fsmodified here, or fsck will think that modified - * mounted file system requires reboot, when it is really fine - * (since it is mounted, and thus clean flag doesn't matter) */ - oldmod = fsmodified; - sbdirty(); - flush(fswritefd, &sblk); - fsmodified = oldmod; - } -#endif } /* returns true if sbdirty should be called */ @@ -392,24 +380,9 @@ sbfine(fs) { int rcode; rcode = 0; -#if defined(AFS_DEC_ENV) - if (fs->fs_fmod != 0 || fs->fs_clean != FS_CLEAN) { - fs->fs_fmod = 0; - fs->fs_clean = FS_CLEAN; - rcode = 1; - } - if (fs->fs_deftimer) { - fs->fs_cleantimer = fs->fs_deftimer = (fs->fs_deftimer > 0 - && fs->fs_deftimer < - 255) ? fs-> - fs_deftimer : FSCLEAN_TIMEOUTFACTOR; - rcode = 1; - } -#else if (fs->fs_fmod != 0) { fs->fs_fmod = 0; rcode = 1; } -#endif /* AFS_DEC_ENV */ return rcode; } diff --git a/src/vfsck/setup.c b/src/vfsck/setup.c index 70881c1..19d7dce 100644 --- a/src/vfsck/setup.c +++ b/src/vfsck/setup.c @@ -129,9 +129,6 @@ setup(dev) mlk_pbp = 0; pbp = 0; mlk_startinum = 0; -#ifdef AFS_DEC_ENV - iscorrupt = 0; -#endif #if defined(ACLS) && defined(AFS_HPUX_ENV) n_cont = 0; #endif @@ -359,17 +356,6 @@ setup(dev) sbdirty(); } } -#ifdef AFS_DEC_ENV - /* - * If '-p' is used and the partition was cleanly unmounted last time then skip the - * fscking process - */ - if (only_when_needed && (sblock.fs_clean == FS_CLEAN) - && clean_byte_valid(sblock.fs_lastfsck)) { - msgprintf("%s: umounted cleanly\n", dev); - return (FS_CLEAN); - } -#endif #ifdef AFS_HPUX_ENV /* * Do we need to continue ? @@ -731,13 +717,6 @@ readsb(listerr) memcpy((char *)altsblock.fs_sparecon, (char *)sblock.fs_sparecon, sizeof sblock.fs_sparecon); #endif -#if defined(AFS_DEC_ENV) - memcpy((char *)altsblock.fs_extra, (char *)sblock.fs_extra, - sizeof sblock.fs_extra); - altsblock.fs_deftimer = sblock.fs_deftimer; - altsblock.fs_lastfsck = sblock.fs_lastfsck; - altsblock.fs_gennum = sblock.fs_gennum; -#endif /* * The following should not have to be copied. */ @@ -801,27 +780,6 @@ calcsb(dev, devfd, fs) return 0; } -#ifdef AFS_DEC_ENV -clean_byte_valid(lastfsck) - time_t lastfsck; -{ - time_t now; - int delta; - - time(&now); - if ((!sblock.fs_deftimer) || (!sblock.fs_lastfsck) || (lastfsck > now)) { - sblock.fs_deftimer = 0; - return (0); - } - if (!sblock.fs_cleantimer) - return (0); - delta = (now - lastfsck) / 86400; - if (delta > 60) - return (0); - return (1); -} -#endif - #include #ifdef AFS_HPUX_ENV #include diff --git a/src/vfsck/utilities.c b/src/vfsck/utilities.c index b247f2e..c9be6e0 100644 --- a/src/vfsck/utilities.c +++ b/src/vfsck/utilities.c @@ -89,7 +89,7 @@ long diskreads, totalreads; /* Disk cache statistics */ long lseek(); #endif char *malloc(); -#if defined(AFS_SUN_ENV) || defined(AFS_DEC_ENV) +#if defined(AFS_SUN_ENV) extern int iscorrupt; #endif #ifdef AFS_SUN_ENV @@ -149,7 +149,7 @@ reply(question) printf("\n"); if (!persevere && (nflag || fswritefd < 0)) { printf("%s? no\n\n", question); -#if defined(AFS_SUN_ENV) || defined(AFS_DEC_ENV) +#if defined(AFS_SUN_ENV) iscorrupt = 1; /* known to be corrupt */ #endif return (0); @@ -172,7 +172,7 @@ reply(question) #ifdef AFS_HPUX_ENV fixed = 0; #endif -#if defined(AFS_SUN_ENV) || defined(AFS_DEC_ENV) +#if defined(AFS_SUN_ENV) iscorrupt = 1; /* known to be corrupt */ #endif return (0); @@ -282,9 +282,6 @@ flush(fd, bp) pfatal("WRITING %sZERO'ED BLOCK %d TO DISK\n", (bp->b_errs == bp->b_size / dev_bsize) ? "" : "PARTIALLY ", bp->b_bno); -#ifdef AFS_DEC_ENV - iscorrupt = 1; -#endif } bp->b_dirty = 0; bp->b_errs = 0; diff --git a/src/viced/afsfileprocs.c b/src/viced/afsfileprocs.c index fce5f67..e869dcb 100644 --- a/src/viced/afsfileprocs.c +++ b/src/viced/afsfileprocs.c @@ -1255,11 +1255,7 @@ DeleteTarget(Vnode * parentptr, Volume * volptr, Vnode ** targetptr, ("DT: inode=%s, name=%s, errno=%d\n", PrintInode(NULL, VN_GET_INO(*targetptr)), Name, errno)); -#ifdef AFS_DEC_ENV - if ((errno != ENOENT) && (errno != EIO) && (errno != ENXIO)) -#else if (errno != ENOENT) -#endif { ViceLog(0, ("Volume %u now offline, must be salvaged.\n", diff --git a/src/vol/listinodes.c b/src/vol/listinodes.c index 992e441..c973ab7 100644 --- a/src/vol/listinodes.c +++ b/src/vol/listinodes.c @@ -80,9 +80,6 @@ ListViceInodes(char *devname, char *mountedOn, char *resultFile, #endif #endif #else /* AFS_VFSINCL_ENV */ -#ifdef AFS_DEC_ENV -#include -#endif /* AFS_DEC_ENV */ #ifdef AFS_OSF_ENV #include #else /* AFS_OSF_ENV */ -- 1.9.4