From d29643b0553011cbe60dd127fd31c1847fe02ddb Mon Sep 17 00:00:00 2001 From: Derrick Brashear Date: Tue, 13 Jul 2010 13:06:02 -0400 Subject: [PATCH] unix disconnected mode always per 1.6 release plan, enable disconnected always. eject ifdefs (and a stray printf that was hidden in one) Change-Id: I6a68cb8506878c28502e1742a48858f2e84958f5 Reviewed-on: http://gerrit.openafs.org/2397 Tested-by: Jason Edgecombe Tested-by: Derrick Brashear Reviewed-by: Derrick Brashear --- acinclude.m4 | 9 --------- src/afs/FBSD/osi_vnodeops.c | 4 ---- src/afs/NBSD/osi_vfsops.c | 6 ------ src/afs/NBSD/osi_vnodeops.c | 6 ------ src/afs/OBSD/osi_vfsops.c | 6 +----- src/afs/OBSD/osi_vnodeops.c | 6 ------ src/afs/VNOPS/afs_vnop_attrs.c | 4 ---- src/afs/VNOPS/afs_vnop_create.c | 4 ---- src/afs/VNOPS/afs_vnop_dirops.c | 10 ---------- src/afs/VNOPS/afs_vnop_open.c | 2 -- src/afs/VNOPS/afs_vnop_read.c | 5 ----- src/afs/VNOPS/afs_vnop_remove.c | 4 ---- src/afs/VNOPS/afs_vnop_rename.c | 4 ---- src/afs/VNOPS/afs_vnop_symlink.c | 6 ------ src/afs/VNOPS/afs_vnop_write.c | 21 ++++++--------------- src/afs/afs.h | 7 ------- src/afs/afs_callback.c | 2 -- src/afs/afs_daemons.c | 2 -- src/afs/afs_dcache.c | 4 ---- src/afs/afs_disconnected.c | 3 --- src/afs/afs_init.c | 4 ---- src/afs/afs_pioctl.c | 6 ------ src/afs/afs_vcache.c | 13 ------------- src/afs/discon.h | 12 ------------ 24 files changed, 7 insertions(+), 143 deletions(-) diff --git a/acinclude.m4 b/acinclude.m4 index 2b818eb33..dff2bb85c 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -102,11 +102,6 @@ AC_ARG_ENABLE([demand-attach-fs], [enable Demand Attach Fileserver (please see documentation)])], , [enable_demand_attach_fs="no"]) -AC_ARG_ENABLE([disconnected], - [AS_HELP_STRING([--enable-disconnected], - [enable disconnected support in cache manager (experimental)])], - , - [enable_disconnected="no"]) AC_ARG_ENABLE([unix-sockets], [AS_HELP_STRING([--disable-unix-sockets], [disable use of unix domain sockets for fssync (defaults to enabled)])], @@ -1130,10 +1125,6 @@ else fi AC_SUBST(DEMAND_ATTACH) -if test "$enable_disconnected" = "yes"; then - AC_DEFINE(AFS_DISCON_ENV, 1, [define if you want support for disconnected operation]) -fi - if test "$enable_unix_sockets" = "yes"; then AC_DEFINE(USE_UNIX_SOCKETS, 1, [define if you want to use UNIX sockets for fssync.]) USE_UNIX_SOCKETS="yes" diff --git a/src/afs/FBSD/osi_vnodeops.c b/src/afs/FBSD/osi_vnodeops.c index 2a2bf29cd..0e7a6d1c7 100644 --- a/src/afs/FBSD/osi_vnodeops.c +++ b/src/afs/FBSD/osi_vnodeops.c @@ -1466,12 +1466,8 @@ afs_vop_reclaim(struct vop_reclaim_args *ap) AFS_GLOCK(); if (!haveVlock) ObtainWriteLock(&afs_xvcache, 901); -#ifndef AFS_DISCON_ENV - code = afs_FlushVCache(avc, &slept); /* tosses our stuff from vnode */ -#else /* reclaim the vnode and the in-memory vcache, but keep the on-disk vcache */ code = afs_FlushVS(avc); -#endif if (!haveVlock) ReleaseWriteLock(&afs_xvcache); if (!haveGlock) diff --git a/src/afs/NBSD/osi_vfsops.c b/src/afs/NBSD/osi_vfsops.c index 456d38f77..922b1d591 100644 --- a/src/afs/NBSD/osi_vfsops.c +++ b/src/afs/NBSD/osi_vfsops.c @@ -249,12 +249,10 @@ afs_mount(struct mount *mp, const char *path, void *data, } AFS_GLOCK(); -#ifdef AFS_DISCON_ENV /* initialize the vcache entries before we start using them */ /* XXX find a better place for this if possible */ init_vcache_entries(); -#endif afs_globalVFS = mp; mp->mnt_stat.f_bsize = 8192; mp->mnt_stat.f_frsize = 8192; @@ -287,9 +285,7 @@ afs_unmount(struct mount *mp, int mntflags, struct lwp *l) extern int sys_ioctl(), sys_setgroups(); AFS_STATCNT(afs_unmount); -#ifdef AFS_DISCON_ENV give_up_cbs(); -#endif if (afs_globalVFS == NULL) { printf("afs already unmounted\n"); return 0; @@ -405,10 +401,8 @@ int afs_sync(struct mount *mp, int waitfor, kauth_cred_t cred, struct lwp *l) { AFS_STATCNT(afs_sync); -#if defined(AFS_DISCON_ENV) /* Can't do this in OpenBSD 2.7, it faults when called from apm_suspend() */ store_dirty_vcaches(); -#endif return 0; } diff --git a/src/afs/NBSD/osi_vnodeops.c b/src/afs/NBSD/osi_vnodeops.c index 776a3b193..b48b1d732 100644 --- a/src/afs/NBSD/osi_vnodeops.c +++ b/src/afs/NBSD/osi_vnodeops.c @@ -114,9 +114,7 @@ NONINFRINGEMENT. #include "afs/nfsclient.h" #include "afs/afs_osidnlc.h" -#ifdef AFS_DISCON_ENV extern int afs_FlushVS(struct vcache *tvc); -#endif #define M_AFSNODE (M_TEMP-1) /* XXX */ @@ -960,12 +958,8 @@ afs_nbsd_reclaim(void *v) AFS_GLOCK(); if (!haveVlock) ObtainWriteLock(&afs_xvcache, 901); -#ifndef AFS_DISCON_ENV - code = afs_FlushVCache(avc, &slept); /* tosses our stuff from vnode */ -#else /* reclaim the vnode and the in-memory vcache, but keep the on-disk vcache */ code = afs_FlushVS(avc); -#endif if (!haveVlock) ReleaseWriteLock(&afs_xvcache); if (!haveGlock) diff --git a/src/afs/OBSD/osi_vfsops.c b/src/afs/OBSD/osi_vfsops.c index 94bf7e9e1..805550293 100644 --- a/src/afs/OBSD/osi_vfsops.c +++ b/src/afs/OBSD/osi_vfsops.c @@ -237,12 +237,10 @@ afs_mount(mp, path, data, ndp, p) AFS_STATCNT(afs_mount); AFS_GLOCK(); -#ifdef AFS_DISCON_ENV /* initialize the vcache entries before we start using them */ /* XXX find a better place for this if possible */ init_vcache_entries(); -#endif afs_globalVFS = mp; mp->osi_vfs_bsize = 8192; mp->osi_vfs_fsid.val[0] = AFS_VFSMAGIC; /* magic */ @@ -276,9 +274,7 @@ afs_unmount(afsp, flags, p) } AFS_STATCNT(afs_unmount); -#ifdef AFS_DISCON_ENV give_up_cbs(); -#endif if (afs_globalVFS == NULL) { printf("afs already unmounted\n"); return 0; @@ -385,7 +381,7 @@ int afs_sync(struct osi_vfs *afsp) { AFS_STATCNT(afs_sync); -#if defined(AFS_DISCON_ENV) && !defined(AFS_OBSD_ENV) +#if !defined(AFS_OBSD27_ENV) /* Can't do this in OpenBSD 2.7, it faults when called from apm_suspend() */ store_dirty_vcaches(); #endif diff --git a/src/afs/OBSD/osi_vnodeops.c b/src/afs/OBSD/osi_vnodeops.c index 560b083f9..9626d3d19 100644 --- a/src/afs/OBSD/osi_vnodeops.c +++ b/src/afs/OBSD/osi_vnodeops.c @@ -113,9 +113,7 @@ NONINFRINGEMENT. #include "afs/nfsclient.h" #include "afs/afs_osidnlc.h" -#ifdef AFS_DISCON_ENV extern int afs_FlushVS(struct vcache *tvc); -#endif #define M_AFSNODE (M_TEMP-1) /* XXX */ @@ -908,12 +906,8 @@ afs_obsd_reclaim(void *v) AFS_GLOCK(); if (!haveVlock) ObtainWriteLock(&afs_xvcache, 901); -#ifndef AFS_DISCON_ENV - code = afs_FlushVCache(avc, &slept); /* tosses our stuff from vnode */ -#else /* reclaim the vnode and the in-memory vcache, but keep the on-disk vcache */ code = afs_FlushVS(avc); -#endif if (!haveVlock) ReleaseWriteLock(&afs_xvcache); if (!haveGlock) diff --git a/src/afs/VNOPS/afs_vnop_attrs.c b/src/afs/VNOPS/afs_vnop_attrs.c index 1bccc2202..02338c800 100644 --- a/src/afs/VNOPS/afs_vnop_attrs.c +++ b/src/afs/VNOPS/afs_vnop_attrs.c @@ -596,15 +596,11 @@ afs_setattr(OSI_VC_DECL(avc), register struct vattr *attrs, osi_dnlc_purgedp(avc); /* error? erase any changes we made to vcache entry */ } - -#if defined(AFS_DISCON_ENV) } else { - ObtainSharedLock(&avc->lock, 712); /* Write changes locally. */ code = afs_WriteVCacheDiscon(avc, &astat, attrs); ReleaseSharedLock(&avc->lock); -#endif } /* if (!AFS_IS_DISCONNECTED) */ #if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) diff --git a/src/afs/VNOPS/afs_vnop_create.c b/src/afs/VNOPS/afs_vnop_create.c index bb25cad6e..f0d17c443 100644 --- a/src/afs/VNOPS/afs_vnop_create.c +++ b/src/afs/VNOPS/afs_vnop_create.c @@ -362,12 +362,10 @@ afs_create(OSI_VC_DECL(adp), char *aname, struct vattr *attrs, } } else { -#if defined(AFS_DISCON_ENV) /* Generate a fake FID for disconnected mode. */ newFid.Cell = adp->f.fid.Cell; newFid.Fid.Volume = adp->f.fid.Fid.Volume; afs_GenFakeFid(&newFid, VREG, 1); -#endif } /* if (!AFS_IS_DISCON_RW) */ /* otherwise, we should see if we can make the change to the dir locally */ @@ -452,10 +450,8 @@ afs_create(OSI_VC_DECL(adp), char *aname, struct vattr *attrs, } ReleaseWriteLock(&afs_xcbhash); if (AFS_IS_DISCON_RW) { -#if defined(AFS_DISCON_ENV) afs_DisconAddDirty(tvc, VDisconCreate, 0); afs_GenDisconStatus(adp, tvc, &newFid, attrs, &treq, VREG); -#endif } else { afs_ProcessFS(tvc, &OutFidStatus, &treq); } diff --git a/src/afs/VNOPS/afs_vnop_dirops.c b/src/afs/VNOPS/afs_vnop_dirops.c index a3d5ea464..1b7f1c040 100644 --- a/src/afs/VNOPS/afs_vnop_dirops.c +++ b/src/afs/VNOPS/afs_vnop_dirops.c @@ -42,9 +42,7 @@ afs_mkdir(OSI_VC_DECL(adp), char *aname, struct vattr *attrs, register struct afs_conn *tc; struct VenusFid newFid; register struct dcache *tdc; -#ifdef AFS_DISCON_ENV struct dcache *new_dc; -#endif afs_size_t offset, len; register struct vcache *tvc; struct AFSStoreStatus InStatus; @@ -145,7 +143,6 @@ afs_mkdir(OSI_VC_DECL(adp), char *aname, struct vattr *attrs, } } else { -#if defined(AFS_DISCON_ENV) /* Disconnected. */ /* We have the dir entry now, we can use it while disconnected. */ @@ -160,7 +157,6 @@ afs_mkdir(OSI_VC_DECL(adp), char *aname, struct vattr *attrs, /* Operations with the actual dir's cache entry are further * down, where the dir entry gets created. */ -#endif } /* if (!AFS_IS_DISCON_RW) */ /* otherwise, we should see if we can make the change to the dir locally */ @@ -190,7 +186,6 @@ afs_mkdir(OSI_VC_DECL(adp), char *aname, struct vattr *attrs, newFid.Fid.Volume = adp->f.fid.Fid.Volume; ReleaseWriteLock(&adp->lock); if (AFS_IS_DISCON_RW) { -#if defined(AFS_DISCON_ENV) /* When disconnected, we have to create the full dir here. */ /* Generate a new vcache and fill it. */ @@ -230,7 +225,6 @@ afs_mkdir(OSI_VC_DECL(adp), char *aname, struct vattr *attrs, afs_DisconAddDirty(tvc, VDisconCreate, 1); ReleaseWriteLock(&tvc->lock); -#endif /* #ifdef AFS_DISCON_ENV */ } else { /* now we're done with parent dir, create the real dir's cache entry */ tvc = afs_GetVCache(&newFid, &treq, NULL, NULL); @@ -377,7 +371,6 @@ afs_rmdir(OSI_VC_DECL(adp), char *aname, afs_ucred_t *acred) adp->f.m.LinkCount = OutDirStatus.LinkCount; } else { -#if defined(AFS_DISCON_ENV) /* Disconnected. */ if (!tdc) { @@ -430,7 +423,6 @@ afs_rmdir(OSI_VC_DECL(adp), char *aname, afs_ucred_t *acred) } adp->f.m.LinkCount--; -#endif /* #ifdef AFS_DISCON_ENV */ } /* if (!AFS_IS_DISCON_RW) */ if (tdc) @@ -456,7 +448,6 @@ afs_rmdir(OSI_VC_DECL(adp), char *aname, afs_ucred_t *acred) if (tvc) { ObtainWriteLock(&tvc->lock, 155); tvc->f.states &= ~CUnique; /* For the dfs xlator */ -#if defined(AFS_DISCON_ENV) if (AFS_IS_DISCON_RW) { if (tvc->f.ddirty_flags & VDisconCreate) { /* If we we were created whilst disconnected, removal doesn't @@ -466,7 +457,6 @@ afs_rmdir(OSI_VC_DECL(adp), char *aname, afs_ucred_t *acred) afs_DisconAddDirty(tvc, VDisconRemove, 1); } } -#endif ReleaseWriteLock(&tvc->lock); afs_PutVCache(tvc); } diff --git a/src/afs/VNOPS/afs_vnop_open.c b/src/afs/VNOPS/afs_vnop_open.c index 6e8d2d5d3..9e7cb7ff7 100644 --- a/src/afs/VNOPS/afs_vnop_open.c +++ b/src/afs/VNOPS/afs_vnop_open.c @@ -69,14 +69,12 @@ afs_open(struct vcache **avcp, afs_int32 aflags, afs_ucred_t *acred) ObtainReadLock(&tvc->lock); -#ifdef AFS_DISCON_ENV if (AFS_IS_DISCONNECTED && (afs_DCacheMissingChunks(tvc) != 0)) { ReleaseReadLock(&tvc->lock); /* printf("Network is down in afs_open: missing chunks\n"); */ code = ENETDOWN; goto done; } -#endif ReleaseReadLock(&tvc->lock); diff --git a/src/afs/VNOPS/afs_vnop_read.c b/src/afs/VNOPS/afs_vnop_read.c index 58212434f..267c875f2 100644 --- a/src/afs/VNOPS/afs_vnop_read.c +++ b/src/afs/VNOPS/afs_vnop_read.c @@ -436,14 +436,12 @@ afs_PrefetchChunk(struct vcache *avc, struct dcache *adc, ReleaseReadLock(&adc->lock); tdc = afs_GetDCache(avc, offset, areq, &j1, &j2, 2); /* type 2 never returns 0 */ -#ifdef AFS_DISCON_ENV /* * In disconnected mode, type 2 can return 0 because it doesn't * make any sense to allocate a dcache we can never fill */ if (tdc == NULL) return; -#endif /* AFS_DISCON_ENV */ ObtainSharedLock(&tdc->mflock, 651); if (!(tdc->mflags & DFFetchReq)) { @@ -628,13 +626,10 @@ afs_UFSRead(register struct vcache *avc, struct uio *auio, afs_PutDCache(tdc); /* before reusing tdc */ } tdc = afs_GetDCache(avc, filePos, &treq, &offset, &len, 2); -#ifdef AFS_DISCON_ENV if (!tdc) { - printf("Network down in afs_read"); error = ENETDOWN; break; } -#endif /* AFS_DISCON_ENV */ ObtainReadLock(&tdc->lock); /* now, first try to start transfer, if we'll need the data. If diff --git a/src/afs/VNOPS/afs_vnop_remove.c b/src/afs/VNOPS/afs_vnop_remove.c index bd3be23d9..55363cd36 100644 --- a/src/afs/VNOPS/afs_vnop_remove.c +++ b/src/afs/VNOPS/afs_vnop_remove.c @@ -280,7 +280,6 @@ afs_remove(OSI_VC_DECL(adp), char *aname, afs_ucred_t *acred) } } -#if defined(AFS_DISCON_ENV) if (AFS_IS_DISCON_RW) { if (!adp->f.shadow.vnode && !(adp->f.ddirty_flags & VDisconCreate)) { /* Make shadow copy of parent dir. */ @@ -308,7 +307,6 @@ afs_remove(OSI_VC_DECL(adp), char *aname, afs_ucred_t *acred) if (tdc) ObtainSharedLock(&tdc->lock, 714); } -#endif if (tvc && osi_Active(tvc)) { /* about to delete whole file, prefetch it first */ @@ -365,14 +363,12 @@ afs_remove(OSI_VC_DECL(adp), char *aname, afs_ucred_t *acred) } tvc->uncred = acred; tvc->f.states |= CUnlinked; -#if defined(AFS_DISCON_ENV) /* if rename succeeded, remove should not */ ObtainWriteLock(&tvc->lock, 715); if (tvc->f.ddirty_flags & VDisconRemove) { tvc->f.ddirty_flags &= ~VDisconRemove; } ReleaseWriteLock(&tvc->lock); -#endif } else { osi_FreeSmallSpace(unlname); } diff --git a/src/afs/VNOPS/afs_vnop_rename.c b/src/afs/VNOPS/afs_vnop_rename.c index 902757a6d..c36c5765d 100644 --- a/src/afs/VNOPS/afs_vnop_rename.c +++ b/src/afs/VNOPS/afs_vnop_rename.c @@ -191,7 +191,6 @@ afsrename(struct vcache *aodp, char *aname1, struct vcache *andp, SHARED_LOCK, NULL)); } else { -#if defined(AFS_DISCON_ENV) /* Disconnected. */ /* Seek moved file vcache. */ @@ -233,7 +232,6 @@ afsrename(struct vcache *aodp, char *aname1, struct vcache *andp, } else { code = ENOENT; } /* if (tvc) */ -#endif } /* if !(AFS_IS_DISCON_RW)*/ returnCode = code; /* remember for later */ @@ -408,13 +406,11 @@ afsrename(struct vcache *aodp, char *aname1, struct vcache *andp, tdc1 = afs_FindDCache(tvc, (afs_size_t) 0); if (tdc1) { if (AFS_IS_DISCON_RW) { -#if defined(AFS_DISCON_ENV) /* If disconnected, we need to fix (not discard) the "..".*/ afs_dir_ChangeFid(tdc1, "..", &aodp->f.fid.Fid.Vnode, &andp->f.fid.Fid.Vnode); -#endif } else { ObtainWriteLock(&tdc1->lock, 648); ZapDCE(tdc1); /* mark as unknown */ diff --git a/src/afs/VNOPS/afs_vnop_symlink.c b/src/afs/VNOPS/afs_vnop_symlink.c index c09c35fee..73292f830 100644 --- a/src/afs/VNOPS/afs_vnop_symlink.c +++ b/src/afs/VNOPS/afs_vnop_symlink.c @@ -37,7 +37,6 @@ extern afs_rwlock_t afs_xcbhash; * is just a performance hit. */ -#ifdef AFS_DISCON_ENV static int afs_DisconCreateSymlink(struct vcache *avc, char *aname, struct vrequest *areq) { @@ -63,7 +62,6 @@ afs_DisconCreateSymlink(struct vcache *avc, char *aname, ReleaseWriteLock(&tdc->lock); return 0; } -#endif /* don't set CDirty in here because RPC is called synchronously */ int @@ -189,11 +187,9 @@ afs_symlink(OSI_VC_DECL(adp), char *aname, struct vattr *attrs, (tc, code, &adp->f.fid, &treq, AFS_STATS_FS_RPCIDX_SYMLINK, SHARED_LOCK, NULL)); } else { -#ifdef AFS_DISCON_ENV newFid.Cell = adp->f.fid.Cell; newFid.Fid.Volume = adp->f.fid.Fid.Volume; afs_GenFakeFid(&newFid, VREG, 0); -#endif } ObtainWriteLock(&afs_xvcache, 40); @@ -263,7 +259,6 @@ afs_symlink(OSI_VC_DECL(adp), char *aname, struct vattr *attrs, ReleaseWriteLock(&afs_xcbhash); if (AFS_IS_DISCON_RW) { -#ifdef AFS_DISCON_ENV attrs->va_mode = InStatus.UnixModeBits; afs_GenDisconStatus(adp, tvc, &newFid, attrs, &treq, VLNK); code = afs_DisconCreateSymlink(tvc, atargetName, &treq); @@ -276,7 +271,6 @@ afs_symlink(OSI_VC_DECL(adp), char *aname, struct vattr *attrs, goto done; } afs_DisconAddDirty(tvc, VDisconCreate, 0); -#endif } else { afs_ProcessFS(tvc, &OutFidStatus, &treq); } diff --git a/src/afs/VNOPS/afs_vnop_write.c b/src/afs/VNOPS/afs_vnop_write.c index c12c3277c..651f8ecad 100644 --- a/src/afs/VNOPS/afs_vnop_write.c +++ b/src/afs/VNOPS/afs_vnop_write.c @@ -261,10 +261,8 @@ afs_MemWrite(register struct vcache *avc, struct uio *auio, int aio, osi_Assert(filePos <= avc->f.m.Length); #else if (filePos > avc->f.m.Length) { -#if defined(AFS_DISCON_ENV) if (AFS_IS_DISCON_RW) afs_PopulateDCache(avc, filePos, &treq); -#endif afs_Trace4(afs_iclSetp, CM_TRACE_SETLENGTH, ICL_TYPE_STRING, __FILE__, ICL_TYPE_LONG, __LINE__, ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(avc->f.m.Length), ICL_TYPE_OFFSET, @@ -565,10 +563,8 @@ afs_UFSWrite(register struct vcache *avc, struct uio *auio, int aio, osi_Assert(filePos <= avc->f.m.Length); #else if (filePos > avc->f.m.Length) { -#if defined(AFS_DISCON_ENV) if (AFS_IS_DISCON_RW) afs_PopulateDCache(avc, filePos, &treq); -#endif afs_Trace4(afs_iclSetp, CM_TRACE_SETLENGTH, ICL_TYPE_STRING, __FILE__, ICL_TYPE_LONG, __LINE__, ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(avc->f.m.Length), ICL_TYPE_OFFSET, @@ -867,22 +863,17 @@ afs_fsync(OSI_VC_DECL(avc), afs_ucred_t *acred) ObtainSharedLock(&avc->lock, 18); code = 0; if (avc->execsOrWriters > 0) { - if (!AFS_IS_DISCONNECTED && !AFS_IS_DISCON_RW) { - /* Your average flush. */ - - /* put the file back */ - UpgradeSToWLock(&avc->lock, 41); - code = afs_StoreAllSegments(avc, &treq, AFS_SYNC); - ConvertWToSLock(&avc->lock); - -#if defined(AFS_DISCON_ENV) + /* Your average flush. */ + + /* put the file back */ + UpgradeSToWLock(&avc->lock, 41); + code = afs_StoreAllSegments(avc, &treq, AFS_SYNC); + ConvertWToSLock(&avc->lock); } else { - UpgradeSToWLock(&avc->lock, 711); afs_DisconAddDirty(avc, VDisconWriteFlush, 1); ConvertWToSLock(&avc->lock); -#endif } /* if not disconnected */ } /* if (avc->execsOrWriters > 0) */ diff --git a/src/afs/afs.h b/src/afs/afs.h index 1c8357f43..1e6ab74ad 100644 --- a/src/afs/afs.h +++ b/src/afs/afs.h @@ -612,8 +612,6 @@ struct SimpleLocks { #define VRevokeWait 0x1 #define VPageCleaning 0x2 /* Solaris - Cache Trunc Daemon sez keep out */ -#if defined(AFS_DISCON_ENV) - /* Dirty disconnected vcache flags. */ #define VDisconSetTime 0x00000001 /* set time. */ #define VDisconSetMode 0x00000002 /* set mode. */ @@ -632,7 +630,6 @@ struct SimpleLocks { #define VDisconRenameSameDir 0x00020000 /* Rename in same dir. */ /*... to be continued ... */ -#endif #if defined(AFS_CACHE_BYPASS) /* vcache (file) cachingStates bits */ @@ -731,14 +728,12 @@ struct fvcache { /*! state bits */ afs_uint32 states; -#if defined(AFS_DISCON_ENV) /*! Disconnected flags for this vcache element. */ afs_uint32 ddirty_flags; /*! Shadow vnode + unique keep the shadow dir location. */ struct afs_vnuniq shadow; /*! The old parent FID for renamed vnodes */ struct afs_vnuniq oldParent; -#endif }; /* INVARIANTs: (vlruq.next != NULL) == (vlruq.prev != NULL) @@ -757,7 +752,6 @@ struct vcache { #endif struct vcache *hnext; /* Hash next */ struct afs_q vhashq; /* Hashed per-volume list */ -#if defined(AFS_DISCON_ENV) /*! Queue of dirty vcaches. Lock with afs_disconDirtyLock */ struct afs_q dirtyq; /*! Queue of vcaches with shadow entries. Lock with afs_disconDirtyLock */ @@ -766,7 +760,6 @@ struct vcache { struct afs_q metadirty; /*! Vcaches slot number in the disk backup. Protected by tvc->lock */ afs_uint32 diskSlot; -#endif struct fvcache f; afs_rwlock_t lock; /* The lock on the vcache contents. */ #if defined(AFS_SUN5_ENV) diff --git a/src/afs/afs_callback.c b/src/afs/afs_callback.c index 0cdbc28be..aab781566 100644 --- a/src/afs/afs_callback.c +++ b/src/afs/afs_callback.c @@ -62,11 +62,9 @@ static struct ltable { "afs_xvreclaim", (char *)&afs_xvreclaim}, { "afsdb_client_lock", (char *)&afsdb_client_lock}, { "afsdb_req_lock", (char *)&afsdb_req_lock}, -#ifdef AFS_DISCON_ENV { "afs_discon_lock", (char *)&afs_discon_lock}, { "afs_disconDirtyLock", (char *)&afs_disconDirtyLock}, { "afs_discon_vc_dirty", (char *)&afs_xvcdirty}, -#endif }; unsigned long lastCallBack_vnode; unsigned int lastCallBack_dv; diff --git a/src/afs/afs_daemons.c b/src/afs/afs_daemons.c index 12fa8c8a3..84f596e7e 100644 --- a/src/afs/afs_daemons.c +++ b/src/afs/afs_daemons.c @@ -201,9 +201,7 @@ afs_Daemon(void) ReleaseWriteLock(&afs_xvcache); afs_FlushActiveVcaches(1); /* keep flocks held & flush nfs writes */ #if 0 -#ifdef AFS_DISCON_ENV afs_StoreDirtyVcaches(); -#endif #endif afs_CheckRXEpoch(); last1MinCheck = now; diff --git a/src/afs/afs_dcache.c b/src/afs/afs_dcache.c index f27e08a32..2232da97b 100644 --- a/src/afs/afs_dcache.c +++ b/src/afs/afs_dcache.c @@ -3284,8 +3284,6 @@ afs_ObtainDCacheForWriting(struct vcache *avc, afs_size_t filePos, return tdc; } -#if defined(AFS_DISCON_ENV) - /*! * Make a shadow copy of a dir's dcache. It's used for disconnected * operations like remove/create/rename to keep the original directory data. @@ -3486,5 +3484,3 @@ afs_PopulateDCache(struct vcache *avc, afs_size_t apos, struct vrequest *areq) start++; } } - -#endif diff --git a/src/afs/afs_disconnected.c b/src/afs/afs_disconnected.c index a1f476d26..db244bf3d 100644 --- a/src/afs/afs_disconnected.c +++ b/src/afs/afs_disconnected.c @@ -14,8 +14,6 @@ #include "afs/lock.h" #include "afs/afs_cbqueue.h" -#ifdef AFS_DISCON_ENV - #define dv_match(vc, fstat) \ ((vc->f.m.DataVersion.low == fstat.DataVersion) && \ (vc->f.m.DataVersion.high == fstat.dataVersionHigh)) @@ -1536,4 +1534,3 @@ afs_GenDisconStatus(struct vcache *adp, struct vcache *avc, avc->f.states |= CStatd; avc->f.states &= ~CBulkFetching; } -#endif diff --git a/src/afs/afs_init.c b/src/afs/afs_init.c index b247bb64f..1d35f459f 100644 --- a/src/afs/afs_init.c +++ b/src/afs/afs_init.c @@ -50,10 +50,8 @@ int afs_memvolumes = 0; #if defined(AFS_XBSD_ENV) static struct vnode *volumeVnode; #endif -#if defined(AFS_DISCON_ENV) afs_rwlock_t afs_discon_lock; extern afs_rwlock_t afs_disconDirtyLock; -#endif #if defined(AFS_LINUX26_ENV) && defined(STRUCT_TASK_STRUCT_HAS_CRED) const struct cred *cache_creds; #endif @@ -131,12 +129,10 @@ afs_CacheInit(afs_int32 astatSize, afs_int32 afiles, afs_int32 ablocks, LOCK_INIT(&afs_ftf, "afs_ftf"); AFS_RWLOCK_INIT(&afs_xaxs, "afs_xaxs"); -#ifdef AFS_DISCON_ENV AFS_RWLOCK_INIT(&afs_discon_lock, "afs_discon_lock"); AFS_RWLOCK_INIT(&afs_disconDirtyLock, "afs_disconDirtyLock"); QInit(&afs_disconDirty); QInit(&afs_disconShadow); -#endif osi_dnlc_init(); /* diff --git a/src/afs/afs_pioctl.c b/src/afs/afs_pioctl.c index 1c67e4432..355048afd 100644 --- a/src/afs/afs_pioctl.c +++ b/src/afs/afs_pioctl.c @@ -33,14 +33,12 @@ afs_int32 afs_waitForever = 0; short afs_waitForeverCount = 0; afs_int32 afs_showflags = GAGUSER | GAGCONSOLE; /* show all messages */ -#ifdef AFS_DISCON_ENV afs_int32 afs_is_disconnected; afs_int32 afs_is_discon_rw; /* On reconnection, turn this knob on until it finishes, * then turn it off. */ afs_int32 afs_in_sync = 0; -#endif struct afs_pdata { char *ptr; @@ -5137,7 +5135,6 @@ DECL_PIOCTL(PCallBackAddr) DECL_PIOCTL(PDiscon) { -#ifdef AFS_DISCON_ENV static afs_int32 mode = 1; /* Start up in 'off' */ afs_int32 force = 0; int code = 0; @@ -5204,9 +5201,6 @@ DECL_PIOCTL(PDiscon) return code; return afs_pd_putInt(aout, mode); -#else - return EINVAL; -#endif } DECL_PIOCTL(PNFSNukeCreds) diff --git a/src/afs/afs_vcache.c b/src/afs/afs_vcache.c index ca51240e5..af829510e 100644 --- a/src/afs/afs_vcache.c +++ b/src/afs/afs_vcache.c @@ -58,9 +58,7 @@ char *makesname(); #endif /* AFS_SGI64_ENV */ /* Exported variables */ -#ifdef AFS_DISCON_ENV afs_rwlock_t afs_xvcdirty; /*Lock: discon vcache dirty list mgmt */ -#endif afs_rwlock_t afs_xvcache; /*Lock: alloc new stat cache entries */ afs_rwlock_t afs_xvreclaim; /*Lock: entries reclaimed, not on free list */ afs_lock_t afs_xvcb; /*Lock: fids on which there are callbacks */ @@ -81,10 +79,8 @@ int afs_norefpanic = 0; /* Disk backed vcache definitions * Both protected by xvcache */ -#ifdef AFS_DISCON_ENV static int afs_nextVcacheSlot = 0; static struct afs_slotlist *afs_freeSlotList = NULL; -#endif /* Forward declarations */ static afs_int32 afs_QueueVCB(struct vcache *avc); @@ -713,7 +709,6 @@ afs_AllocVCache(void) afs_stats_cmperf.vcacheXAllocs++; /* count in case we have a leak */ -#ifdef AFS_DISCON_ENV /* If we create a new inode, we either give it a new slot number, * or if one's available, use a slot number from the slot free list */ @@ -727,7 +722,6 @@ afs_AllocVCache(void) } else { tvc->diskSlot = afs_nextVcacheSlot++; } -#endif return tvc; } @@ -740,17 +734,13 @@ static void afs_PrePopulateVCache(struct vcache *avc, struct VenusFid *afid, struct server *serverp) { -#if defined(AFS_DISCON_ENV) afs_uint32 slot; slot = avc->diskSlot; -#endif osi_PrePopulateVCache(avc); -#if defined(AFS_DISCON_ENV) avc->diskSlot = slot; QZero(&avc->metadirty); -#endif AFS_RWLOCK_INIT(&avc->lock, "vcache lock"); @@ -1276,7 +1266,6 @@ afs_WriteVCache(register struct vcache *avc, return code; } /*afs_WriteVCache */ -#if defined(AFS_DISCON_ENV) /*! * Store status info only locally, set the proper disconnection flags @@ -1356,8 +1345,6 @@ afs_WriteVCacheDiscon(register struct vcache *avc, return code; } -#endif - /*! * Copy astat block into vcache info * diff --git a/src/afs/discon.h b/src/afs/discon.h index a042e6d37..dfd755662 100644 --- a/src/afs/discon.h +++ b/src/afs/discon.h @@ -1,17 +1,6 @@ #ifndef _DISCON_H #define _DISCON_H -#ifndef AFS_DISCON_ENV -#define AFS_IS_DISCONNECTED 0 -#define AFS_IS_DISCON_RW 0 -#define AFS_IN_SYNC 0 -#define AFS_DISCON_LOCK() -#define AFS_DISCON_UNLOCK() - -#define afs_DisconAddDirty(x, y, z) - -#else - #if !defined(inline) && !defined(__GNUC__) #define inline #endif @@ -83,5 +72,4 @@ static inline void afs_DisconRemoveDirty(struct vcache *avc) { avc->f.ddirty_flags = 0; afs_PutVCache(avc); } -#endif /* AFS_DISCON_ENV */ #endif /* _DISCON_H */ -- 2.39.5