diff options
author | Sagi Grimberg <sagi@lightbitslabs.com> | 2018-12-03 17:52:06 -0800 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2018-12-13 09:58:52 +0100 |
commit | 0fc07791bc775478d9450ca9c6c674b45f6c1998 (patch) | |
tree | dd564310efba418d90df037ad83a389d02e10c28 /net/core | |
parent | 3152a974678a1e80c3c16d4b86522ecc500be529 (diff) | |
download | lwn-0fc07791bc775478d9450ca9c6c674b45f6c1998.tar.gz lwn-0fc07791bc775478d9450ca9c6c674b45f6c1998.zip |
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: David S. Miller <davem@davemloft.net>
Signed-off-by: Sagi Grimberg <sagi@lightbitslabs.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'net/core')
-rw-r--r-- | net/core/datagram.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/net/core/datagram.c b/net/core/datagram.c index 57f3a6fcfc1e..abe642181b64 100644 --- a/net/core/datagram.c +++ b/net/core/datagram.c @@ -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; |