return 0;
}
+/*!
+ * Returns non-zero if the volume is the dynroot volume.
+ */
+int
+afs_IsDynrootVolume(struct volume *v)
+{
+ return (afs_dynrootEnable
+ && v->cell == afs_dynrootCell
+ && v->volume == AFS_DYNROOT_VOLUME);
+}
+
/*
* Returns non-zero iff fid corresponds to the top of the dynroot volume.
*/
/* afs_dynroot.c */
extern afs_rwlock_t afs_dynrootDirLock;
extern afs_rwlock_t afs_dynSymlinkLock;
+extern int afs_IsDynrootVolume(struct volume *v);
extern int afs_IsDynrootFid(struct VenusFid *fid);
extern int afs_IsDynrootMountFid(struct VenusFid *fid);
extern int afs_IsDynrootAnyFid(struct VenusFid *fid);
}
}
+/*!
+ * Returns non-zero if the volume information is expired.
+ *
+ * Dynroot volumes are not setup from vldb queries, so never expire.
+ * Read-only volume expiry is tied to the volume callback.
+ *
+ * \param tv volume to check
+ * \param now current time
+ *
+ * \return non-zero if the volume should be reset
+ */
+static int
+IsExpired(struct volume *tv, afs_int32 now)
+{
+ return (tv->expireTime < (now + 10)) && (tv->states & VRO)
+ && !afs_IsDynrootVolume(tv);
+}
+
/**
* Reset volume name to volume id mapping cache.
* @param flags
{
afs_int32 i, j;
struct volume *tv;
- unsigned int now;
+ afs_int32 now;
struct vcache *tvc;
afs_int32 *volumeID, *cellID, vsize, nvols;
#ifdef AFS_DARWIN80_ENV
for (i = 0; i < NVOLS; i++) {
for (tv = afs_volumes[i]; tv; tv = tv->next) {
if (flags & AFS_VOLCHECK_EXPIRED) {
- if (((tv->expireTime < (now + 10)) && (tv->states & VRO))
- || (flags & AFS_VOLCHECK_FORCE)) {
+ if (IsExpired(tv, now) || (flags & AFS_VOLCHECK_FORCE)) {
afs_ResetVolumeInfo(tv); /* also resets status */
if (volumeID) {
volumeID[nvols] = tv->volume;