diff options
author | Eric Dumazet <eric.dumazet@gmail.com> | 2011-10-20 17:45:43 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-10-20 17:45:43 -0400 |
commit | 05bdd2f14351176d368e8ddc67993690a2d1bfb6 (patch) | |
tree | 06c00c0af56add8602fba296490b4c598418082f /include/linux/skbuff.h | |
parent | 20c4cb792de2b5839537a99a469f4529ef1047f5 (diff) |
net: constify skbuff and Qdisc elements
Preliminary patch before tcp constification
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/skbuff.h')
-rw-r--r-- | include/linux/skbuff.h | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 1ebf1ea29d60..3411f22e7d16 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
@@ -853,9 +853,9 @@ static inline struct sk_buff *skb_unshare(struct sk_buff *skb, | |||
853 | * The reference count is not incremented and the reference is therefore | 853 | * The reference count is not incremented and the reference is therefore |
854 | * volatile. Use with caution. | 854 | * volatile. Use with caution. |
855 | */ | 855 | */ |
856 | static inline struct sk_buff *skb_peek(struct sk_buff_head *list_) | 856 | static inline struct sk_buff *skb_peek(const struct sk_buff_head *list_) |
857 | { | 857 | { |
858 | struct sk_buff *list = ((struct sk_buff *)list_)->next; | 858 | struct sk_buff *list = ((const struct sk_buff *)list_)->next; |
859 | if (list == (struct sk_buff *)list_) | 859 | if (list == (struct sk_buff *)list_) |
860 | list = NULL; | 860 | list = NULL; |
861 | return list; | 861 | return list; |
@@ -874,9 +874,9 @@ static inline struct sk_buff *skb_peek(struct sk_buff_head *list_) | |||
874 | * The reference count is not incremented and the reference is therefore | 874 | * The reference count is not incremented and the reference is therefore |
875 | * volatile. Use with caution. | 875 | * volatile. Use with caution. |
876 | */ | 876 | */ |
877 | static inline struct sk_buff *skb_peek_tail(struct sk_buff_head *list_) | 877 | static inline struct sk_buff *skb_peek_tail(const struct sk_buff_head *list_) |
878 | { | 878 | { |
879 | struct sk_buff *list = ((struct sk_buff *)list_)->prev; | 879 | struct sk_buff *list = ((const struct sk_buff *)list_)->prev; |
880 | if (list == (struct sk_buff *)list_) | 880 | if (list == (struct sk_buff *)list_) |
881 | list = NULL; | 881 | list = NULL; |
882 | return list; | 882 | return list; |
@@ -1830,7 +1830,7 @@ static inline dma_addr_t skb_frag_dma_map(struct device *dev, | |||
1830 | * Returns true if modifying the header part of the cloned buffer | 1830 | * Returns true if modifying the header part of the cloned buffer |
1831 | * does not requires the data to be copied. | 1831 | * does not requires the data to be copied. |
1832 | */ | 1832 | */ |
1833 | static inline int skb_clone_writable(struct sk_buff *skb, unsigned int len) | 1833 | static inline int skb_clone_writable(const struct sk_buff *skb, unsigned int len) |
1834 | { | 1834 | { |
1835 | return !skb_header_cloned(skb) && | 1835 | return !skb_header_cloned(skb) && |
1836 | skb_headroom(skb) + len <= skb->hdr_len; | 1836 | skb_headroom(skb) + len <= skb->hdr_len; |
@@ -2451,7 +2451,8 @@ static inline bool skb_warn_if_lro(const struct sk_buff *skb) | |||
2451 | { | 2451 | { |
2452 | /* LRO sets gso_size but not gso_type, whereas if GSO is really | 2452 | /* LRO sets gso_size but not gso_type, whereas if GSO is really |
2453 | * wanted then gso_type will be set. */ | 2453 | * wanted then gso_type will be set. */ |
2454 | struct skb_shared_info *shinfo = skb_shinfo(skb); | 2454 | const struct skb_shared_info *shinfo = skb_shinfo(skb); |
2455 | |||
2455 | if (skb_is_nonlinear(skb) && shinfo->gso_size != 0 && | 2456 | if (skb_is_nonlinear(skb) && shinfo->gso_size != 0 && |
2456 | unlikely(shinfo->gso_type == 0)) { | 2457 | unlikely(shinfo->gso_type == 0)) { |
2457 | __skb_warn_lro_forwarding(skb); | 2458 | __skb_warn_lro_forwarding(skb); |
@@ -2475,7 +2476,7 @@ static inline void skb_forward_csum(struct sk_buff *skb) | |||
2475 | * Instead of forcing ip_summed to CHECKSUM_NONE, we can | 2476 | * Instead of forcing ip_summed to CHECKSUM_NONE, we can |
2476 | * use this helper, to document places where we make this assertion. | 2477 | * use this helper, to document places where we make this assertion. |
2477 | */ | 2478 | */ |
2478 | static inline void skb_checksum_none_assert(struct sk_buff *skb) | 2479 | static inline void skb_checksum_none_assert(const struct sk_buff *skb) |
2479 | { | 2480 | { |
2480 | #ifdef DEBUG | 2481 | #ifdef DEBUG |
2481 | BUG_ON(skb->ip_summed != CHECKSUM_NONE); | 2482 | BUG_ON(skb->ip_summed != CHECKSUM_NONE); |
@@ -2484,7 +2485,7 @@ static inline void skb_checksum_none_assert(struct sk_buff *skb) | |||
2484 | 2485 | ||
2485 | bool skb_partial_csum_set(struct sk_buff *skb, u16 start, u16 off); | 2486 | bool skb_partial_csum_set(struct sk_buff *skb, u16 start, u16 off); |
2486 | 2487 | ||
2487 | static inline bool skb_is_recycleable(struct sk_buff *skb, int skb_size) | 2488 | static inline bool skb_is_recycleable(const struct sk_buff *skb, int skb_size) |
2488 | { | 2489 | { |
2489 | if (irqs_disabled()) | 2490 | if (irqs_disabled()) |
2490 | return false; | 2491 | return false; |