Windows: Interlocked ops for cm_user flags
authorJeffrey Altman <jaltman@your-file-system.com>
Mon, 15 Aug 2011 01:41:19 +0000 (21:41 -0400)
committerJeffrey Altman <jaltman@openafs.org>
Mon, 15 Aug 2011 02:39:07 +0000 (19:39 -0700)
Change-Id: I64932b0d15b439614b6bbba0ba875eacb1260832
Reviewed-on: http://gerrit.openafs.org/5273
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

src/WINNT/afsd/cm_conn.c
src/WINNT/afsd/cm_ioctl.c
src/WINNT/afsd/cm_user.c
src/WINNT/afsd/smb_ioctl.c

index 49e5fc6..9f372b6 100644 (file)
@@ -820,7 +820,7 @@ cm_Analyze(cm_conn_t *connp, cm_user_t *userp, cm_req_t *reqp,
                 free(ucellp->ticketp);
                 ucellp->ticketp = NULL;
             }
-            ucellp->flags &= ~CM_UCELLFLAG_RXKAD;
+            _InterlockedAnd(&ucellp->flags, ~CM_UCELLFLAG_RXKAD);
             ucellp->gen++;
             lock_ReleaseMutex(&userp->mx);
             if ( timeLeft > 2 )
index 1be9356..959200e 100644 (file)
@@ -2565,7 +2565,7 @@ cm_IoctlSetToken(struct cm_ioctl *ioctlp, struct cm_user *userp)
        cm_UsernameToId(uname, ucellp, &ucellp->uid);
 #endif
     }
-    ucellp->flags |= CM_UCELLFLAG_RXKAD;
+    _InterlockedOr(&ucellp->flags, CM_UCELLFLAG_RXKAD);
     lock_ReleaseMutex(&userp->mx);
 
     if (flags & PIOCTL_LOGON) {
@@ -2790,7 +2790,7 @@ cm_IoctlDelToken(struct cm_ioctl *ioctlp, struct cm_user *userp)
     ucellp->kvno = 0;
     ucellp->expirationTime = 0;
     ucellp->userName[0] = '\0';
-    ucellp->flags &= ~CM_UCELLFLAG_RXKAD;
+    _InterlockedAnd(&ucellp->flags, ~CM_UCELLFLAG_RXKAD);
     ucellp->gen++;
 
     lock_ReleaseMutex(&userp->mx);
@@ -2824,7 +2824,7 @@ cm_IoctlDelAllToken(struct cm_ioctl *ioctlp, struct cm_user *userp)
        ucellp->kvno = 0;
        ucellp->expirationTime = 0;
        ucellp->userName[0] = '\0';
-        ucellp->flags &= ~CM_UCELLFLAG_RXKAD;
+        _InterlockedAnd(&ucellp->flags, ~CM_UCELLFLAG_RXKAD);
         ucellp->gen++;
     }
 
index 7334505..6767b58 100644 (file)
@@ -184,7 +184,7 @@ void cm_CheckTokenCache(time_t now)
                             free(ucellp->ticketp);
                             ucellp->ticketp = NULL;
                         }
-                        ucellp->flags &= ~CM_UCELLFLAG_RXKAD;
+                        _InterlockedAnd(&ucellp->flags, ~CM_UCELLFLAG_RXKAD);
                         ucellp->gen++;
                         bExpired=TRUE;
                     }
index c225574..3dc9752 100644 (file)
@@ -1198,7 +1198,7 @@ smb_IoctlSetToken(struct smb_ioctl *ioctlp, struct cm_user *userp, afs_uint32 pf
        cm_UsernameToId(uname, ucellp, &ucellp->uid);
 #endif
     }
-    ucellp->flags |= CM_UCELLFLAG_RXKAD;
+    _InterlockedOr(&ucellp->flags, CM_UCELLFLAG_RXKAD);
     lock_ReleaseMutex(&userp->mx);
 
     if ((pflags & AFSCALL_FLAG_LOCAL_SYSTEM) && (flags & PIOCTL_LOGON)) {