[Pkg-voip-commits] r3444 - in openser/trunk/debian: . patches
Julien Blache
jblache at alioth.debian.org
Sun Apr 22 13:19:20 UTC 2007
Author: jblache
Date: 2007-04-22 13:19:20 +0000 (Sun, 22 Apr 2007)
New Revision: 3444
Added:
openser/trunk/debian/patches/20_usrloc_lockset_fixes.dpatch
Modified:
openser/trunk/debian/changelog
openser/trunk/debian/patches/00list
Log:
Fix the usrloc module when not using fast locks.
Modified: openser/trunk/debian/changelog
===================================================================
--- openser/trunk/debian/changelog 2007-04-21 09:45:20 UTC (rev 3443)
+++ openser/trunk/debian/changelog 2007-04-22 13:19:20 UTC (rev 3444)
@@ -1,8 +1,9 @@
-openser (1.2.0-3) UNRELEASED; urgency=low
+openser (1.2.0-3) unstable; urgency=low
- * NOT RELEASED YET
+ * debian/patches/20_usrloc_lockset_fixes.dpatch:
+ + Added; fix the usrloc module when not using fast locks.
- -- Julien BLACHE <jblache at debian.org> Sat, 21 Apr 2007 11:44:59 +0200
+ -- Julien BLACHE <jblache at debian.org> Sun, 22 Apr 2007 15:18:25 +0200
openser (1.2.0-2) unstable; urgency=low
Modified: openser/trunk/debian/patches/00list
===================================================================
--- openser/trunk/debian/patches/00list 2007-04-21 09:45:20 UTC (rev 3443)
+++ openser/trunk/debian/patches/00list 2007-04-22 13:19:20 UTC (rev 3444)
@@ -1,3 +1,4 @@
10_no_lib64_on_64_bits
11_always_smp
+20_usrloc_lockset_fixes
Added: openser/trunk/debian/patches/20_usrloc_lockset_fixes.dpatch
===================================================================
--- openser/trunk/debian/patches/20_usrloc_lockset_fixes.dpatch 2007-04-21 09:45:20 UTC (rev 3443)
+++ openser/trunk/debian/patches/20_usrloc_lockset_fixes.dpatch 2007-04-22 13:19:20 UTC (rev 3444)
@@ -0,0 +1,133 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 20_usrloc_lockset_fixes.dpatch by <jblache at debian.org>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Fix the usrloc module when not using fast locks.
+
+ at DPATCH@
+diff -urNad openser-1.2.0~/modules/usrloc/hslot.c openser-1.2.0/modules/usrloc/hslot.c
+--- openser-1.2.0~/modules/usrloc/hslot.c 2007-04-22 15:11:25.000000000 +0200
++++ openser-1.2.0/modules/usrloc/hslot.c 2007-04-22 15:16:57.340479180 +0200
+@@ -40,7 +40,8 @@
+ (lock_set_init(ul_locks)!=0))
+ {
+ ul_locks_no = i;
+- LOG(L_INFO, "INFO:ul_init_locks: locks array size %d\n", ul_locks_no);
++ LOG(L_INFO, "INFO:ul_init_locks: locks array size %d\n",
++ ul_locks_no);
+ return 0;
+
+ }
+@@ -65,6 +66,18 @@
+ };
+ }
+
++#ifndef GEN_LOCK_T_PREFERED
++void ul_lock_idx(int idx)
++{
++ lock_set_get(ul_locks, idx);
++}
++
++void ul_release_idx(int idx)
++{
++ lock_set_release(ul_locks, idx);
++}
++#endif
++
+ /*
+ * Initialize cache slot structure
+ */
+@@ -74,7 +87,12 @@
+ _s->first = 0;
+ _s->last = 0;
+ _s->d = _d;
++
++#ifdef GEN_LOCK_T_PREFERED
+ _s->lock = &ul_locks->locks[n%ul_locks_no];
++#else
++ _s->lockidx = n%ul_locks_no;
++#endif
+ return 0;
+ }
+
+diff -urNad openser-1.2.0~/modules/usrloc/hslot.h openser-1.2.0/modules/usrloc/hslot.h
+--- openser-1.2.0~/modules/usrloc/hslot.h 2007-03-12 16:22:54.000000000 +0100
++++ openser-1.2.0/modules/usrloc/hslot.h 2007-04-22 15:16:57.339479086 +0200
+@@ -41,10 +41,13 @@
+ struct urecord* first; /* First element in the list */
+ struct urecord* last; /* Last element in the list */
+ struct udomain* d; /* Domain we belong to */
+- gen_lock_t *lock; /* Lock for hash entry */
++#ifdef GEN_LOCK_T_PREFERED
++ gen_lock_t *lock; /* Lock for hash entry - fastlock */
++#else
++ int lockidx; /* Lock index for hash entry - the rest*/
++#endif
+ } hslot_t;
+
+-
+ /*
+ * Initialize slot structure
+ */
+@@ -71,4 +74,9 @@
+ int ul_init_locks();
+ void ul_destroy_locks();
+
++#ifndef GEN_LOCK_T_PREFERED
++void ul_lock_idx(int idx);
++void ul_release_idx(int idx);
++#endif
++
+ #endif /* HSLOT_H */
+diff -urNad openser-1.2.0~/modules/usrloc/udomain.c openser-1.2.0/modules/usrloc/udomain.c
+--- openser-1.2.0~/modules/usrloc/udomain.c 2007-04-22 15:11:28.000000000 +0200
++++ openser-1.2.0/modules/usrloc/udomain.c 2007-04-22 15:16:57.341479273 +0200
+@@ -729,7 +729,12 @@
+ if (db_mode!=DB_ONLY)
+ {
+ sl = core_hash(_aor, 0, _d->size);
++
++#ifdef GEN_LOCK_T_PREFERED
+ lock_get(_d->table[sl].lock);
++#else
++ ul_lock_idx(_d->table[sl].lockidx);
++#endif
+ }
+ }
+
+@@ -743,7 +748,11 @@
+ if (db_mode!=DB_ONLY)
+ {
+ sl = core_hash(_aor, 0, _d->size);
++#ifdef GEN_LOCK_T_PREFERED
+ lock_release(_d->table[sl].lock);
++#else
++ ul_release_idx(_d->table[sl].lockidx);
++#endif
+ }
+ }
+
+@@ -753,7 +762,11 @@
+ void lock_ulslot(udomain_t* _d, int i)
+ {
+ if (db_mode!=DB_ONLY)
++#ifdef GEN_LOCK_T_PREFERED
+ lock_get(_d->table[i].lock);
++#else
++ ul_lock_idx(_d->table[i].lockidx);
++#endif
+ }
+
+
+@@ -763,7 +776,11 @@
+ void unlock_ulslot(udomain_t* _d, int i)
+ {
+ if (db_mode!=DB_ONLY)
++#ifdef GEN_LOCK_T_PREFERED
+ lock_release(_d->table[i].lock);
++#else
++ ul_release_idx(_d->table[i].lockidx);
++#endif
+ }
+
+
Property changes on: openser/trunk/debian/patches/20_usrloc_lockset_fixes.dpatch
___________________________________________________________________
Name: svn:executable
+ *
More information about the Pkg-voip-commits
mailing list