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()
422 buf->len = bytes; in copy_page_to_iter_pipe()
425 i->iov_offset = offset + bytes; in copy_page_to_iter_pipe()
428 i->count -= bytes; in copy_page_to_iter_pipe()
429 return bytes; in copy_page_to_iter_pipe()
595 static size_t copy_pipe_to_iter(const void *addr, size_t bytes, in copy_pipe_to_iter() argument
606 bytes = n = push_pipe(i, bytes, &i_head, &off); in copy_pipe_to_iter()
619 i->count -= bytes; in copy_pipe_to_iter()
620 return bytes; in copy_pipe_to_iter()
630 static size_t csum_and_copy_to_pipe_iter(const void *addr, size_t bytes, in csum_and_copy_to_pipe_iter() argument
643 bytes = push_pipe(i, bytes, &i_head, &r); in csum_and_copy_to_pipe_iter()
644 while (bytes) { in csum_and_copy_to_pipe_iter()
645 size_t chunk = min_t(size_t, bytes, PAGE_SIZE - r); in csum_and_copy_to_pipe_iter()
651 bytes -= chunk; in csum_and_copy_to_pipe_iter()
661 size_t _copy_to_iter(const void *addr, size_t bytes, struct iov_iter *i) in _copy_to_iter() argument
664 return copy_pipe_to_iter(addr, bytes, i); in _copy_to_iter()
667 iterate_and_advance(i, bytes, base, len, off, in _copy_to_iter()
672 return bytes; in _copy_to_iter()
686 static size_t copy_mc_pipe_to_iter(const void *addr, size_t bytes, in copy_mc_pipe_to_iter() argument
697 n = push_pipe(i, bytes, &i_head, &off); in copy_mc_pipe_to_iter()
743 size_t _copy_mc_to_iter(const void *addr, size_t bytes, struct iov_iter *i) in _copy_mc_to_iter() argument
746 return copy_mc_pipe_to_iter(addr, bytes, i); in _copy_mc_to_iter()
749 __iterate_and_advance(i, bytes, base, len, off, in _copy_mc_to_iter()
754 return bytes; in _copy_mc_to_iter()
759 size_t _copy_from_iter(void *addr, size_t bytes, struct iov_iter *i) in _copy_from_iter() argument
767 iterate_and_advance(i, bytes, base, len, off, in _copy_from_iter()
772 return bytes; in _copy_from_iter()
776 size_t _copy_from_iter_nocache(void *addr, size_t bytes, struct iov_iter *i) in _copy_from_iter_nocache() argument
782 iterate_and_advance(i, bytes, base, len, off, in _copy_from_iter_nocache()
787 return bytes; in _copy_from_iter_nocache()
808 size_t _copy_from_iter_flushcache(void *addr, size_t bytes, struct iov_iter *i) in _copy_from_iter_flushcache() argument
814 iterate_and_advance(i, bytes, base, len, off, in _copy_from_iter_flushcache()
819 return bytes; in _copy_from_iter_flushcache()
848 static size_t __copy_page_to_iter(struct page *page, size_t offset, size_t bytes, in __copy_page_to_iter() argument
852 return copy_page_to_iter_iovec(page, offset, bytes, i); in __copy_page_to_iter()
855 size_t wanted = _copy_to_iter(kaddr + offset, bytes, i); in __copy_page_to_iter()
860 return copy_page_to_iter_pipe(page, offset, bytes, i); in __copy_page_to_iter()
862 if (unlikely(i->count < bytes)) in __copy_page_to_iter()
863 bytes = i->count; in __copy_page_to_iter()
864 i->count -= bytes; in __copy_page_to_iter()
865 return bytes; in __copy_page_to_iter()
871 size_t copy_page_to_iter(struct page *page, size_t offset, size_t bytes, in copy_page_to_iter() argument
875 if (unlikely(!page_copy_sane(page, offset, bytes))) in copy_page_to_iter()
881 min(bytes, (size_t)PAGE_SIZE - offset), i); in copy_page_to_iter()
883 bytes -= n; in copy_page_to_iter()
884 if (!bytes || !n) in copy_page_to_iter()
896 size_t copy_page_from_iter(struct page *page, size_t offset, size_t bytes, in copy_page_from_iter() argument
899 if (unlikely(!page_copy_sane(page, offset, bytes))) in copy_page_from_iter()
902 return copy_page_from_iter_iovec(page, offset, bytes, i); in copy_page_from_iter()
905 size_t wanted = _copy_from_iter(kaddr + offset, bytes, i); in copy_page_from_iter()
914 static size_t pipe_zero(size_t bytes, struct iov_iter *i) in pipe_zero() argument
924 bytes = n = push_pipe(i, bytes, &i_head, &off); in pipe_zero()
939 i->count -= bytes; in pipe_zero()
940 return bytes; in pipe_zero()
943 size_t iov_iter_zero(size_t bytes, struct iov_iter *i) in iov_iter_zero() argument
946 return pipe_zero(bytes, i); in iov_iter_zero()
947 iterate_and_advance(i, bytes, base, len, count, in iov_iter_zero()
952 return bytes; in iov_iter_zero()
956 size_t copy_page_from_iter_atomic(struct page *page, unsigned offset, size_t bytes, in copy_page_from_iter_atomic() argument
960 if (unlikely(!page_copy_sane(page, offset, bytes))) { in copy_page_from_iter_atomic()
969 iterate_and_advance(i, bytes, base, len, off, in copy_page_from_iter_atomic()
974 return bytes; in copy_page_from_iter_atomic()
1699 size_t csum_and_copy_from_iter(void *addr, size_t bytes, __wsum *csum, in csum_and_copy_from_iter() argument
1708 iterate_and_advance(i, bytes, base, len, off, ({ in csum_and_copy_from_iter()
1717 return bytes; in csum_and_copy_from_iter()
1721 size_t csum_and_copy_to_iter(const void *addr, size_t bytes, void *_csstate, in csum_and_copy_to_iter() argument
1734 bytes = csum_and_copy_to_pipe_iter(addr, bytes, i, &sum); in csum_and_copy_to_iter()
1735 else iterate_and_advance(i, bytes, base, len, off, ({ in csum_and_copy_to_iter()
1744 csstate->off += bytes; in csum_and_copy_to_iter()
1745 return bytes; in csum_and_copy_to_iter()
1749 size_t hash_and_copy_to_iter(const void *addr, size_t bytes, void *hashp, in hash_and_copy_to_iter() argument
1757 copied = copy_to_iter(addr, bytes, i); in hash_and_copy_to_iter()