]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
DEVEL15-windows-freelance-20080301
authorJeffrey Altman <jaltman@secure-endpoints.com>
Sat, 1 Mar 2008 17:44:28 +0000 (17:44 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Sat, 1 Mar 2008 17:44:28 +0000 (17:44 +0000)
LICENSE MIT

when support for multiple valid buffer data versions was added
forget to remove the force dv change from the freelance code.
this broken automatic additions of new mount points.

(cherry picked from commit 7083ceec5c21e500f23110152dcc994c7ccfab92)

src/WINNT/afsd/afsd.h
src/WINNT/afsd/afsd_init.c
src/WINNT/afsd/cm_freelance.c
src/WINNT/afsd/cm_scache.c

index 45dac47389aaeb2d8e0ac94000ee55e071c3d43a..69f7737259293f262f4695c2c3d1b8042db364cb 100644 (file)
@@ -112,12 +112,10 @@ extern cm_localMountPoint_t* cm_localMountPoints; // array of fake mountpoints
 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;
index 95b9239f4838846057e01f9316ce4f4995259f04..d5318f91d351dc9e064a604875754cdbf7e0c038 100644 (file)
@@ -62,9 +62,6 @@ char cm_mountRoot[1024];
 DWORD cm_mountRootLen;
 int cm_logChunkSize;
 int cm_chunkSize;
-#ifdef AFS_FREELANCE_CLIENT
-char *cm_FakeRootDir;
-#endif /* freelance */
 
 int smb_UseV3 = 1;
 
index 656d3633d51cf17c480bf14445d4e13f3b1546a6..33a5fabd0810058de8c4425444ba40516d3fb655 100644 (file)
@@ -23,7 +23,8 @@
 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;
@@ -231,8 +232,12 @@ void cm_InitFakeRootDir() {
     }
 
     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
@@ -447,11 +452,6 @@ int cm_reInitLocalMountPoints() {
     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();
index 8b55ca9843ab817a33d5d47f18a7da618f8083bd..709a4c35195839e356ae73448863ccc2a971f1f5 100644 (file)
@@ -1523,8 +1523,6 @@ void cm_MergeStatus(cm_scache_t *dscp,
         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 */