aboutsummaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-07-08 17:06:30 -0700
committerDavid S. Miller <davem@davemloft.net>2008-07-08 17:06:30 -0700
commit5ce2d488fe039ddd86a638496cf704df86c74eeb (patch)
tree71b4d982bfa8bd457bb41c0693c0e70d75b524b4 /include/net
parentbb949fbd1878973c3539d9aecff52f284482a937 (diff)
downloadkernel_samsung_espresso10-5ce2d488fe039ddd86a638496cf704df86c74eeb.zip
kernel_samsung_espresso10-5ce2d488fe039ddd86a638496cf704df86c74eeb.tar.gz
kernel_samsung_espresso10-5ce2d488fe039ddd86a638496cf704df86c74eeb.tar.bz2
pkt_sched: Remove 'dev' member of struct Qdisc.
It can be obtained via the netdev_queue. So create a helper routine, qdisc_dev(), to make the transformations nicer looking. Now, qdisc_alloc() now no longer needs a net_device pointer argument. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net')
-rw-r--r--include/net/sch_generic.h16
1 files changed, 9 insertions, 7 deletions
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
index 0ab53c5..66ec36d 100644
--- a/include/net/sch_generic.h
+++ b/include/net/sch_generic.h
@@ -38,7 +38,6 @@ struct Qdisc
atomic_t refcnt;
struct sk_buff_head q;
struct netdev_queue *dev_queue;
- struct net_device *dev;
struct list_head list;
struct gnet_stats_basic bstats;
@@ -156,14 +155,18 @@ struct tcf_proto
struct tcf_proto_ops *ops;
};
+static inline struct net_device *qdisc_dev(struct Qdisc *qdisc)
+{
+ return qdisc->dev_queue->dev;
+}
extern void qdisc_lock_tree(struct net_device *dev);
extern void qdisc_unlock_tree(struct net_device *dev);
-#define sch_tree_lock(q) qdisc_lock_tree((q)->dev)
-#define sch_tree_unlock(q) qdisc_unlock_tree((q)->dev)
-#define tcf_tree_lock(tp) qdisc_lock_tree((tp)->q->dev)
-#define tcf_tree_unlock(tp) qdisc_unlock_tree((tp)->q->dev)
+#define sch_tree_lock(q) qdisc_lock_tree(qdisc_dev(q))
+#define sch_tree_unlock(q) qdisc_unlock_tree(qdisc_dev(q))
+#define tcf_tree_lock(tp) qdisc_lock_tree(qdisc_dev((tp)->q))
+#define tcf_tree_unlock(tp) qdisc_unlock_tree(qdisc_dev((tp)->q))
extern struct Qdisc noop_qdisc;
extern struct Qdisc_ops noop_qdisc_ops;
@@ -217,8 +220,7 @@ extern void dev_deactivate(struct net_device *dev);
extern void qdisc_reset(struct Qdisc *qdisc);
extern void qdisc_destroy(struct Qdisc *qdisc);
extern void qdisc_tree_decrease_qlen(struct Qdisc *qdisc, unsigned int n);
-extern struct Qdisc *qdisc_alloc(struct net_device *dev,
- struct netdev_queue *dev_queue,
+extern struct Qdisc *qdisc_alloc(struct netdev_queue *dev_queue,
struct Qdisc_ops *ops);
extern struct Qdisc *qdisc_create_dflt(struct net_device *dev,
struct netdev_queue *dev_queue,