mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-01 10:45:49 +00:00
csum_and_copy_to_iter(): handle ITER_DISCARD
Not hard to implement - we are not copying anything here, so csum_and_memcpy() is not usable, but calculating a checksum of source directly is trivial... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
40a86061a5
commit
c67f1fd2b2
@ -1549,8 +1549,12 @@ size_t csum_and_copy_to_iter(const void *addr, size_t bytes, void *_csstate,
|
||||
__wsum sum, next;
|
||||
|
||||
if (unlikely(iov_iter_is_discard(i))) {
|
||||
WARN_ON(1); /* for now */
|
||||
return 0;
|
||||
// can't use csum_memcpy() for that one - data is not copied
|
||||
csstate->csum = csum_block_add(csstate->csum,
|
||||
csum_partial(addr, bytes, 0),
|
||||
csstate->off);
|
||||
csstate->off += bytes;
|
||||
return bytes;
|
||||
}
|
||||
|
||||
sum = csum_shift(csstate->csum, csstate->off);
|
||||
|
Loading…
Reference in New Issue
Block a user