Commit 0fc07791 authored by Sagi Grimberg's avatar Sagi Grimberg Committed by Christoph Hellwig

datagram: open-code copy_page_to_iter

This will be useful to consolidate skb_copy_and_hash_datagram_iter and
skb_copy_and_csum_datagram to a single code path.
Acked-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarSagi Grimberg <sagi@lightbitslabs.com>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
parent 3152a974
......@@ -445,11 +445,14 @@ int skb_copy_datagram_iter(const struct sk_buff *skb, int offset,
end = start + skb_frag_size(frag);
if ((copy = end - offset) > 0) {
struct page *page = skb_frag_page(frag);
u8 *vaddr = kmap(page);
if (copy > len)
copy = len;
n = copy_page_to_iter(skb_frag_page(frag),
frag->page_offset + offset -
start, copy, to);
n = copy_to_iter(vaddr + frag->page_offset +
offset - start, copy, to);
kunmap(page);
offset += n;
if (n != copy)
goto short_copy;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment