]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
DEVEL15-windows-smb_dir_watch_lock-20081003
authorJeffrey Altman <jaltman@secure-endpoints.com>
Thu, 2 Oct 2008 13:14:02 +0000 (13:14 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Thu, 2 Oct 2008 13:14:02 +0000 (13:14 +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().

(cherry picked from commit 38800039a7039c3fa832718799667557a5e24f66)

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

index 5abf1d6aa9efe17e4d7731541a16ce0847fd9f8d..5ce70a99b38a3325e2b3ed7569bb5e4cff92de87 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 b10918bfcc0348c836942e5de6b4274291fb9553..7c8a31757ce43f2bf7deecb8bb72de5b0e73ab38 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);