Lines Matching refs:offset
26 size_t offset, const void *buf, size_t bytes) in iov_from_buf_full() argument
30 for (i = 0, done = 0; (offset || done < bytes) && i < iov_cnt; i++) { in iov_from_buf_full()
31 if (offset < iov[i].iov_len) { in iov_from_buf_full()
32 size_t len = MIN(iov[i].iov_len - offset, bytes - done); in iov_from_buf_full()
33 memcpy(iov[i].iov_base + offset, buf + done, len); in iov_from_buf_full()
35 offset = 0; in iov_from_buf_full()
37 offset -= iov[i].iov_len; in iov_from_buf_full()
44 size_t offset, void *buf, size_t bytes) in iov_to_buf_full() argument
48 for (i = 0, done = 0; (offset || done < bytes) && i < iov_cnt; i++) { in iov_to_buf_full()
49 if (offset < iov[i].iov_len) { in iov_to_buf_full()
50 size_t len = MIN(iov[i].iov_len - offset, bytes - done); in iov_to_buf_full()
51 memcpy(buf + done, iov[i].iov_base + offset, len); in iov_to_buf_full()
53 offset = 0; in iov_to_buf_full()
55 offset -= iov[i].iov_len; in iov_to_buf_full()
62 size_t offset, int fillc, size_t bytes) in iov_memset() argument
66 for (i = 0, done = 0; (offset || done < bytes) && i < iov_cnt; i++) { in iov_memset()
67 if (offset < iov[i].iov_len) { in iov_memset()
68 size_t len = MIN(iov[i].iov_len - offset, bytes - done); in iov_memset()
69 memset(iov[i].iov_base + offset, fillc, len); in iov_memset()
71 offset = 0; in iov_memset()
73 offset -= iov[i].iov_len; in iov_memset()
144 size_t offset, size_t bytes, in iov_send_recv() argument
147 return iov_send_recv_with_flags(sockfd, 0, _iov, iov_cnt, offset, bytes, in iov_send_recv()
153 unsigned iov_cnt, size_t offset, in iov_send_recv_with_flags() argument
167 iov_copy(local_iov, iov_cnt, _iov, iov_cnt, offset, bytes); in iov_send_recv_with_flags()
168 offset = 0; in iov_send_recv_with_flags()
174 for (niov = 0; niov < iov_cnt && offset >= iov[niov].iov_len; ++niov) { in iov_send_recv_with_flags()
175 offset -= iov[niov].iov_len; in iov_send_recv_with_flags()
184 if (offset) { in iov_send_recv_with_flags()
187 iov[0].iov_base += offset; in iov_send_recv_with_flags()
188 iov[0].iov_len -= offset; in iov_send_recv_with_flags()
209 if (offset) { in iov_send_recv_with_flags()
210 iov[0].iov_base -= offset; in iov_send_recv_with_flags()
211 iov[0].iov_len += offset; in iov_send_recv_with_flags()
230 offset += ret; in iov_send_recv_with_flags()
259 size_t offset, size_t bytes) in iov_copy() argument
264 i < iov_cnt && j < dst_iov_cnt && (offset || bytes); i++) { in iov_copy()
265 if (offset >= iov[i].iov_len) { in iov_copy()
266 offset -= iov[i].iov_len; in iov_copy()
269 len = MIN(bytes, iov[i].iov_len - offset); in iov_copy()
271 dst_iov[j].iov_base = iov[i].iov_base + offset; in iov_copy()
275 offset = 0; in iov_copy()
374 static struct iovec *iov_skip_offset(struct iovec *iov, size_t offset, in iov_skip_offset() argument
377 while (offset > 0 && offset >= iov->iov_len) { in iov_skip_offset()
378 offset -= iov->iov_len; in iov_skip_offset()
381 *remaining_offset = offset; in iov_skip_offset()
394 size_t offset, size_t len, in qemu_iovec_slice() argument
399 assert(offset + len <= qiov->size); in qemu_iovec_slice()
401 iov = iov_skip_offset(qiov->iov, offset, head); in qemu_iovec_slice()
415 int qemu_iovec_subvec_niov(QEMUIOVector *qiov, size_t offset, size_t len) in qemu_iovec_subvec_niov() argument
420 qemu_iovec_slice(qiov, offset, len, &head, &tail, &niov); in qemu_iovec_subvec_niov()
428 bool qemu_iovec_is_zero(QEMUIOVector *qiov, size_t offset, size_t bytes) in qemu_iovec_is_zero() argument
433 assert(offset + bytes <= qiov->size); in qemu_iovec_is_zero()
435 iov = iov_skip_offset(qiov->iov, offset, ¤t_offset); in qemu_iovec_is_zero()
454 size_t offset, size_t len) in qemu_iovec_init_slice() argument
461 assert(source->size - len >= offset); in qemu_iovec_init_slice()
463 slice_iov = qemu_iovec_slice(source, offset, len, in qemu_iovec_init_slice()
490 size_t qemu_iovec_to_buf(QEMUIOVector *qiov, size_t offset, in qemu_iovec_to_buf() argument
493 return iov_to_buf(qiov->iov, qiov->niov, offset, buf, bytes); in qemu_iovec_to_buf()
496 size_t qemu_iovec_from_buf(QEMUIOVector *qiov, size_t offset, in qemu_iovec_from_buf() argument
499 return iov_from_buf(qiov->iov, qiov->niov, offset, buf, bytes); in qemu_iovec_from_buf()
502 size_t qemu_iovec_memset(QEMUIOVector *qiov, size_t offset, in qemu_iovec_memset() argument
505 return iov_memset(qiov->iov, qiov->niov, offset, fillc, bytes); in qemu_iovec_memset()
521 ssize_t offset = 0; in qemu_iovec_compare() local
534 offset += len; in qemu_iovec_compare()
537 return offset; in qemu_iovec_compare()