extern int cm_enableServerLocks;
extern int cm_deleteReadOnly;
extern afs_int32 cm_BPlusTrees;
+extern afs_int32 cm_OfflineROIsValid;
extern const char **smb_ExecutableExtensions;
osi_log_t *afsd_logp;
if (!smb_ExecutableExtensions)
afsi_log("No PrefetchExecutableExtensions");
+ dummyLen = sizeof(DWORD);
+ code = RegQueryValueEx(parmKey, "OfflineReadOnlyIsValid", NULL, NULL,
+ (BYTE *) &dwValue, &dummyLen);
+ if (code == ERROR_SUCCESS) {
+ cm_OfflineROIsValid = (unsigned short) dwValue;
+ }
+ afsi_log("CM OfflineReadOnlyIsValid is %u", cm_deleteReadOnly);
+
RegCloseKey (parmKey);
cacheBlocks = ((afs_uint64)cacheSize * 1024) / blockSize;
/* read/write lock for all global storage in this module */
osi_rwlock_t cm_callbackLock;
+afs_int32 cm_OfflineROIsValid = 0;
+
#ifdef AFS_FREELANCE_CLIENT
extern osi_mutex_t cm_Freelance_Lock;
#endif
}
#endif
- if (scp->cbServerp != NULL)
+ if (scp->cbServerp != NULL) {
return 1;
- else
+ } else if (cm_OfflineROIsValid) {
+ switch (cm_GetVolumeStatus(scp->volp, scp->fid.volume)) {
+ case vl_offline:
+ case vl_alldown:
+ case vl_unknown:
+ return 1;
+ default:
+ return 0;
+ }
+ } else {
return 0;
+ }
}
/* need to detect a broken callback that races with our obtaining a callback.
extern void cm_GiveUpAllCallbacksAllServers(afs_int32 markDown);
+extern afs_int32 cm_OfflineROIsValid;
#endif /* _CM_CALLBACK_H_ENV__ */
cm_VolStatus_Change_Notification(volp->cellp->cellID, volID, new);
}
+
+enum volstatus cm_GetVolumeStatus(cm_volume_t *volp, afs_uint32 volID)
+{
+ if (volp->rw.ID == volID) {
+ return volp->rw.state;
+ } else if (volp->ro.ID == volID) {
+ return volp->ro.state;
+ } else if (volp->bk.ID == volID) {
+ return volp->bk.state;
+ } else {
+ return vl_unknown;
+ }
+}
+
extern void cm_VolumeStatusNotification(cm_volume_t * volp, afs_uint32 volID, enum volstatus old, enum volstatus new);
+extern enum volstatus cm_GetVolumeStatus(cm_volume_t *volp, afs_uint32 volID);
#endif /* __CM_VOLUME_H_ENV__ */