Lines Matching refs:iov
80 * @iov: an iov passed to vringh_getdesc_*() (updated as we consume)
83 void vringh_kiov_advance(struct vringh_kiov *iov, size_t len)
85 while (len && iov->i < iov->used) {
86 size_t partlen = min(iov->iov[iov->i].iov_len, len);
88 iov->consumed += partlen;
89 iov->iov[iov->i].iov_len -= partlen;
90 iov->iov[iov->i].iov_base += partlen;
92 if (!iov->iov[iov->i].iov_len) {
93 /* Fix up old iov element then increment. */
94 iov->iov[iov->i].iov_len = iov->consumed;
95 iov->iov[iov->i].iov_base -= iov->consumed;
97 iov->consumed = 0;
98 iov->i++;
108 struct vringh_kiov *iov,
116 while (len && iov->i < iov->used) {
119 partlen = min(iov->iov[iov->i].iov_len, len);
120 err = xfer(vrh, iov->iov[iov->i].iov_base, ptr, partlen);
126 iov->consumed += partlen;
127 iov->iov[iov->i].iov_len -= partlen;
128 iov->iov[iov->i].iov_base += partlen;
130 if (!iov->iov[iov->i].iov_len) {
131 /* Fix up old iov element then increment. */
132 iov->iov[iov->i].iov_len = iov->consumed;
133 iov->iov[iov->i].iov_base -= iov->consumed;
135 iov->consumed = 0;
136 iov->i++;
218 static int resize_iovec(struct vringh_kiov *iov, gfp_t gfp)
221 unsigned int flag, new_num = (iov->max_num & ~VRINGH_IOV_ALLOCATED) * 2;
226 flag = (iov->max_num & VRINGH_IOV_ALLOCATED);
228 new = krealloc_array(iov->iov, new_num,
233 memcpy(new, iov->iov,
234 iov->max_num * sizeof(struct iovec));
240 iov->iov = new;
241 iov->max_num = (new_num | flag);
326 struct vringh_kiov *iov;
374 iov = wiov;
376 iov = riov;
385 if (!iov) {
403 if (unlikely(iov->used == (iov->max_num & ~VRINGH_IOV_ALLOCATED))) {
404 err = resize_iovec(iov, gfp);
409 iov->iov[iov->used].iov_base = addr;
410 iov->iov[iov->used].iov_len = len;
411 iov->used++;
723 BUILD_BUG_ON(offsetof(struct vringh_kiov, iov) !=
724 offsetof(struct vringh_iov, iov));
1111 } iov;
1150 struct iovec *iovec = ivec->iov.iovec;
1156 struct bio_vec *bvec = ivec->iov.bvec;
1184 } iov;
1187 ivec.iov.iovec = iov.iovec;
1204 iov_iter_init(&iter, ITER_SOURCE, ivec.iov.iovec, ret,
1207 iov_iter_bvec(&iter, ITER_SOURCE, ivec.iov.bvec, ret,
1230 } iov;
1233 ivec.iov.iovec = iov.iovec;
1250 iov_iter_init(&iter, ITER_DEST, ivec.iov.iovec, ret,
1253 iov_iter_bvec(&iter, ITER_DEST, ivec.iov.bvec, ret,
1276 } iov;
1280 ivec.iov.iovec = iov.iovec;
1290 ret = __get_user(tmp, (__virtio16 __user *)ivec.iov.iovec[0].iov_base);
1294 void *kaddr = kmap_local_page(ivec.iov.bvec[0].bv_page);
1295 void *from = kaddr + ivec.iov.bvec[0].bv_offset;
1313 } iov;
1317 ivec.iov.iovec = &iov.iovec;
1329 ret = __put_user(tmp, (__virtio16 __user *)ivec.iov.iovec[0].iov_base);
1333 void *kaddr = kmap_local_page(ivec.iov.bvec[0].bv_page);
1334 void *to = kaddr + ivec.iov.bvec[0].bv_offset;