diff options
author | Thomas Graf <tgraf@suug.ch> | 2005-07-05 17:15:09 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2005-07-05 17:15:09 -0400 |
commit | 3d54b82fdf0ca79608f61448fb8ab92676487645 (patch) | |
tree | 441e7a997eca58d2d7d2d06c387667ba82937d58 /include | |
parent | e41a33e6ec20a0a6ac762629149e36cab5d4213f (diff) |
[PKT_SCHED]: Cleanup qdisc creation and alignment macros
Adds qdisc_alloc() to share code between qdisc_create()
and qdisc_create_dflt(). Hides the qdisc alignment behind
macros and makes use of them.
Signed-off-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r-- | include/net/pkt_sched.h | 7 | ||||
-rw-r--r-- | include/net/sch_generic.h | 1 |
2 files changed, 4 insertions, 4 deletions
diff --git a/include/net/pkt_sched.h b/include/net/pkt_sched.h index 2f494a20d512..6492e7363d84 100644 --- a/include/net/pkt_sched.h +++ b/include/net/pkt_sched.h | |||
@@ -13,13 +13,12 @@ struct qdisc_walker | |||
13 | 13 | ||
14 | extern rwlock_t qdisc_tree_lock; | 14 | extern rwlock_t qdisc_tree_lock; |
15 | 15 | ||
16 | #define QDISC_ALIGN 32 | 16 | #define QDISC_ALIGNTO 32 |
17 | #define QDISC_ALIGN_CONST (QDISC_ALIGN - 1) | 17 | #define QDISC_ALIGN(len) (((len) + QDISC_ALIGNTO-1) & ~(QDISC_ALIGNTO-1)) |
18 | 18 | ||
19 | static inline void *qdisc_priv(struct Qdisc *q) | 19 | static inline void *qdisc_priv(struct Qdisc *q) |
20 | { | 20 | { |
21 | return (char *)q + ((sizeof(struct Qdisc) + QDISC_ALIGN_CONST) | 21 | return (char *) q + QDISC_ALIGN(sizeof(struct Qdisc)); |
22 | & ~QDISC_ALIGN_CONST); | ||
23 | } | 22 | } |
24 | 23 | ||
25 | /* | 24 | /* |
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h index c76d34e62ff6..7b6ec9986715 100644 --- a/include/net/sch_generic.h +++ b/include/net/sch_generic.h | |||
@@ -173,6 +173,7 @@ extern void dev_activate(struct net_device *dev); | |||
173 | extern void dev_deactivate(struct net_device *dev); | 173 | extern void dev_deactivate(struct net_device *dev); |
174 | extern void qdisc_reset(struct Qdisc *qdisc); | 174 | extern void qdisc_reset(struct Qdisc *qdisc); |
175 | extern void qdisc_destroy(struct Qdisc *qdisc); | 175 | extern void qdisc_destroy(struct Qdisc *qdisc); |
176 | extern struct Qdisc *qdisc_alloc(struct net_device *dev, struct Qdisc_ops *ops); | ||
176 | extern struct Qdisc *qdisc_create_dflt(struct net_device *dev, | 177 | extern struct Qdisc *qdisc_create_dflt(struct net_device *dev, |
177 | struct Qdisc_ops *ops); | 178 | struct Qdisc_ops *ops); |
178 | 179 | ||