Windows: More interlocked ops for cm_cell flags

Change-Id: I9e5cae6152439af75a9baf85900117ca9b456f40
Reviewed-on: http://gerrit.openafs.org/5274
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
This commit is contained in:
Jeffrey Altman 2011-08-14 21:41:47 -04:00 committed by Jeffrey Altman
parent f752142827
commit 73b91bf0c0

View File

@ -1530,8 +1530,8 @@ cm_IoctlNewCell(struct cm_ioctl *ioctlp, struct cm_user *userp)
code = cm_SearchCellByDNS(cp->name, cp->name, &ttl, cm_AddCellProc, &rock);
if ( code == 0 ) { /* got cell from DNS */
lock_ObtainMutex(&cp->mx);
cp->flags |= CM_CELLFLAG_DNS;
cp->flags &= ~CM_CELLFLAG_VLSERVER_INVALID;
_InterlockedOr(&cp->flags, CM_CELLFLAG_DNS);
_InterlockedAnd(&cp->flags, ~CM_CELLFLAG_VLSERVER_INVALID);
cp->timeout = time(0) + ttl;
lock_ReleaseMutex(&cp->mx);
}
@ -1539,18 +1539,18 @@ cm_IoctlNewCell(struct cm_ioctl *ioctlp, struct cm_user *userp)
}
else {
lock_ObtainMutex(&cp->mx);
cp->flags &= ~CM_CELLFLAG_DNS;
_InterlockedAnd(&cp->flags, ~CM_CELLFLAG_DNS);
lock_ReleaseMutex(&cp->mx);
}
if (code) {
lock_ObtainMutex(&cp->mx);
cp->flags |= CM_CELLFLAG_VLSERVER_INVALID;
_InterlockedOr(&cp->flags, CM_CELLFLAG_VLSERVER_INVALID);
lock_ReleaseMutex(&cp->mx);
lock_ObtainWrite(&cm_cellLock);
}
else {
lock_ObtainMutex(&cp->mx);
cp->flags &= ~CM_CELLFLAG_VLSERVER_INVALID;
_InterlockedAnd(&cp->flags, ~CM_CELLFLAG_VLSERVER_INVALID);
lock_ReleaseMutex(&cp->mx);
lock_ObtainWrite(&cm_cellLock);
cm_RandomizeServer(&cp->vlServersp);
@ -1830,9 +1830,9 @@ cm_IoctlSetCellStatus(struct cm_ioctl *ioctlp, struct cm_user *userp)
lock_ObtainMutex(&cellp->mx);
if (flags & CM_SETCELLFLAG_SUID)
cellp->flags |= CM_CELLFLAG_SUID;
_InterlockedOr(&cellp->flags, CM_CELLFLAG_SUID);
else
cellp->flags &= ~CM_CELLFLAG_SUID;
_InterlockedAnd(&cellp->flags, ~CM_CELLFLAG_SUID);
lock_ReleaseMutex(&cellp->mx);
return 0;