aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/linux/uio.h
diff options
context:
space:
mode:
authorSagi Grimberg <sagi@lightbitslabs.com>2018-12-03 17:52:09 -0800
committerChristoph Hellwig <hch@lst.de>2018-12-13 09:58:54 +0100
commitd05f443554b3c7dc6d46e3ba9c3c4de468875d4f (patch)
tree6bc94110dc8dd6ea1540ec26b6b4f6c3029ea0f0 /include/linux/uio.h
parentdatagram: consolidate datagram copy to iter helpers (diff)
downloadwireguard-linux-d05f443554b3c7dc6d46e3ba9c3c4de468875d4f.tar.xz
wireguard-linux-d05f443554b3c7dc6d46e3ba9c3c4de468875d4f.zip
iov_iter: introduce hash_and_copy_to_iter helper
Allow consumers that want to use iov iterator helpers and also update a predefined hash calculation online when copying data. This is useful when copying incoming network buffers to a local iterator and calculate a digest on the incoming stream. nvme-tcp host driver that will be introduced in following patches is the first consumer via skb_copy_and_hash_datagram_iter. 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 'include/linux/uio.h')
-rw-r--r--include/linux/uio.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/uio.h b/include/linux/uio.h
index 41d1f8d3313d..ecf584f6b82d 100644
--- a/include/linux/uio.h
+++ b/include/linux/uio.h
@@ -11,6 +11,7 @@
#include <linux/kernel.h>
#include <linux/thread_info.h>
+#include <crypto/hash.h>
#include <uapi/linux/uio.h>
struct page;
@@ -269,6 +270,8 @@ static inline void iov_iter_reexpand(struct iov_iter *i, size_t count)
size_t csum_and_copy_to_iter(const void *addr, size_t bytes, void *csump, struct iov_iter *i);
size_t csum_and_copy_from_iter(void *addr, size_t bytes, __wsum *csum, struct iov_iter *i);
bool csum_and_copy_from_iter_full(void *addr, size_t bytes, __wsum *csum, struct iov_iter *i);
+size_t hash_and_copy_to_iter(const void *addr, size_t bytes, void *hashp,
+ struct iov_iter *i);
int import_iovec(int type, const struct iovec __user * uvector,
unsigned nr_segs, unsigned fast_segs,