windows-smb_dir_watch_lock-20081003
authorJeffrey Altman <jaltman@secure-endpoints.com>
Thu, 2 Oct 2008 13:12:23 +0000 (13:12 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Thu, 2 Oct 2008 13:12:23 +0000 (13:12 +0000)
LICENSE MIT

re-order the lock hierarchyfor smb_Dir_Watch_Lock so that the
lock does not have to be dropped when sending notifications
within smb_NotifyChange().

src/WINNT/afsd/cm.h
src/WINNT/afsd/smb3.c

index 5abf1d6..5ce70a9 100644 (file)
 
 #define LOCK_HIERARCHY_IGNORE                    0
 
-#define LOCK_HIERARCHY_SMB_STARTED              30
-#define LOCK_HIERARCHY_SMB_LISTENER             35
-#define LOCK_HIERARCHY_SMB_GLOBAL               40
-#define LOCK_HIERARCHY_SMB_DIRSEARCH            50
-#define LOCK_HIERARCHY_SMB_FID                  60
-#define LOCK_HIERARCHY_SMB_TID                  70
-#define LOCK_HIERARCHY_SMB_UID                  80
+#define LOCK_HIERARCHY_SMB_STARTED              20
+#define LOCK_HIERARCHY_SMB_LISTENER             30
+#define LOCK_HIERARCHY_SMB_DIRWATCH             40
+#define LOCK_HIERARCHY_SMB_GLOBAL               50
+#define LOCK_HIERARCHY_SMB_DIRSEARCH            60
+#define LOCK_HIERARCHY_SMB_FID                  70
+#define LOCK_HIERARCHY_SMB_TID                  80
+#define LOCK_HIERARCHY_SMB_UID                  90
 #define LOCK_HIERARCHY_SMB_RAWBUF              100
-#define LOCK_HIERARCHY_SMB_DIRWATCH            105
 #define LOCK_HIERARCHY_SMB_RCT_GLOBAL          110
 #define LOCK_HIERARCHY_SMB_USERNAME            115
 #define LOCK_HIERARCHY_SMB_VC                  120
index b10918b..7c8a317 100644 (file)
@@ -8548,9 +8548,7 @@ void smb_NotifyChange(DWORD action, DWORD notifyFilter,
             osi_Log1(smb_logp," skipping fidp->scp[%x]", fidp->scp);
             lastWatch = watch;
             watch = watch->nextp;
-            lock_ReleaseMutex(&smb_Dir_Watch_Lock);
             smb_ReleaseFID(fidp);
-            lock_ObtainMutex(&smb_Dir_Watch_Lock);
             continue;
         }
 
@@ -8589,9 +8587,6 @@ void smb_NotifyChange(DWORD action, DWORD notifyFilter,
         else
             lastWatch->nextp = nextWatch;
 
-        /* The watch is off the list, its ours now, safe to drop the lock */
-        lock_ReleaseMutex(&smb_Dir_Watch_Lock);
-
         /* Turn off WATCHED flag in dscp */
         lock_ObtainWrite(&dscp->rw);
         if (wtree)
@@ -8694,7 +8689,6 @@ void smb_NotifyChange(DWORD action, DWORD notifyFilter,
         smb_FreePacket(watch);
 
         smb_ReleaseFID(fidp);
-        lock_ObtainMutex(&smb_Dir_Watch_Lock);
         watch = nextWatch;
     }
     lock_ReleaseMutex(&smb_Dir_Watch_Lock);