Windows: use cm_noteLocalMountPointChange whenever fakeDirVersion is changed
authorJeffrey Altman <jaltman@your-file-system.com>
Sun, 2 May 2010 18:03:23 +0000 (14:03 -0400)
committerJeffrey Altman <jaltman@openafs.org>
Sun, 2 May 2010 19:11:03 +0000 (12:11 -0700)
cm_noteLocalMountPointChange() is meant to be used when fakeDirVersion
is changed.  It previously wasn't used because cm_noteLocalMountPointChange()
would obtain the cm_Freelance_Lock.  Now that cm_noteLocalMountPointChange()
can be called while holding the lock, use it everywhere.

LICENSE MIT

Change-Id: I737f4572773a93a656ca0f58e07a55d250c368a1
Reviewed-on: http://gerrit.openafs.org/1888
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

src/WINNT/afsd/cm_freelance.c

index 7b3fac3..f684496 100644 (file)
@@ -1078,8 +1078,7 @@ long cm_FreelanceAddMount(char *filename, char *cellname, char *volume, int rw,
     }
 
     /* Do this while we are holding the lock */
-    cm_data.fakeDirVersion++;
-    cm_localMountPointChangeFlag = 1;
+    cm_noteLocalMountPointChange(TRUE);
     lock_ReleaseMutex(&cm_Freelance_Lock);
 
     if (fidp) {
@@ -1207,8 +1206,7 @@ long cm_FreelanceRemoveMount(char *toremove)
 
     if (found) {
         /* Do this while we are holding the lock */
-        cm_data.fakeDirVersion++;
-        cm_localMountPointChangeFlag = 1;
+        cm_noteLocalMountPointChange(TRUE);
     }
     lock_ReleaseMutex(&cm_Freelance_Lock);
     return (found ? 0 : CM_ERROR_NOSUCHFILE);
@@ -1307,8 +1305,7 @@ long cm_FreelanceAddSymlink(char *filename, char *destination, cm_fid_t *fidp)
     } 
 
     /* Do this while we are holding the lock */
-    cm_data.fakeDirVersion++;
-    cm_localMountPointChangeFlag = 1;
+    cm_noteLocalMountPointChange(TRUE);
     lock_ReleaseMutex(&cm_Freelance_Lock);
 
     if (fidp) {
@@ -1390,8 +1387,7 @@ long cm_FreelanceRemoveSymlink(char *toremove)
     
     if (found) {
         /* Do this while we are holding the lock */
-        cm_data.fakeDirVersion++;
-        cm_localMountPointChangeFlag = 1;
+        cm_noteLocalMountPointChange(TRUE);
     }
     lock_ReleaseMutex(&cm_Freelance_Lock);
     return (found ? 0 : CM_ERROR_NOSUCHFILE);