Windows: add locked parameter to cm_noteLocalMountPointChange

If cm_Freelance_Lock is held set the 'locked' parameter to TRUE.
This avoids a requirement to drop the lock only to have it be
obtained when cm_noteLocalMountPointChange.

LICENSE MIT

Change-Id: Ic1e8a008639b33769a088c3b24ef7a7e7b09fb12
Reviewed-on: http://gerrit.openafs.org/1887
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
This commit is contained in:
Jeffrey Altman 2010-05-02 13:56:24 -04:00 committed by Jeffrey Altman
parent f2b98e27f8
commit 3a48bf73d3
4 changed files with 12 additions and 10 deletions

View File

@ -75,7 +75,7 @@ void cm_FreelanceChangeNotifier(void * parmp) {
hFreelanceChangeEvent = 0;
return;
}
cm_noteLocalMountPointChange();
cm_noteLocalMountPointChange(FALSE);
}
}
}
@ -120,7 +120,7 @@ void cm_FreelanceSymlinkChangeNotifier(void * parmp) {
hFreelanceSymlinkChangeEvent = 0;
return;
}
cm_noteLocalMountPointChange();
cm_noteLocalMountPointChange(FALSE);
}
}
}
@ -358,10 +358,12 @@ int cm_FakeRootFid(cm_fid_t *fidp)
/* called directly from ioctl */
/* called while not holding freelance lock */
int cm_noteLocalMountPointChange(void) {
int cm_noteLocalMountPointChange(afs_int32 locked) {
if (!locked)
lock_ObtainMutex(&cm_Freelance_Lock);
cm_data.fakeDirVersion++;
cm_localMountPointChangeFlag = 1;
if (!locked)
lock_ReleaseMutex(&cm_Freelance_Lock);
return 1;
}

View File

@ -14,7 +14,7 @@ extern int cm_getLocalMountPointChange();
extern int cm_reInitLocalMountPoints();
extern void cm_InitFreelance();
extern void cm_FreelanceShutdown(void);
extern int cm_noteLocalMountPointChange(void);
extern int cm_noteLocalMountPointChange(afs_int32 locked);
extern long cm_FreelanceRemoveMount(char *toremove);
extern long cm_FreelanceAddMount(char *filename, char *cellname, char *volume, int rw, cm_fid_t *fidp);
extern long cm_FreelanceRemoveSymlink(char *toremove);

View File

@ -95,7 +95,7 @@ cm_FlushFile(cm_scache_t *scp, cm_user_t *userp, cm_req_t *reqp)
#ifdef AFS_FREELANCE_CLIENT
if ( scp->fid.cell == AFS_FAKE_ROOT_CELL_ID && scp->fid.volume == AFS_FAKE_ROOT_VOL_ID ) {
cm_noteLocalMountPointChange();
cm_noteLocalMountPointChange(FALSE);
return 0;
}
#endif
@ -148,7 +148,7 @@ cm_FlushVolume(cm_user_t *userp, cm_req_t *reqp, afs_uint32 cell, afs_uint32 vol
#ifdef AFS_FREELANCE_CLIENT
if ( cell == AFS_FAKE_ROOT_CELL_ID && volume == AFS_FAKE_ROOT_VOL_ID ) {
cm_noteLocalMountPointChange();
cm_noteLocalMountPointChange(FALSE);
return 0;
}
#endif

View File

@ -4075,7 +4075,7 @@ void smb_Daemon(void *parmp)
#ifdef AFS_FREELANCE
if ( smb_localZero != old_localZero )
cm_noteLocalMountPointChange();
cm_noteLocalMountPointChange(FALSE);
#endif
smb_CheckVCs();
@ -10661,7 +10661,7 @@ void smb_Init(osi_log_t *logp, int useV3,
#ifdef AFS_FREELANCE_CLIENT
/* Make sure the root.afs volume has the correct time */
cm_noteLocalMountPointChange();
cm_noteLocalMountPointChange(FALSE);
#endif
/* initialize the remote debugging log */