unix disconnected mode always
authorDerrick Brashear <shadow@dementia.org>
Tue, 13 Jul 2010 17:06:02 +0000 (13:06 -0400)
committerDerrick Brashear <shadow@dementia.org>
Tue, 13 Jul 2010 18:35:09 +0000 (11:35 -0700)
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 <jason@rampaginggeek.com>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

24 files changed:
acinclude.m4
src/afs/FBSD/osi_vnodeops.c
src/afs/NBSD/osi_vfsops.c
src/afs/NBSD/osi_vnodeops.c
src/afs/OBSD/osi_vfsops.c
src/afs/OBSD/osi_vnodeops.c
src/afs/VNOPS/afs_vnop_attrs.c
src/afs/VNOPS/afs_vnop_create.c
src/afs/VNOPS/afs_vnop_dirops.c
src/afs/VNOPS/afs_vnop_open.c
src/afs/VNOPS/afs_vnop_read.c
src/afs/VNOPS/afs_vnop_remove.c
src/afs/VNOPS/afs_vnop_rename.c
src/afs/VNOPS/afs_vnop_symlink.c
src/afs/VNOPS/afs_vnop_write.c
src/afs/afs.h
src/afs/afs_callback.c
src/afs/afs_daemons.c
src/afs/afs_dcache.c
src/afs/afs_disconnected.c
src/afs/afs_init.c
src/afs/afs_pioctl.c
src/afs/afs_vcache.c
src/afs/discon.h

index 2b818eb..dff2bb8 100644 (file)
@@ -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"
index 2a2bf29..0e7a6d1 100644 (file)
@@ -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)
index 456d38f..922b1d5 100644 (file)
@@ -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;
 }
 
index 776a3b1..b48b1d7 100644 (file)
@@ -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)
index 94bf7e9..8055502 100644 (file)
@@ -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
index 560b083..9626d3d 100644 (file)
@@ -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)
index 1bccc22..02338c8 100644 (file)
@@ -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)
index bb25cad..f0d17c4 100644 (file)
@@ -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);
            }
index a3d5ea4..1b7f1c0 100644 (file)
@@ -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);
     }
index 6e8d2d5..9e7cb7f 100644 (file)
@@ -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);
 
index 5821243..267c875 100644 (file)
@@ -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
index bd3be23..55363cd 100644 (file)
@@ -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);
        }
index 902757a..c36c576 100644 (file)
@@ -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 */
index c09c35f..73292f8 100644 (file)
@@ -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);
     }
index c12c327..651f8ec 100644 (file)
@@ -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) */
 
index 1c8357f..1e6ab74 100644 (file)
@@ -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)
index 0cdbc28..aab7815 100644 (file)
@@ -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;
index 12fa8c8..84f596e 100644 (file)
@@ -201,10 +201,8 @@ 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;
        }
index f27e08a..2232da9 100644 (file)
@@ -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
index a1f476d..db244bf 100644 (file)
@@ -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
index b247bb6..1d35f45 100644 (file)
@@ -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();
 
     /* 
index 1c67e44..355048a 100644 (file)
@@ -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)
index ca51240..af82951 100644 (file)
@@ -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
  *
index a042e6d..dfd7556 100644 (file)
@@ -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 */