4 extern afs_int32 afs_is_disconnected
;
5 extern afs_int32 afs_is_discon_rw
;
6 extern afs_int32 afs_in_sync
;
7 extern afs_rwlock_t afs_discon_lock
;
9 extern struct afs_q afs_disconDirty
;
10 extern struct afs_q afs_disconShadow
;
11 extern afs_rwlock_t afs_disconDirtyLock
;
12 extern afs_int32 afs_ConflictPolicy
;
14 extern afs_uint32 afs_DisconVnode
; /* XXX: not protected. */
16 extern int afs_WriteVCacheDiscon(struct vcache
*avc
,
17 struct AFSStoreStatus
*astatus
,
19 extern int afs_ResyncDisconFiles(struct vrequest
*areq
,
21 extern void afs_RemoveAllConns(void);
22 extern void afs_GenFakeFid(struct VenusFid
*afid
, afs_uint32 avtype
,
24 extern void afs_GenShadowFid(struct VenusFid
*afid
);
25 extern void afs_GenDisconStatus(struct vcache
*adp
,
27 struct VenusFid
*afid
,
29 struct vrequest
*areq
,
31 extern int afs_MakeShadowDir(struct vcache
*avc
, struct dcache
*adc
);
32 extern void afs_DeleteShadowDir(struct vcache
*avc
);
33 extern struct dcache
*afs_FindDCacheByFid(struct VenusFid
*afid
);
34 extern void afs_UpdateStatus(struct vcache
*avc
,
35 struct VenusFid
*afid
,
36 struct vrequest
*areq
,
37 struct AFSFetchStatus
*Outsp
,
38 struct AFSCallBack
*acb
,
40 extern void afs_DisconDiscardAll(afs_ucred_t
*);
42 #define AFS_IS_DISCONNECTED (afs_is_disconnected || afs_is_discon_rw)
43 #define AFS_IS_DISCON_RW (afs_is_discon_rw)
44 #define AFS_IN_SYNC (afs_in_sync)
45 #define AFS_DISCON_LOCK() ObtainReadLock(&afs_discon_lock)
46 #define AFS_DISCON_UNLOCK() ReleaseReadLock(&afs_discon_lock)
48 /* Call with avc lock held */
49 static_inline
void afs_DisconAddDirty(struct vcache
*avc
, int operation
, int lock
) {
50 if (!avc
->f
.ddirty_flags
) {
52 ObtainWriteLock(&afs_xvcache
, 702);
53 ObtainWriteLock(&afs_disconDirtyLock
, 703);
54 QAdd(&afs_disconDirty
, &avc
->dirtyq
);
55 osi_Assert((afs_RefVCache(avc
) == 0));
56 ReleaseWriteLock(&afs_disconDirtyLock
);
58 ReleaseWriteLock(&afs_xvcache
);
60 avc
->f
.ddirty_flags
|= operation
;
63 /* Call with avc lock held */
64 static_inline
void afs_DisconRemoveDirty(struct vcache
*avc
) {
65 ObtainWriteLock(&afs_disconDirtyLock
, 704);
66 QRemove(&avc
->dirtyq
);
67 ReleaseWriteLock(&afs_disconDirtyLock
);
68 avc
->f
.ddirty_flags
= 0;
71 #endif /* _DISCON_H */