Windows: cm_scache flags missing interlocked ops
authorJeffrey Altman <jaltman@your-file-system.com>
Wed, 19 Jun 2013 17:52:51 +0000 (13:52 -0400)
committerJeffrey Altman <jaltman@your-file-system.com>
Fri, 21 Jun 2013 17:48:23 +0000 (10:48 -0700)
A small number of |= operations on the cm_scache.flags field were
not converted to _InterlockedOr.  Do so now.

Change-Id: Iebd361d53e46527bf3ffa0d20d006a5e90ab4967
Reviewed-on: http://gerrit.openafs.org/9993
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

src/WINNT/afsd/cm_scache.c

index e63005f..8ecb754 100644 (file)
@@ -899,7 +899,7 @@ long cm_GetSCache(cm_fid_t *fidp, cm_fid_t *parentFidp, cm_scache_t **outScpp, c
         if (!cellp) {
             /* put back newScp so it can be reused */
             lock_ObtainWrite(&cm_scacheLock);
-            newScp->flags |= CM_SCACHEFLAG_DELETED;
+           _InterlockedOr(&newScp->flags, CM_SCACHEFLAG_DELETED);
             cm_AdjustScacheLRU(newScp);
             lock_ReleaseWrite(&newScp->rw);
             lock_ReleaseWrite(&cm_scacheLock);
@@ -910,7 +910,7 @@ long cm_GetSCache(cm_fid_t *fidp, cm_fid_t *parentFidp, cm_scache_t **outScpp, c
         if (code) {
             /* put back newScp so it can be reused */
             lock_ObtainWrite(&cm_scacheLock);
-            newScp->flags |= CM_SCACHEFLAG_DELETED;
+           _InterlockedOr(&newScp->flags, CM_SCACHEFLAG_DELETED);
             cm_AdjustScacheLRU(newScp);
             lock_ReleaseWrite(&newScp->rw);
             lock_ReleaseWrite(&cm_scacheLock);
@@ -941,7 +941,7 @@ long cm_GetSCache(cm_fid_t *fidp, cm_fid_t *parentFidp, cm_scache_t **outScpp, c
             cm_AdjustScacheLRU(scp);
 
             /* put back newScp so it can be reused */
-            newScp->flags |= CM_SCACHEFLAG_DELETED;
+           _InterlockedOr(&newScp->flags, CM_SCACHEFLAG_DELETED);
             cm_AdjustScacheLRU(newScp);
             lock_ReleaseWrite(&newScp->rw);
             lock_ReleaseWrite(&cm_scacheLock);