summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2007-04-19 20:43:29 -0700
committerDavid S. Miller <davem@sunset.davemloft.net>2007-04-25 22:26:29 -0700
commit4305b541357ddbd205aa145dc378926b7cb12283 (patch)
tree9b1f57ee4ee757a9324c48a7dea84bc8c279ad82 /include/linux
parent27a884dc3cb63b93c2b3b643f5b31eed5f8a4d26 (diff)
[SK_BUFF]: Convert skb->end to sk_buff_data_t
Now to convert the last one, skb->data, that will allow many simplifications and removal of some of the offset helpers. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/skbuff.h23
1 files changed, 18 insertions, 5 deletions
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index e1c2392ecb56..656dc0e901cc 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -305,9 +305,9 @@ struct sk_buff {
sk_buff_data_t mac_header;
/* These elements must be at the end, see alloc_skb() for details. */
sk_buff_data_t tail;
+ sk_buff_data_t end;
unsigned char *head,
- *data,
- *end;
+ *data;
unsigned int truesize;
atomic_t users;
};
@@ -392,8 +392,20 @@ extern unsigned int skb_find_text(struct sk_buff *skb, unsigned int from,
unsigned int to, struct ts_config *config,
struct ts_state *state);
+#ifdef NET_SKBUFF_DATA_USES_OFFSET
+static inline unsigned char *skb_end_pointer(const struct sk_buff *skb)
+{
+ return skb->head + skb->end;
+}
+#else
+static inline unsigned char *skb_end_pointer(const struct sk_buff *skb)
+{
+ return skb->end;
+}
+#endif
+
/* Internal */
-#define skb_shinfo(SKB) ((struct skb_shared_info *)((SKB)->end))
+#define skb_shinfo(SKB) ((struct skb_shared_info *)(skb_end_pointer(SKB)))
/**
* skb_queue_empty - check if a queue is empty
@@ -843,6 +855,7 @@ static inline void skb_set_tail_pointer(struct sk_buff *skb, const int offset)
{
skb->tail = skb->data + offset;
}
+
#endif /* NET_SKBUFF_DATA_USES_OFFSET */
/*
@@ -872,7 +885,7 @@ static inline unsigned char *skb_put(struct sk_buff *skb, unsigned int len)
SKB_LINEAR_ASSERT(skb);
skb->tail += len;
skb->len += len;
- if (unlikely(skb_tail_pointer(skb) > skb->end))
+ if (unlikely(skb->tail > skb->end))
skb_over_panic(skb, len, current_text_addr());
return tmp;
}
@@ -968,7 +981,7 @@ static inline int skb_headroom(const struct sk_buff *skb)
*/
static inline int skb_tailroom(const struct sk_buff *skb)
{
- return skb_is_nonlinear(skb) ? 0 : skb->end - skb_tail_pointer(skb);
+ return skb_is_nonlinear(skb) ? 0 : skb->end - skb->tail;
}
/**