diff options
author | David S. Miller <davem@davemloft.net> | 2005-08-09 22:25:21 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2005-08-29 18:31:14 -0400 |
commit | 8728b834b226ffcf2c94a58530090e292af2a7bf (patch) | |
tree | 2fd51ff3b7097eb3ffc41ea3a1d8b3ba04715b4c /include/linux | |
parent | 6869c4d8e066e21623c812c448a05f1ed931c9c6 (diff) |
[NET]: Kill skb->list
Remove the "list" member of struct sk_buff, as it is entirely
redundant. All SKB list removal callers know which list the
SKB is on, so storing this in sk_buff does nothing other than
taking up some space.
Two tricky bits were SCTP, which I took care of, and two ATM
drivers which Francois Romieu <romieu@fr.zoreil.com> fixed
up.
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/skbuff.h | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 4b929c3c1a98..76c68851474c 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
@@ -204,7 +204,6 @@ struct sk_buff { | |||
204 | struct sk_buff *next; | 204 | struct sk_buff *next; |
205 | struct sk_buff *prev; | 205 | struct sk_buff *prev; |
206 | 206 | ||
207 | struct sk_buff_head *list; | ||
208 | struct sock *sk; | 207 | struct sock *sk; |
209 | struct timeval stamp; | 208 | struct timeval stamp; |
210 | struct net_device *dev; | 209 | struct net_device *dev; |
@@ -597,7 +596,6 @@ static inline void __skb_queue_head(struct sk_buff_head *list, | |||
597 | { | 596 | { |
598 | struct sk_buff *prev, *next; | 597 | struct sk_buff *prev, *next; |
599 | 598 | ||
600 | newsk->list = list; | ||
601 | list->qlen++; | 599 | list->qlen++; |
602 | prev = (struct sk_buff *)list; | 600 | prev = (struct sk_buff *)list; |
603 | next = prev->next; | 601 | next = prev->next; |
@@ -622,7 +620,6 @@ static inline void __skb_queue_tail(struct sk_buff_head *list, | |||
622 | { | 620 | { |
623 | struct sk_buff *prev, *next; | 621 | struct sk_buff *prev, *next; |
624 | 622 | ||
625 | newsk->list = list; | ||
626 | list->qlen++; | 623 | list->qlen++; |
627 | next = (struct sk_buff *)list; | 624 | next = (struct sk_buff *)list; |
628 | prev = next->prev; | 625 | prev = next->prev; |
@@ -655,7 +652,6 @@ static inline struct sk_buff *__skb_dequeue(struct sk_buff_head *list) | |||
655 | next->prev = prev; | 652 | next->prev = prev; |
656 | prev->next = next; | 653 | prev->next = next; |
657 | result->next = result->prev = NULL; | 654 | result->next = result->prev = NULL; |
658 | result->list = NULL; | ||
659 | } | 655 | } |
660 | return result; | 656 | return result; |
661 | } | 657 | } |
@@ -664,7 +660,7 @@ static inline struct sk_buff *__skb_dequeue(struct sk_buff_head *list) | |||
664 | /* | 660 | /* |
665 | * Insert a packet on a list. | 661 | * Insert a packet on a list. |
666 | */ | 662 | */ |
667 | extern void skb_insert(struct sk_buff *old, struct sk_buff *newsk); | 663 | extern void skb_insert(struct sk_buff *old, struct sk_buff *newsk, struct sk_buff_head *list); |
668 | static inline void __skb_insert(struct sk_buff *newsk, | 664 | static inline void __skb_insert(struct sk_buff *newsk, |
669 | struct sk_buff *prev, struct sk_buff *next, | 665 | struct sk_buff *prev, struct sk_buff *next, |
670 | struct sk_buff_head *list) | 666 | struct sk_buff_head *list) |
@@ -672,24 +668,23 @@ static inline void __skb_insert(struct sk_buff *newsk, | |||
672 | newsk->next = next; | 668 | newsk->next = next; |
673 | newsk->prev = prev; | 669 | newsk->prev = prev; |
674 | next->prev = prev->next = newsk; | 670 | next->prev = prev->next = newsk; |
675 | newsk->list = list; | ||
676 | list->qlen++; | 671 | list->qlen++; |
677 | } | 672 | } |
678 | 673 | ||
679 | /* | 674 | /* |
680 | * Place a packet after a given packet in a list. | 675 | * Place a packet after a given packet in a list. |
681 | */ | 676 | */ |
682 | extern void skb_append(struct sk_buff *old, struct sk_buff *newsk); | 677 | extern void skb_append(struct sk_buff *old, struct sk_buff *newsk, struct sk_buff_head *list); |
683 | static inline void __skb_append(struct sk_buff *old, struct sk_buff *newsk) | 678 | static inline void __skb_append(struct sk_buff *old, struct sk_buff *newsk, struct sk_buff_head *list) |
684 | { | 679 | { |
685 | __skb_insert(newsk, old, old->next, old->list); | 680 | __skb_insert(newsk, old, old->next, list); |
686 | } | 681 | } |
687 | 682 | ||
688 | /* | 683 | /* |
689 | * remove sk_buff from list. _Must_ be called atomically, and with | 684 | * remove sk_buff from list. _Must_ be called atomically, and with |
690 | * the list known.. | 685 | * the list known.. |
691 | */ | 686 | */ |
692 | extern void skb_unlink(struct sk_buff *skb); | 687 | extern void skb_unlink(struct sk_buff *skb, struct sk_buff_head *list); |
693 | static inline void __skb_unlink(struct sk_buff *skb, struct sk_buff_head *list) | 688 | static inline void __skb_unlink(struct sk_buff *skb, struct sk_buff_head *list) |
694 | { | 689 | { |
695 | struct sk_buff *next, *prev; | 690 | struct sk_buff *next, *prev; |
@@ -698,7 +693,6 @@ static inline void __skb_unlink(struct sk_buff *skb, struct sk_buff_head *list) | |||
698 | next = skb->next; | 693 | next = skb->next; |
699 | prev = skb->prev; | 694 | prev = skb->prev; |
700 | skb->next = skb->prev = NULL; | 695 | skb->next = skb->prev = NULL; |
701 | skb->list = NULL; | ||
702 | next->prev = prev; | 696 | next->prev = prev; |
703 | prev->next = next; | 697 | prev->next = next; |
704 | } | 698 | } |