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>
hFreelanceChangeEvent = 0;
return;
}
- cm_noteLocalMountPointChange();
+ cm_noteLocalMountPointChange(FALSE);
}
}
}
hFreelanceSymlinkChangeEvent = 0;
return;
}
- cm_noteLocalMountPointChange();
+ cm_noteLocalMountPointChange(FALSE);
}
}
}
/* called directly from ioctl */
/* called while not holding freelance lock */
-int cm_noteLocalMountPointChange(void) {
- lock_ObtainMutex(&cm_Freelance_Lock);
+int cm_noteLocalMountPointChange(afs_int32 locked) {
+ if (!locked)
+ lock_ObtainMutex(&cm_Freelance_Lock);
cm_data.fakeDirVersion++;
cm_localMountPointChangeFlag = 1;
- lock_ReleaseMutex(&cm_Freelance_Lock);
+ if (!locked)
+ lock_ReleaseMutex(&cm_Freelance_Lock);
return 1;
}
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);
#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
#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
#ifdef AFS_FREELANCE
if ( smb_localZero != old_localZero )
- cm_noteLocalMountPointChange();
+ cm_noteLocalMountPointChange(FALSE);
#endif
smb_CheckVCs();
#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 */