printk: do not handle non-sleepable notification in console_cpu_notify
[linux-2.6.git] / kernel / padata.c
index 4987203..b91941d 100644 (file)
@@ -262,7 +262,7 @@ static void padata_reorder(struct parallel_data *pd)
                /*
                 * This cpu has to do the parallel processing of the next
                 * object. It's waiting in the cpu's parallelization queue,
-                * so exit imediately.
+                * so exit immediately.
                 */
                if (PTR_ERR(padata) == -ENODATA) {
                        del_timer(&pd->timer);
@@ -284,7 +284,7 @@ static void padata_reorder(struct parallel_data *pd)
        /*
         * The next object that needs serialization might have arrived to
         * the reorder queues in the meantime, we will be called again
-        * from the timer function if noone else cares for it.
+        * from the timer function if no one else cares for it.
         */
        if (atomic_read(&pd->reorder_objects)
                        && !(pinst->flags & PADATA_RESET))
@@ -515,7 +515,7 @@ static void __padata_stop(struct padata_instance *pinst)
        put_online_cpus();
 }
 
-/* Replace the internal control stucture with a new one. */
+/* Replace the internal control structure with a new one. */
 static void padata_replace(struct padata_instance *pinst,
                           struct parallel_data *pd_new)
 {
@@ -538,7 +538,8 @@ static void padata_replace(struct padata_instance *pinst,
 
        if (notification_mask)
                blocking_notifier_call_chain(&pinst->cpumask_change_notifier,
-                                            notification_mask, pinst);
+                                            notification_mask,
+                                            &pd_new->cpumask);
 
        pinst->flags &= ~PADATA_RESET;
 }
@@ -588,41 +589,6 @@ static bool padata_validate_cpumask(struct padata_instance *pinst,
        return true;
 }
 
-/**
- * padata_get_cpumask: Fetch serial or parallel cpumask from the
- *                     given padata instance and copy it to @out_mask
- *
- * @pinst: A pointer to padata instance
- * @cpumask_type: Specifies which cpumask will be copied.
- *                Possible values are PADATA_CPU_SERIAL *or* PADATA_CPU_PARALLEL
- *                corresponding to serial and parallel cpumask respectively.
- * @out_mask: A pointer to cpumask structure where selected
- *            cpumask will be copied.
- */
-int padata_get_cpumask(struct padata_instance *pinst,
-                      int cpumask_type, struct cpumask *out_mask)
-{
-       struct parallel_data *pd;
-       int ret = 0;
-
-       rcu_read_lock_bh();
-       pd = rcu_dereference(pinst->pd);
-       switch (cpumask_type) {
-       case PADATA_CPU_SERIAL:
-               cpumask_copy(out_mask, pd->cpumask.cbcpu);
-               break;
-       case PADATA_CPU_PARALLEL:
-               cpumask_copy(out_mask, pd->cpumask.pcpu);
-               break;
-       default:
-               ret = -EINVAL;
-       }
-
-       rcu_read_unlock_bh();
-       return ret;
-}
-EXPORT_SYMBOL(padata_get_cpumask);
-
 static int __padata_set_cpumasks(struct padata_instance *pinst,
                                 cpumask_var_t pcpumask,
                                 cpumask_var_t cbcpumask)
@@ -802,7 +768,7 @@ static int __padata_remove_cpu(struct padata_instance *pinst, int cpu)
 }
 
  /**
- * padata_remove_cpu - remove a cpu from the one or both(serial and paralell)
+ * padata_remove_cpu - remove a cpu from the one or both(serial and parallel)
  *                     padata cpumasks.
  *
  * @pinst: padata instance
@@ -898,7 +864,7 @@ static int padata_cpu_callback(struct notifier_block *nfb,
                err = __padata_add_cpu(pinst, cpu);
                mutex_unlock(&pinst->lock);
                if (err)
-                       return NOTIFY_BAD;
+                       return notifier_from_errno(err);
                break;
 
        case CPU_DOWN_PREPARE:
@@ -909,7 +875,7 @@ static int padata_cpu_callback(struct notifier_block *nfb,
                err = __padata_remove_cpu(pinst, cpu);
                mutex_unlock(&pinst->lock);
                if (err)
-                       return NOTIFY_BAD;
+                       return notifier_from_errno(err);
                break;
 
        case CPU_UP_CANCELED: