Skip to content
Commit 950fcaec authored by Sagi Grimberg's avatar Sagi Grimberg Committed by Christoph Hellwig
Browse files

datagram: consolidate datagram copy to iter helpers



skb_copy_datagram_iter and skb_copy_and_csum_datagram are essentialy
the same but with a couple of differences: The first is the copy
operation used which either a simple copy or a csum_and_copy, and the
second are the behavior on the "short copy" path where simply copy
needs to return the number of bytes successfully copied while csum_and_copy
needs to fault immediately as the checksum is partial.

Introduce __skb_datagram_iter that additionally accepts:
1. copy operation function pointer
2. private data that goes with the copy operation
3. fault_short flag to indicate the action on short copy

Suggested-by: default avatarDavid S. Miller <davem@davemloft.net>
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 cb002d07
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