Lines Matching refs:iov_len
182 if (head->iov_len) {
183 bvec_set_virt(bvec++, head->iov_base, head->iov_len);
204 if (tail->iov_len) {
205 bvec_set_virt(bvec, tail->iov_base, tail->iov_len);
233 unsigned int buflen = head->iov_len;
235 head->iov_len = offset;
242 tail->iov_len = buflen - offset;
477 if (base >= iov->iov_len)
479 if (len > iov->iov_len - base)
480 len = iov->iov_len - base;
537 if (buflen <= buf->head->iov_len)
539 pagelen = buflen - buf->head->iov_len;
562 unsigned int sum = head->iov_len + buf->page_len + tail->iov_len;
579 tail->iov_len += free_space;
591 if (to >= tail->iov_len)
593 if (len + to > tail->iov_len)
594 len = tail->iov_len - to;
613 if (tail->iov_len >= len + tato)
615 else if (tail->iov_len > tato)
616 talen = tail->iov_len - tato;
620 if (talen > tail->iov_len)
621 talen = tail->iov_len;
641 if (base >= head->iov_len)
643 if (len > head->iov_len - base)
644 len = head->iov_len - base;
645 if (to >= buf->page_len + head->iov_len) {
646 tato = to - buf->page_len - head->iov_len;
648 } else if (to >= head->iov_len) {
649 pgto = to - head->iov_len;
665 if (talen + tato > tail->iov_len)
666 talen = tail->iov_len > tato ? tail->iov_len - tato : 0;
684 if (base >= tail->iov_len || !shift || !len)
713 if (base >= head->iov_len) {
714 xdr_buf_pages_shift_right(buf, head->iov_len - base, len,
718 if (base + len > head->iov_len)
719 xdr_buf_pages_shift_right(buf, 0, base + len - head->iov_len,
729 if (base >= tail->iov_len)
731 if (len > tail->iov_len - base)
732 len = tail->iov_len - base;
737 head->iov_len + buf->page_len + base - shift;
740 if (WARN_ONCE(shift > head->iov_len + buf->page_len + base,
743 if (hdto + hdlen > head->iov_len)
744 hdlen = head->iov_len - hdto;
781 unsigned int hdto = head->iov_len + base - shift;
784 if (WARN_ONCE(shift > head->iov_len + base,
787 if (hdto + hdlen > head->iov_len)
788 hdlen = head->iov_len - hdto;
845 if (base < head->iov_len) {
846 bytes = min_t(unsigned int, len, head->iov_len - base);
852 xdr_buf_pages_shift_left(buf, base - head->iov_len, len, shift);
869 WARN_ON_ONCE(len > head->iov_len);
870 if (head->iov_len > buflen) {
871 buf->buflen -= head->iov_len - buflen;
872 head->iov_len = buflen;
874 if (len >= head->iov_len)
876 shift = head->iov_len - len;
879 head->iov_len = len;
895 unsigned int shift, buflen = buf->len - buf->head->iov_len;
898 if (buf->head->iov_len >= buf->len || len > buflen)
934 xdr_stream_set_pos(xdr, pos + xdr->buf->head[0].iov_len);
945 WARN_ON(pos < xdr->buf->head[0].iov_len);
946 return pos - xdr->buf->head[0].iov_len;
968 int scratch_len = buf->buflen - buf->page_len - buf->tail[0].iov_len;
974 xdr->p = (__be32 *)((char *)iov->iov_base + iov->iov_len);
976 BUG_ON(iov->iov_len > scratch_len);
985 iov->iov_len += len;
1028 size_t shift = xdr->scratch.iov_len;
1057 xdr->iov->iov_len += frag1bytes;
1115 xdr->iov->iov_len += nbytes;
1199 fraglen = min_t(int, buf->len - len, tail->iov_len);
1200 tail->iov_len -= fraglen;
1202 if (tail->iov_len) {
1203 xdr->p = tail->iov_base + tail->iov_len;
1225 xdr->end = head->iov_base + head->iov_len;
1228 head->iov_len = len;
1230 xdr->p = head->iov_base + head->iov_len;
1301 tail->iov_len = 0;
1309 tail->iov_len += pad;
1321 if (len > iov->iov_len)
1322 len = iov->iov_len;
1337 xdr_stream_set_pos(xdr, base + buf->page_len + buf->head->iov_len);
1493 if (nbytes > xdr->scratch.iov_len)
1549 if (iov->iov_len > cur) {
1661 static const struct kvec empty_iov = {.iov_base = NULL, .iov_len = 0};
1668 buf->buflen = buf->len = iov->iov_len;
1690 if (base < buf->head[0].iov_len) {
1692 subbuf->head[0].iov_len = min_t(unsigned int, len,
1693 buf->head[0].iov_len - base);
1694 len -= subbuf->head[0].iov_len;
1697 base -= buf->head[0].iov_len;
1699 subbuf->head[0].iov_len = 0;
1716 if (base < buf->tail[0].iov_len) {
1718 subbuf->tail[0].iov_len = min_t(unsigned int, len,
1719 buf->tail[0].iov_len - base);
1720 len -= subbuf->tail[0].iov_len;
1723 base -= buf->tail[0].iov_len;
1725 subbuf->tail[0].iov_len = 0;
1825 if (buf.head[0].iov_len)
1826 xdr_buf_iov_zero(buf.head, 0, buf.head[0].iov_len);
1829 if (buf.tail[0].iov_len)
1830 xdr_buf_iov_zero(buf.tail, 0, buf.tail[0].iov_len);
1850 if (buf->tail[0].iov_len) {
1851 cur = min_t(size_t, buf->tail[0].iov_len, trim);
1852 buf->tail[0].iov_len -= cur;
1866 if (buf->head[0].iov_len) {
1867 cur = min_t(size_t, buf->head[0].iov_len, trim);
1868 buf->head[0].iov_len -= cur;
1881 this_len = min_t(unsigned int, len, subbuf->head[0].iov_len);
1889 this_len = min_t(unsigned int, len, subbuf->tail[0].iov_len);
1913 this_len = min_t(unsigned int, len, subbuf->head[0].iov_len);
1921 this_len = min_t(unsigned int, len, subbuf->tail[0].iov_len);
1988 if (todo && base < buf->head->iov_len) {
1991 buf->head->iov_len - base);
2017 base = buf->head->iov_len; /* align to start of pages */
2021 base -= buf->head->iov_len;
2169 buf->head->iov_len + buf->page_len + buf->tail->iov_len)
2186 if (offset >= buf->head[0].iov_len) {
2187 offset -= buf->head[0].iov_len;
2189 thislen = buf->head[0].iov_len - offset;
2228 if (offset < buf->tail[0].iov_len) {
2229 thislen = buf->tail[0].iov_len - offset;