Fedora kernel-2.6.17-1.2142_FC4 patched with stable patch-2.6.17.4-vs2.0.2-rc26.diff
[linux-2.6.git] / lib / kernel_lock.c
index 99b0ae3..cb5490e 100644 (file)
@@ -9,61 +9,6 @@
 #include <linux/module.h>
 #include <linux/kallsyms.h>
 
-#if defined(CONFIG_PREEMPT) && defined(__smp_processor_id) && \
-               defined(CONFIG_DEBUG_PREEMPT)
-
-/*
- * Debugging check.
- */
-unsigned int smp_processor_id(void)
-{
-       unsigned long preempt_count = preempt_count();
-       int this_cpu = __smp_processor_id();
-       cpumask_t this_mask;
-
-       if (likely(preempt_count))
-               goto out;
-
-       if (irqs_disabled())
-               goto out;
-
-       /*
-        * Kernel threads bound to a single CPU can safely use
-        * smp_processor_id():
-        */
-       this_mask = cpumask_of_cpu(this_cpu);
-
-       if (cpus_equal(current->cpus_allowed, this_mask))
-               goto out;
-
-       /*
-        * It is valid to assume CPU-locality during early bootup:
-        */
-       if (system_state != SYSTEM_RUNNING)
-               goto out;
-
-       /*
-        * Avoid recursion:
-        */
-       preempt_disable();
-
-       if (!printk_ratelimit())
-               goto out_enable;
-
-       printk(KERN_ERR "BUG: using smp_processor_id() in preemptible [%08x] code: %s/%d\n", preempt_count(), current->comm, current->pid);
-       print_symbol("caller is %s\n", (long)__builtin_return_address(0));
-       dump_stack();
-
-out_enable:
-       preempt_enable_no_resched();
-out:
-       return this_cpu;
-}
-
-EXPORT_SYMBOL(smp_processor_id);
-
-#endif /* PREEMPT && __smp_processor_id && DEBUG_PREEMPT */
-
 #ifdef CONFIG_PREEMPT_BKL
 /*
  * The 'big kernel semaphore'
@@ -232,8 +177,7 @@ static inline void __lock_kernel(void)
 
 static inline void __unlock_kernel(void)
 {
-       _raw_spin_unlock(&kernel_flag);
-       preempt_enable();
+       spin_unlock(&kernel_flag);
 }
 
 /*