]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
STABLE14-tasklist-lock-redux-20060922
authorJeffrey Hutzelman <jhutz@cmu.edu>
Fri, 22 Sep 2006 12:20:34 +0000 (12:20 +0000)
committerDerrick Brashear <shadow@dementia.org>
Fri, 22 Sep 2006 12:20:34 +0000 (12:20 +0000)
try tasklist_lock weak binding in osi_probe

if no tasklist_lock, fall back to rcu locking

(cherry picked from commit 928ad0445e91ecbfcd32a26e8c17b90ee0d83700)

src/afs/LINUX/osi_probe.c
src/afs/afs_osi.c
src/rx/LINUX/rx_knet.c

index 3b30fdd61ad5237694300d8d3e27fa1d997e2ef2..20acb39e103bf45935fbc212339bf604810ce413 100644 (file)
@@ -245,6 +245,7 @@ extern asmlinkage long sys_exit (int) __attribute__((weak));
 extern asmlinkage long sys_open (const char *, int, int) __attribute__((weak));
 #endif
 extern asmlinkage long sys_ioctl(unsigned int, unsigned int, unsigned long) __attribute__((weak));
+extern rwlock_t tasklist_lock __attribute__((weak));
 
 
 /* Structures used to control probing.  We put all the details of which
index 4fb69dad0a6abb5dcad4e836ee20166167305f73..a36729a2446d2ab20e7eae3f54d6fbcdb35660e0 100644 (file)
@@ -812,6 +812,11 @@ afs_osi_TraverseProcTable()
     struct task_struct *p;
     if (&tasklist_lock)
        read_lock(&tasklist_lock);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
+    else
+       rcu_read_lock();
+#endif
+
 #ifdef DEFINED_FOR_EACH_PROCESS
     for_each_process(p) if (p->pid) {
 #ifdef STRUCT_TASK_STRUCT_HAS_EXIT_STATE
@@ -837,6 +842,10 @@ afs_osi_TraverseProcTable()
 #endif
     if (&tasklist_lock)
        read_unlock(&tasklist_lock);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
+    else
+       rcu_read_unlock();
+#endif
 }
 #endif
 
index b0b7d9c0654ea22b5f326e8d38d13eb4feb9fcdf..4e176f65980fac12f50b3de9fc8c07fe3ddf9927 100644 (file)
@@ -209,9 +209,17 @@ osi_StopListener(void)
 
     if (&tasklist_lock)
       read_lock(&tasklist_lock);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
+    else
+      rcu_read_lock();
+#endif
     listener = find_task_by_pid(rxk_ListenerPid);
     if (&tasklist_lock)
        read_unlock(&tasklist_lock);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
+    else
+      rcu_read_unlock();
+#endif
     while (rxk_ListenerPid) {
        flush_signals(listener);
        force_sig(SIGKILL, listener);