]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
Windows: More interlocked ops for cm_cell flags
authorJeffrey Altman <jaltman@your-file-system.com>
Mon, 15 Aug 2011 01:41:47 +0000 (21:41 -0400)
committerJeffrey Altman <jaltman@openafs.org>
Mon, 15 Aug 2011 04:03:29 +0000 (21:03 -0700)
Reviewed-on: http://gerrit.openafs.org/5274
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
(cherry picked from commit 73b91bf0c0a86e55d6879573aeadd99a137ebf3b)

Change-Id: I0d79599b22c50523f975d51de4fe2a9eb07c1fdb
Reviewed-on: http://gerrit.openafs.org/5276
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
src/WINNT/afsd/cm_ioctl.c

index d2c61f7b7f46d4be73643065fd0e060880b96ffb..afdcd79e190d1651e583b4e89e2bbf36614cbf8a 100644 (file)
@@ -1527,8 +1527,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);
                 }
@@ -1536,18 +1536,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);
@@ -1827,9 +1827,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;