Skip to content

Commit 0fc0779

Browse files
Sagi GrimbergChristoph Hellwig
authored andcommitted
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>
1 parent 3152a97 commit 0fc0779

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

net/core/datagram.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -445,11 +445,14 @@ int skb_copy_datagram_iter(const struct sk_buff *skb, int offset,
445445

446446
end = start + skb_frag_size(frag);
447447
if ((copy = end - offset) > 0) {
448+
struct page *page = skb_frag_page(frag);
449+
u8 *vaddr = kmap(page);
450+
448451
if (copy > len)
449452
copy = len;
450-
n = copy_page_to_iter(skb_frag_page(frag),
451-
frag->page_offset + offset -
452-
start, copy, to);
453+
n = copy_to_iter(vaddr + frag->page_offset +
454+
offset - start, copy, to);
455+
kunmap(page);
453456
offset += n;
454457
if (n != copy)
455458
goto short_copy;

0 commit comments

Comments
 (0)