Windows: CM_SCACHEFLAG_DELETED use InterlockedOr
authorJeffrey Altman <jaltman@your-file-system.com>
Fri, 16 Aug 2013 16:01:02 +0000 (12:01 -0400)
committerJeffrey Altman <jaltman@your-file-system.com>
Wed, 21 Aug 2013 03:27:16 +0000 (20:27 -0700)
When setting CM_SCACHEFLAG_DELETED use InterlockedOr.

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

src/WINNT/afsd/cm_conn.c
src/WINNT/afsd/cm_vnodeops.c

index e14ac05..0f75e97 100644 (file)
@@ -866,7 +866,7 @@ cm_Analyze(cm_conn_t *connp,
                    pscp = cm_FindSCacheParent(scp);
 
                lock_ObtainWrite(&scp->rw);
-               scp->flags |= CM_SCACHEFLAG_DELETED;
+               _InterlockedOr(&scp->flags, CM_SCACHEFLAG_DELETED);
                lock_ObtainWrite(&cm_scacheLock);
                 cm_AdjustScacheLRU(scp);
                 cm_RemoveSCacheFromHashTable(scp);
index 7e8422c..62863ba 100644 (file)
@@ -1744,7 +1744,7 @@ long cm_Unlink(cm_scache_t *dscp, fschar_t *fnamep, clientchar_t * cnamep,
         if (code == 0) {
            lock_ObtainWrite(&scp->rw);
             if (--scp->linkCount == 0) {
-                scp->flags |= CM_SCACHEFLAG_DELETED;
+               _InterlockedOr(&scp->flags, CM_SCACHEFLAG_DELETED);
                lock_ObtainWrite(&cm_scacheLock);
                 cm_AdjustScacheLRU(scp);
                 cm_RemoveSCacheFromHashTable(scp);
@@ -3751,7 +3751,7 @@ long cm_RemoveDir(cm_scache_t *dscp, fschar_t *fnamep, clientchar_t *cnamep, cm_
     if (scp) {
         if (code == 0) {
            lock_ObtainWrite(&scp->rw);
-            scp->flags |= CM_SCACHEFLAG_DELETED;
+           _InterlockedOr(&scp->flags, CM_SCACHEFLAG_DELETED);
             lock_ObtainWrite(&cm_scacheLock);
             cm_AdjustScacheLRU(scp);
             cm_RemoveSCacheFromHashTable(scp);