diff options
author | David S. Miller <davem@davemloft.net> | 2008-07-08 20:06:30 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-07-08 20:06:30 -0400 |
commit | 5ce2d488fe039ddd86a638496cf704df86c74eeb (patch) | |
tree | 71b4d982bfa8bd457bb41c0693c0e70d75b524b4 /include | |
parent | bb949fbd1878973c3539d9aecff52f284482a937 (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')
-rw-r--r-- | include/net/sch_generic.h | 16 |
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 | ||
158 | static inline struct net_device *qdisc_dev(struct Qdisc *qdisc) | ||
159 | { | ||
160 | return qdisc->dev_queue->dev; | ||
161 | } | ||
159 | 162 | ||
160 | extern void qdisc_lock_tree(struct net_device *dev); | 163 | extern void qdisc_lock_tree(struct net_device *dev); |
161 | extern void qdisc_unlock_tree(struct net_device *dev); | 164 | extern 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 | ||
168 | extern struct Qdisc noop_qdisc; | 171 | extern struct Qdisc noop_qdisc; |
169 | extern struct Qdisc_ops noop_qdisc_ops; | 172 | extern struct Qdisc_ops noop_qdisc_ops; |
@@ -217,8 +220,7 @@ extern void dev_deactivate(struct net_device *dev); | |||
217 | extern void qdisc_reset(struct Qdisc *qdisc); | 220 | extern void qdisc_reset(struct Qdisc *qdisc); |
218 | extern void qdisc_destroy(struct Qdisc *qdisc); | 221 | extern void qdisc_destroy(struct Qdisc *qdisc); |
219 | extern void qdisc_tree_decrease_qlen(struct Qdisc *qdisc, unsigned int n); | 222 | extern void qdisc_tree_decrease_qlen(struct Qdisc *qdisc, unsigned int n); |
220 | extern struct Qdisc *qdisc_alloc(struct net_device *dev, | 223 | extern 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); |
223 | extern struct Qdisc *qdisc_create_dflt(struct net_device *dev, | 225 | extern struct Qdisc *qdisc_create_dflt(struct net_device *dev, |
224 | struct netdev_queue *dev_queue, | 226 | struct netdev_queue *dev_queue, |