aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/sch_generic.h
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-07-08 20:06:30 -0400
committerDavid S. Miller <davem@davemloft.net>2008-07-08 20:06:30 -0400
commit5ce2d488fe039ddd86a638496cf704df86c74eeb (patch)
tree71b4d982bfa8bd457bb41c0693c0e70d75b524b4 /include/net/sch_generic.h
parentbb949fbd1878973c3539d9aecff52f284482a937 (diff)
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/sch_generic.h')
-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 0ab53c575f87..66ec36d8ac97 100644
--- a/include/net/sch_generic.h
+++ b/include/net/sch_generic.h
@@ -38,7 +38,6 @@ struct Qdisc
38 atomic_t refcnt; 38 atomic_t refcnt;
39 struct sk_buff_head q; 39 struct sk_buff_head q;
40 struct netdev_queue *dev_queue; 40 struct netdev_queue *dev_queue;
41 struct net_device *dev;
42 struct list_head list; 41 struct list_head list;
43 42
44 struct gnet_stats_basic bstats; 43 struct gnet_stats_basic bstats;
@@ -156,14 +155,18 @@ struct tcf_proto
156 struct tcf_proto_ops *ops; 155 struct tcf_proto_ops *ops;
157}; 156};
158 157
158static inline struct net_device *qdisc_dev(struct Qdisc *qdisc)
159{
160 return qdisc->dev_queue->dev;
161}
159 162
160extern void qdisc_lock_tree(struct net_device *dev); 163extern void qdisc_lock_tree(struct net_device *dev);
161extern void qdisc_unlock_tree(struct net_device *dev); 164extern void qdisc_unlock_tree(struct net_device *dev);
162 165
163#define sch_tree_lock(q) qdisc_lock_tree((q)->dev) 166#define sch_tree_lock(q) qdisc_lock_tree(qdisc_dev(q))
164#define sch_tree_unlock(q) qdisc_unlock_tree((q)->dev) 167#define sch_tree_unlock(q) qdisc_unlock_tree(qdisc_dev(q))
165#define tcf_tree_lock(tp) qdisc_lock_tree((tp)->q->dev) 168#define tcf_tree_lock(tp) qdisc_lock_tree(qdisc_dev((tp)->q))
166#define tcf_tree_unlock(tp) qdisc_unlock_tree((tp)->q->dev) 169#define tcf_tree_unlock(tp) qdisc_unlock_tree(qdisc_dev((tp)->q))
167 170
168extern struct Qdisc noop_qdisc; 171extern struct Qdisc noop_qdisc;
169extern struct Qdisc_ops noop_qdisc_ops; 172extern struct Qdisc_ops noop_qdisc_ops;
@@ -217,8 +220,7 @@ extern void dev_deactivate(struct net_device *dev);
217extern void qdisc_reset(struct Qdisc *qdisc); 220extern void qdisc_reset(struct Qdisc *qdisc);
218extern void qdisc_destroy(struct Qdisc *qdisc); 221extern void qdisc_destroy(struct Qdisc *qdisc);
219extern void qdisc_tree_decrease_qlen(struct Qdisc *qdisc, unsigned int n); 222extern void qdisc_tree_decrease_qlen(struct Qdisc *qdisc, unsigned int n);
220extern struct Qdisc *qdisc_alloc(struct net_device *dev, 223extern struct Qdisc *qdisc_alloc(struct netdev_queue *dev_queue,
221 struct netdev_queue *dev_queue,
222 struct Qdisc_ops *ops); 224 struct Qdisc_ops *ops);
223extern struct Qdisc *qdisc_create_dflt(struct net_device *dev, 225extern struct Qdisc *qdisc_create_dflt(struct net_device *dev,
224 struct netdev_queue *dev_queue, 226 struct netdev_queue *dev_queue,