Unix CM: We're disconnected if RW disconnected too
[openafs.git] / src / afs / discon.h
index df342ed..8c6f7ca 100644 (file)
@@ -1,10 +1,6 @@
 #ifndef _DISCON_H
 #define _DISCON_H
 
-#if !defined(inline) && !defined(__GNUC__)
-#define inline
-#endif
-
 extern afs_int32    afs_is_disconnected;
 extern afs_int32    afs_is_discon_rw;
 extern afs_int32    afs_in_sync;
@@ -17,13 +13,13 @@ extern afs_int32    afs_ConflictPolicy;
 
 extern afs_uint32 afs_DisconVnode; /* XXX: not protected. */
 
-extern int afs_WriteVCacheDiscon(register struct vcache *avc,
-                                       register struct AFSStoreStatus *astatus,
+extern int afs_WriteVCacheDiscon(struct vcache *avc,
+                                       struct AFSStoreStatus *astatus,
                                        struct vattr *attrs);
 extern int afs_ResyncDisconFiles(struct vrequest *areq,
                                        afs_ucred_t *acred);
 extern void afs_RemoveAllConns(void);
-extern void afs_GenFakeFid(struct VenusFid *afid, afs_uint32 avtype, 
+extern void afs_GenFakeFid(struct VenusFid *afid, afs_uint32 avtype,
                           int lock);
 extern void afs_GenShadowFid(struct VenusFid *afid);
 extern void afs_GenDisconStatus(struct vcache *adp,
@@ -43,7 +39,7 @@ extern void afs_UpdateStatus(struct vcache *avc,
                                        afs_uint32 start);
 extern void afs_DisconDiscardAll(afs_ucred_t *);
 
-#define AFS_IS_DISCONNECTED (afs_is_disconnected)
+#define AFS_IS_DISCONNECTED (afs_is_disconnected || afs_is_discon_rw)
 #define AFS_IS_DISCON_RW (afs_is_discon_rw)
 #define AFS_IN_SYNC (afs_in_sync)
 #define AFS_DISCON_LOCK() ObtainReadLock(&afs_discon_lock)
@@ -52,7 +48,7 @@ extern void afs_DisconDiscardAll(afs_ucred_t *);
 /* Call with avc lock held */
 static_inline void afs_DisconAddDirty(struct vcache *avc, int operation, int lock) {
     if (!avc->f.ddirty_flags) {
-       if (lock) 
+       if (lock)
            ObtainWriteLock(&afs_xvcache, 702);
        ObtainWriteLock(&afs_disconDirtyLock, 703);
        QAdd(&afs_disconDirty, &avc->dirtyq);
@@ -62,7 +58,7 @@ static_inline void afs_DisconAddDirty(struct vcache *avc, int operation, int loc
            ReleaseWriteLock(&afs_xvcache);
     }
     avc->f.ddirty_flags |= operation;
-} 
+}
 
 /* Call with avc lock held */
 static_inline void afs_DisconRemoveDirty(struct vcache *avc) {