Lines Matching refs:iov
21 __p = i->iov; \
94 const struct iovec *iov; \
96 iterate_iovec(i, n, v, iov, skip, (I)) \
127 const struct iovec *iov; \
129 iterate_iovec(i, n, v, iov, skip, (I)) \
130 if (skip == iov->iov_len) { \
131 iov++; \
134 i->nr_segs -= iov - i->iov; \
135 i->iov = iov; \
168 const struct iovec *iov;
180 iov = i->iov;
182 buf = iov->iov_base + skip;
183 copy = min(bytes, iov->iov_len - skip);
197 iov++;
198 buf = iov->iov_base;
199 copy = min(bytes, iov->iov_len);
213 copy = min(bytes, iov->iov_len - skip);
225 iov++;
226 buf = iov->iov_base;
227 copy = min(bytes, iov->iov_len);
237 if (skip == iov->iov_len) {
238 iov++;
242 i->nr_segs -= iov - i->iov;
243 i->iov = iov;
252 const struct iovec *iov;
264 iov = i->iov;
266 buf = iov->iov_base + skip;
267 copy = min(bytes, iov->iov_len - skip);
281 iov++;
282 buf = iov->iov_base;
283 copy = min(bytes, iov->iov_len);
297 copy = min(bytes, iov->iov_len - skip);
309 iov++;
310 buf = iov->iov_base;
311 copy = min(bytes, iov->iov_len);
321 if (skip == iov->iov_len) {
322 iov++;
326 i->nr_segs -= iov - i->iov;
327 i->iov = iov;
434 const struct iovec *iov;
439 iterate_iovec(i, bytes, v, iov, skip, ({
450 const struct iovec *iov, unsigned long nr_segs,
459 i->kvec = (struct kvec *)iov;
462 i->iov = iov;
1130 const struct iovec *iov = i->iov;
1132 size_t n = (--iov)->iov_len;
1135 i->iov = iov;
1159 return min(i->count, i->iov->iov_len - i->iov_offset);
1644 return new->iov = kmemdup(new->iov,
1650 static int copy_compat_iovec_from_user(struct iovec *iov,
1672 iov[i].iov_base = compat_ptr(buf);
1673 iov[i].iov_len = len;
1682 static int copy_iovec_from_user(struct iovec *iov,
1687 if (copy_from_user(iov, uvec, nr_segs * sizeof(*uvec)))
1690 if ((ssize_t)iov[seg].iov_len < 0)
1701 struct iovec *iov = fast_iov;
1710 return iov;
1714 iov = kmalloc_array(nr_segs, sizeof(struct iovec), GFP_KERNEL);
1715 if (!iov)
1720 ret = copy_compat_iovec_from_user(iov, uvec, nr_segs);
1722 ret = copy_iovec_from_user(iov, uvec, nr_segs);
1724 if (iov != fast_iov)
1725 kfree(iov);
1729 return iov;
1738 struct iovec *iov;
1740 iov = iovec_from_user(uvec, nr_segs, fast_segs, *iovp, compat);
1741 if (IS_ERR(iov)) {
1743 return PTR_ERR(iov);
1755 ssize_t len = (ssize_t)iov[seg].iov_len;
1757 if (!access_ok(iov[seg].iov_base, len)) {
1758 if (iov != *iovp)
1759 kfree(iov);
1766 iov[seg].iov_len = len;
1771 iov_iter_init(i, type, iov, nr_segs, total_len);
1772 if (iov == *iovp)
1775 *iovp = iov;
1787 * @fast_segs: Number of elements in @iov.
1792 * If the array pointed to by *@iov is large enough to hold all @nr_segs,
1793 * then this function places %NULL in *@iov on return. Otherwise, a new
1794 * array will be allocated and the result placed in *@iov. This means that
1795 * the caller may call kfree() on *@iov regardless of whether the small
1811 struct iovec *iov, struct iov_iter *i)
1818 iov->iov_base = buf;
1819 iov->iov_len = len;
1820 iov_iter_init(i, rw, iov, 1, len);
1845 * For the *vec iters, nr_segs + iov is constant - if we increment
1849 * size, so we can just increment the iov pointer as they are unionzed.
1857 i->iov -= state->nr_segs - i->nr_segs;