Unix CM: We're disconnected if RW disconnected too
authorSimon Wilkinson <sxw@your-file-system.com>
Sat, 31 Mar 2012 18:23:18 +0000 (14:23 -0400)
committerDerrick Brashear <shadow@dementix.org>
Mon, 9 Apr 2012 01:20:15 +0000 (18:20 -0700)
At the moment, the Unix CM doesn't support entering a purely RO
disconnected mode (the historical AFS_IS_DISCONNECTED mode). If we
go disconnected, or reconnect we always toggle RW discon at the same
time as we toggle RO. Arguably, the RO disconnected mode should just
be removed, as it is now superceded.

For the moment, make it clear to the compiler that RW disconnected
implies RO disconnected, so that static analysis can make more sensible
decisions about code paths.

Change-Id: I7e2d04d2cf67740c6b6285950874c6a4eaeb0537
Reviewed-on: http://gerrit.openafs.org/7097
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

src/afs/discon.h

index 7f4781a..8c6f7ca 100644 (file)
@@ -39,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)