#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;
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,
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)
/* 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);
- osi_vnhold(avc, 0);
+ osi_Assert((afs_RefVCache(avc) == 0));
ReleaseWriteLock(&afs_disconDirtyLock);
if (lock)
ReleaseWriteLock(&afs_xvcache);
}
avc->f.ddirty_flags |= operation;
-}
+}
/* Call with avc lock held */
static_inline void afs_DisconRemoveDirty(struct vcache *avc) {