extern int cm_fakeDirSize; // size (in bytes) of fake root.afs directory
extern int cm_fakeDirCallback; // state of the fake root.afs directory. indicates
- // if it needs to be refreshed
+ // if it needs to be refreshed
extern int cm_fakeGettingCallback; // 1 if currently updating the fake root.afs directory,
- // 0 otherwise
-
-extern int cm_fakeDirVersion; // the version number of the root.afs directory. used
+ // 0 otherwise
#endif /* AFS_FREELANCE_CLIENT */
extern int cm_dnsEnabled;
extern void afsi_log(char *pattern, ...);
int cm_noLocalMountPoints;
-int cm_fakeDirSize;
+char * cm_FakeRootDir = NULL;
+int cm_fakeDirSize = 0;
int cm_fakeDirCallback=0;
int cm_fakeGettingCallback=0;
cm_localMountPoint_t* cm_localMountPoints;
}
dirSize = (curPage+1) * CM_DIR_PAGESIZE;
- cm_FakeRootDir = malloc(dirSize);
- cm_fakeDirSize = dirSize;
+ if (cm_fakeDirSize != dirSize) {
+ if (cm_FakeRootDir)
+ free(cm_FakeRootDir);
+ cm_FakeRootDir = malloc(dirSize);
+ cm_fakeDirSize = dirSize;
+ }
// yj: when we get here, we've figured out how much memory we need and
// allocated the appropriate space for it. we now prceed to fill
cm_InitLocalMountPoints();
osi_Log0(afsd_logp,"\tcreated new set of localmountpoints!");
- // now we have to free the memory allocated in cm_initfakerootdir
- osi_Log0(afsd_logp,"Removing old fakedir... ");
- free(cm_FakeRootDir);
- osi_Log0(afsd_logp,"\t\told fakedir removed!");
-
// then we re-create that dir
osi_Log0(afsd_logp,"Creating new fakedir... ");
cm_InitFakeRootDir();
statusp->SyncCounter = 0;
statusp->dataVersionHigh = (afs_uint32)(cm_data.fakeDirVersion >> 32);
statusp->errorCode = 0;
-
- buf_ForceDataVersion(scp, scp->dataVersion, cm_data.fakeDirVersion);
}
#endif /* AFS_FREELANCE_CLIENT */