qdisc: allow setting default queuing discipline
[cascardo/linux.git] / net / sched / sch_generic.c
index 48be3d5..5078e0c 100644 (file)
@@ -530,7 +530,6 @@ struct Qdisc_ops pfifo_fast_ops __read_mostly = {
        .dump           =       pfifo_fast_dump,
        .owner          =       THIS_MODULE,
 };
-EXPORT_SYMBOL(pfifo_fast_ops);
 
 static struct lock_class_key qdisc_tx_busylock;
 
@@ -583,6 +582,9 @@ struct Qdisc *qdisc_create_dflt(struct netdev_queue *dev_queue,
 {
        struct Qdisc *sch;
 
+       if (!try_module_get(ops->owner))
+               goto errout;
+
        sch = qdisc_alloc(dev_queue, ops);
        if (IS_ERR(sch))
                goto errout;
@@ -686,7 +688,7 @@ static void attach_one_default_qdisc(struct net_device *dev,
 
        if (dev->tx_queue_len) {
                qdisc = qdisc_create_dflt(dev_queue,
-                                         &pfifo_fast_ops, TC_H_ROOT);
+                                         default_qdisc_ops, TC_H_ROOT);
                if (!qdisc) {
                        netdev_info(dev, "activation failed\n");
                        return;
@@ -739,9 +741,8 @@ void dev_activate(struct net_device *dev)
        int need_watchdog;
 
        /* No queueing discipline is attached to device;
-          create default one i.e. pfifo_fast for devices,
-          which need queueing and noqueue_qdisc for
-          virtual interfaces
+        * create default one for devices, which need queueing
+        * and noqueue_qdisc for virtual interfaces
         */
 
        if (dev->qdisc == &noop_qdisc)