aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/skbuff.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/core/skbuff.c')
-rw-r--r--net/core/skbuff.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 573e17240197..64b50ff7a413 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -2028,8 +2028,8 @@ void __init skb_init(void)
2028 * Fill the specified scatter-gather list with mappings/pointers into a 2028 * Fill the specified scatter-gather list with mappings/pointers into a
2029 * region of the buffer space attached to a socket buffer. 2029 * region of the buffer space attached to a socket buffer.
2030 */ 2030 */
2031int 2031static int
2032skb_to_sgvec(struct sk_buff *skb, struct scatterlist *sg, int offset, int len) 2032__skb_to_sgvec(struct sk_buff *skb, struct scatterlist *sg, int offset, int len)
2033{ 2033{
2034 int start = skb_headlen(skb); 2034 int start = skb_headlen(skb);
2035 int i, copy = start - offset; 2035 int i, copy = start - offset;
@@ -2078,7 +2078,8 @@ skb_to_sgvec(struct sk_buff *skb, struct scatterlist *sg, int offset, int len)
2078 if ((copy = end - offset) > 0) { 2078 if ((copy = end - offset) > 0) {
2079 if (copy > len) 2079 if (copy > len)
2080 copy = len; 2080 copy = len;
2081 elt += skb_to_sgvec(list, sg+elt, offset - start, copy); 2081 elt += __skb_to_sgvec(list, sg+elt, offset - start,
2082 copy);
2082 if ((len -= copy) == 0) 2083 if ((len -= copy) == 0)
2083 return elt; 2084 return elt;
2084 offset += copy; 2085 offset += copy;
@@ -2090,6 +2091,15 @@ skb_to_sgvec(struct sk_buff *skb, struct scatterlist *sg, int offset, int len)
2090 return elt; 2091 return elt;
2091} 2092}
2092 2093
2094int skb_to_sgvec(struct sk_buff *skb, struct scatterlist *sg, int offset, int len)
2095{
2096 int nsg = __skb_to_sgvec(skb, sg, offset, len);
2097
2098 __sg_mark_end(&sg[nsg - 1]);
2099
2100 return nsg;
2101}
2102
2093/** 2103/**
2094 * skb_cow_data - Check that a socket buffer's data buffers are writable 2104 * skb_cow_data - Check that a socket buffer's data buffers are writable
2095 * @skb: The socket buffer to check. 2105 * @skb: The socket buffer to check.