mirror of
https://github.com/torvalds/linux.git
synced 2025-12-07 20:06:24 +00:00
new helper: copy_to_iter_full()
... and convert copy_linear_skb() to using that. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
@@ -205,6 +205,16 @@ size_t copy_from_iter(void *addr, size_t bytes, struct iov_iter *i)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static __always_inline __must_check
|
||||
bool copy_to_iter_full(const void *addr, size_t bytes, struct iov_iter *i)
|
||||
{
|
||||
size_t copied = copy_to_iter(addr, bytes, i);
|
||||
if (likely(copied == bytes))
|
||||
return true;
|
||||
iov_iter_revert(i, copied);
|
||||
return false;
|
||||
}
|
||||
|
||||
static __always_inline __must_check
|
||||
bool copy_from_iter_full(void *addr, size_t bytes, struct iov_iter *i)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user