[zaptel-commits] russell: branch 1.2 r3663 - /branches/1.2/zaptel-base.c

SVN commits to the Zaptel project zaptel-commits at lists.digium.com
Fri Jan 11 14:38:48 CST 2008


Author: russell
Date: Fri Jan 11 14:38:47 2008
New Revision: 3663

URL: http://svn.digium.com/view/zaptel?view=rev&rev=3663
Log:
Revert an unnecessary trylock.  Multiple people have looked at this and nobody
can see any reason why this would be required.

(closes issue #10791)
Reported by: Matti
Patches:
      patch uploaded by Matti (license 109)

Modified:
    branches/1.2/zaptel-base.c

Modified: branches/1.2/zaptel-base.c
URL: http://svn.digium.com/view/zaptel/branches/1.2/zaptel-base.c?view=diff&rev=3663&r1=3662&r2=3663
==============================================================================
--- branches/1.2/zaptel-base.c (original)
+++ branches/1.2/zaptel-base.c Fri Jan 11 14:38:47 2008
@@ -1136,19 +1136,7 @@
 	if ((zone >= ZT_TONE_ZONE_MAX) || (zone < -1))
 		return -EINVAL;
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,11)
-	/* Since this routine is called both from IRQ as well as from userspace,
-	 * it is possible that we could be called during an IRQ while userspace
-	 * has locked this.  However unlikely, this could possibly cause a
-	 * deadlock. */
-	if (! read_trylock(&zone_lock))
-		return -EWOULDBLOCK;
-#else
-	/* But there are no trylock macros for kernel versions before 2.6.11,
-	 * so we do the unsafe thing anyway.  Such is the problem for dealing
-	 * with old, buggy kernels. */
 	read_lock(&zone_lock);
-#endif
 
 	if (zone == -1) {
 		zone = default_zone;
@@ -1162,6 +1150,7 @@
 	}
 
 	read_unlock(&zone_lock);
+
 	return res;
 }
 




More information about the zaptel-commits mailing list