Lines Matching refs:bytes
173 static size_t copy_page_to_iter_iovec(struct page *page, size_t offset, size_t bytes, in copy_page_to_iter_iovec() argument
181 if (unlikely(bytes > i->count)) in copy_page_to_iter_iovec()
182 bytes = i->count; in copy_page_to_iter_iovec()
184 if (unlikely(!bytes)) in copy_page_to_iter_iovec()
188 wanted = bytes; in copy_page_to_iter_iovec()
192 copy = min(bytes, iov->iov_len - skip); in copy_page_to_iter_iovec()
203 bytes -= copy; in copy_page_to_iter_iovec()
205 while (unlikely(!left && bytes)) { in copy_page_to_iter_iovec()
208 copy = min(bytes, iov->iov_len); in copy_page_to_iter_iovec()
213 bytes -= copy; in copy_page_to_iter_iovec()
215 if (likely(!bytes)) { in copy_page_to_iter_iovec()
222 copy = min(bytes, iov->iov_len - skip); in copy_page_to_iter_iovec()
232 bytes -= copy; in copy_page_to_iter_iovec()
233 while (unlikely(!left && bytes)) { in copy_page_to_iter_iovec()
236 copy = min(bytes, iov->iov_len); in copy_page_to_iter_iovec()
241 bytes -= copy; in copy_page_to_iter_iovec()
250 i->count -= wanted - bytes; in copy_page_to_iter_iovec()
254 return wanted - bytes; in copy_page_to_iter_iovec()
257 static size_t copy_page_from_iter_iovec(struct page *page, size_t offset, size_t bytes, in copy_page_from_iter_iovec() argument
265 if (unlikely(bytes > i->count)) in copy_page_from_iter_iovec()
266 bytes = i->count; in copy_page_from_iter_iovec()
268 if (unlikely(!bytes)) in copy_page_from_iter_iovec()
272 wanted = bytes; in copy_page_from_iter_iovec()
276 copy = min(bytes, iov->iov_len - skip); in copy_page_from_iter_iovec()
287 bytes -= copy; in copy_page_from_iter_iovec()
289 while (unlikely(!left && bytes)) { in copy_page_from_iter_iovec()
292 copy = min(bytes, iov->iov_len); in copy_page_from_iter_iovec()
297 bytes -= copy; in copy_page_from_iter_iovec()
299 if (likely(!bytes)) { in copy_page_from_iter_iovec()
306 copy = min(bytes, iov->iov_len - skip); in copy_page_from_iter_iovec()
316 bytes -= copy; in copy_page_from_iter_iovec()
317 while (unlikely(!left && bytes)) { in copy_page_from_iter_iovec()
320 copy = min(bytes, iov->iov_len); in copy_page_from_iter_iovec()
325 bytes -= copy; in copy_page_from_iter_iovec()
334 i->count -= wanted - bytes; in copy_page_from_iter_iovec()
338 return wanted - bytes; in copy_page_from_iter_iovec()
384 static size_t copy_page_to_iter_pipe(struct page *page, size_t offset, size_t bytes, in copy_page_to_iter_pipe() argument
394 if (unlikely(bytes > i->count)) in copy_page_to_iter_pipe()
395 bytes = i->count; in copy_page_to_iter_pipe()
397 if (unlikely(!bytes)) in copy_page_to_iter_pipe()
408 buf->len += bytes; in copy_page_to_iter_pipe()
409 i->iov_offset += bytes; in copy_page_to_iter_pipe()
423 buf->len = bytes; in copy_page_to_iter_pipe()
426 i->iov_offset = offset + bytes; in copy_page_to_iter_pipe()
429 i->count -= bytes; in copy_page_to_iter_pipe()
430 return bytes; in copy_page_to_iter_pipe()
597 static size_t copy_pipe_to_iter(const void *addr, size_t bytes, in copy_pipe_to_iter() argument
608 bytes = n = push_pipe(i, bytes, &i_head, &off); in copy_pipe_to_iter()
621 i->count -= bytes; in copy_pipe_to_iter()
622 return bytes; in copy_pipe_to_iter()
632 static size_t csum_and_copy_to_pipe_iter(const void *addr, size_t bytes, in csum_and_copy_to_pipe_iter() argument
645 bytes = push_pipe(i, bytes, &i_head, &r); in csum_and_copy_to_pipe_iter()
646 while (bytes) { in csum_and_copy_to_pipe_iter()
647 size_t chunk = min_t(size_t, bytes, PAGE_SIZE - r); in csum_and_copy_to_pipe_iter()
653 bytes -= chunk; in csum_and_copy_to_pipe_iter()
663 size_t _copy_to_iter(const void *addr, size_t bytes, struct iov_iter *i) in _copy_to_iter() argument
666 return copy_pipe_to_iter(addr, bytes, i); in _copy_to_iter()
669 iterate_and_advance(i, bytes, base, len, off, in _copy_to_iter()
674 return bytes; in _copy_to_iter()
688 static size_t copy_mc_pipe_to_iter(const void *addr, size_t bytes, in copy_mc_pipe_to_iter() argument
700 n = push_pipe(i, bytes, &i_head, &off); in copy_mc_pipe_to_iter()
752 size_t _copy_mc_to_iter(const void *addr, size_t bytes, struct iov_iter *i) in _copy_mc_to_iter() argument
755 return copy_mc_pipe_to_iter(addr, bytes, i); in _copy_mc_to_iter()
758 __iterate_and_advance(i, bytes, base, len, off, in _copy_mc_to_iter()
763 return bytes; in _copy_mc_to_iter()
768 size_t _copy_from_iter(void *addr, size_t bytes, struct iov_iter *i) in _copy_from_iter() argument
776 iterate_and_advance(i, bytes, base, len, off, in _copy_from_iter()
781 return bytes; in _copy_from_iter()
785 size_t _copy_from_iter_nocache(void *addr, size_t bytes, struct iov_iter *i) in _copy_from_iter_nocache() argument
791 iterate_and_advance(i, bytes, base, len, off, in _copy_from_iter_nocache()
796 return bytes; in _copy_from_iter_nocache()
817 size_t _copy_from_iter_flushcache(void *addr, size_t bytes, struct iov_iter *i) in _copy_from_iter_flushcache() argument
823 iterate_and_advance(i, bytes, base, len, off, in _copy_from_iter_flushcache()
828 return bytes; in _copy_from_iter_flushcache()
857 static size_t __copy_page_to_iter(struct page *page, size_t offset, size_t bytes, in __copy_page_to_iter() argument
861 return copy_page_to_iter_iovec(page, offset, bytes, i); in __copy_page_to_iter()
864 size_t wanted = _copy_to_iter(kaddr + offset, bytes, i); in __copy_page_to_iter()
869 return copy_page_to_iter_pipe(page, offset, bytes, i); in __copy_page_to_iter()
871 if (unlikely(i->count < bytes)) in __copy_page_to_iter()
872 bytes = i->count; in __copy_page_to_iter()
873 i->count -= bytes; in __copy_page_to_iter()
874 return bytes; in __copy_page_to_iter()
880 size_t copy_page_to_iter(struct page *page, size_t offset, size_t bytes, in copy_page_to_iter() argument
884 if (unlikely(!page_copy_sane(page, offset, bytes))) in copy_page_to_iter()
890 min(bytes, (size_t)PAGE_SIZE - offset), i); in copy_page_to_iter()
892 bytes -= n; in copy_page_to_iter()
893 if (!bytes || !n) in copy_page_to_iter()
905 size_t copy_page_from_iter(struct page *page, size_t offset, size_t bytes, in copy_page_from_iter() argument
908 if (unlikely(!page_copy_sane(page, offset, bytes))) in copy_page_from_iter()
911 return copy_page_from_iter_iovec(page, offset, bytes, i); in copy_page_from_iter()
914 size_t wanted = _copy_from_iter(kaddr + offset, bytes, i); in copy_page_from_iter()
923 static size_t pipe_zero(size_t bytes, struct iov_iter *i) in pipe_zero() argument
933 bytes = n = push_pipe(i, bytes, &i_head, &off); in pipe_zero()
948 i->count -= bytes; in pipe_zero()
949 return bytes; in pipe_zero()
952 size_t iov_iter_zero(size_t bytes, struct iov_iter *i) in iov_iter_zero() argument
955 return pipe_zero(bytes, i); in iov_iter_zero()
956 iterate_and_advance(i, bytes, base, len, count, in iov_iter_zero()
961 return bytes; in iov_iter_zero()
965 size_t copy_page_from_iter_atomic(struct page *page, unsigned offset, size_t bytes, in copy_page_from_iter_atomic() argument
969 if (unlikely(!page_copy_sane(page, offset, bytes))) { in copy_page_from_iter_atomic()
978 iterate_and_advance(i, bytes, base, len, off, in copy_page_from_iter_atomic()
983 return bytes; in copy_page_from_iter_atomic()
1696 size_t csum_and_copy_from_iter(void *addr, size_t bytes, __wsum *csum, in csum_and_copy_from_iter() argument
1705 iterate_and_advance(i, bytes, base, len, off, ({ in csum_and_copy_from_iter()
1714 return bytes; in csum_and_copy_from_iter()
1718 size_t csum_and_copy_to_iter(const void *addr, size_t bytes, void *_csstate, in csum_and_copy_to_iter() argument
1731 bytes = csum_and_copy_to_pipe_iter(addr, bytes, i, &sum); in csum_and_copy_to_iter()
1732 else iterate_and_advance(i, bytes, base, len, off, ({ in csum_and_copy_to_iter()
1741 csstate->off += bytes; in csum_and_copy_to_iter()
1742 return bytes; in csum_and_copy_to_iter()
1746 size_t hash_and_copy_to_iter(const void *addr, size_t bytes, void *hashp, in hash_and_copy_to_iter() argument
1754 copied = copy_to_iter(addr, bytes, i); in hash_and_copy_to_iter()