mirror of
https://github.com/torvalds/linux.git
synced 2024-11-24 13:11:40 +00:00
net: drop unused skb_append_datato_frags()
This helper is unused since commit 988cf74deb
("inet:
Stop generating UFO packets.")
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
407257ce24
commit
cc16567e5a
@ -1082,11 +1082,6 @@ static inline int skb_pad(struct sk_buff *skb, int pad)
|
||||
}
|
||||
#define dev_kfree_skb(a) consume_skb(a)
|
||||
|
||||
int skb_append_datato_frags(struct sock *sk, struct sk_buff *skb,
|
||||
int getfrag(void *from, char *to, int offset,
|
||||
int len, int odd, struct sk_buff *skb),
|
||||
void *from, int length);
|
||||
|
||||
int skb_append_pagefrags(struct sk_buff *skb, struct page *page,
|
||||
int offset, size_t size);
|
||||
|
||||
|
@ -3381,64 +3381,6 @@ unsigned int skb_find_text(struct sk_buff *skb, unsigned int from,
|
||||
}
|
||||
EXPORT_SYMBOL(skb_find_text);
|
||||
|
||||
/**
|
||||
* skb_append_datato_frags - append the user data to a skb
|
||||
* @sk: sock structure
|
||||
* @skb: skb structure to be appended with user data.
|
||||
* @getfrag: call back function to be used for getting the user data
|
||||
* @from: pointer to user message iov
|
||||
* @length: length of the iov message
|
||||
*
|
||||
* Description: This procedure append the user data in the fragment part
|
||||
* of the skb if any page alloc fails user this procedure returns -ENOMEM
|
||||
*/
|
||||
int skb_append_datato_frags(struct sock *sk, struct sk_buff *skb,
|
||||
int (*getfrag)(void *from, char *to, int offset,
|
||||
int len, int odd, struct sk_buff *skb),
|
||||
void *from, int length)
|
||||
{
|
||||
int frg_cnt = skb_shinfo(skb)->nr_frags;
|
||||
int copy;
|
||||
int offset = 0;
|
||||
int ret;
|
||||
struct page_frag *pfrag = ¤t->task_frag;
|
||||
|
||||
do {
|
||||
/* Return error if we don't have space for new frag */
|
||||
if (frg_cnt >= MAX_SKB_FRAGS)
|
||||
return -EMSGSIZE;
|
||||
|
||||
if (!sk_page_frag_refill(sk, pfrag))
|
||||
return -ENOMEM;
|
||||
|
||||
/* copy the user data to page */
|
||||
copy = min_t(int, length, pfrag->size - pfrag->offset);
|
||||
|
||||
ret = getfrag(from, page_address(pfrag->page) + pfrag->offset,
|
||||
offset, copy, 0, skb);
|
||||
if (ret < 0)
|
||||
return -EFAULT;
|
||||
|
||||
/* copy was successful so update the size parameters */
|
||||
skb_fill_page_desc(skb, frg_cnt, pfrag->page, pfrag->offset,
|
||||
copy);
|
||||
frg_cnt++;
|
||||
pfrag->offset += copy;
|
||||
get_page(pfrag->page);
|
||||
|
||||
skb->truesize += copy;
|
||||
refcount_add(copy, &sk->sk_wmem_alloc);
|
||||
skb->len += copy;
|
||||
skb->data_len += copy;
|
||||
offset += copy;
|
||||
length -= copy;
|
||||
|
||||
} while (length > 0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(skb_append_datato_frags);
|
||||
|
||||
int skb_append_pagefrags(struct sk_buff *skb, struct page *page,
|
||||
int offset, size_t size)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user