Lines Matching refs:iov_len

184 	unsigned int buflen = head->iov_len;  in xdr_inline_pages()
186 head->iov_len = offset; in xdr_inline_pages()
193 tail->iov_len = buflen - offset; in xdr_inline_pages()
428 if (base >= iov->iov_len) in xdr_buf_iov_zero()
430 if (len > iov->iov_len - base) in xdr_buf_iov_zero()
431 len = iov->iov_len - base; in xdr_buf_iov_zero()
488 if (buflen <= buf->head->iov_len) in xdr_buf_pages_fill_sparse()
490 pagelen = buflen - buf->head->iov_len; in xdr_buf_pages_fill_sparse()
513 unsigned int sum = head->iov_len + buf->page_len + tail->iov_len; in xdr_buf_try_expand()
530 tail->iov_len += free_space; in xdr_buf_try_expand()
542 if (to >= tail->iov_len) in xdr_buf_tail_copy_right()
544 if (len + to > tail->iov_len) in xdr_buf_tail_copy_right()
545 len = tail->iov_len - to; in xdr_buf_tail_copy_right()
564 if (tail->iov_len >= len + tato) in xdr_buf_pages_copy_right()
566 else if (tail->iov_len > tato) in xdr_buf_pages_copy_right()
567 talen = tail->iov_len - tato; in xdr_buf_pages_copy_right()
571 if (talen > tail->iov_len) in xdr_buf_pages_copy_right()
572 talen = tail->iov_len; in xdr_buf_pages_copy_right()
592 if (base >= head->iov_len) in xdr_buf_head_copy_right()
594 if (len > head->iov_len - base) in xdr_buf_head_copy_right()
595 len = head->iov_len - base; in xdr_buf_head_copy_right()
596 if (to >= buf->page_len + head->iov_len) { in xdr_buf_head_copy_right()
597 tato = to - buf->page_len - head->iov_len; in xdr_buf_head_copy_right()
599 } else if (to >= head->iov_len) { in xdr_buf_head_copy_right()
600 pgto = to - head->iov_len; in xdr_buf_head_copy_right()
616 if (talen + tato > tail->iov_len) in xdr_buf_head_copy_right()
617 talen = tail->iov_len > tato ? tail->iov_len - tato : 0; in xdr_buf_head_copy_right()
635 if (base >= tail->iov_len || !shift || !len) in xdr_buf_tail_shift_right()
664 if (base >= head->iov_len) { in xdr_buf_head_shift_right()
665 xdr_buf_pages_shift_right(buf, head->iov_len - base, len, in xdr_buf_head_shift_right()
669 if (base + len > head->iov_len) in xdr_buf_head_shift_right()
670 xdr_buf_pages_shift_right(buf, 0, base + len - head->iov_len, in xdr_buf_head_shift_right()
680 if (base >= tail->iov_len) in xdr_buf_tail_copy_left()
682 if (len > tail->iov_len - base) in xdr_buf_tail_copy_left()
683 len = tail->iov_len - base; in xdr_buf_tail_copy_left()
688 head->iov_len + buf->page_len + base - shift; in xdr_buf_tail_copy_left()
691 if (WARN_ONCE(shift > head->iov_len + buf->page_len + base, in xdr_buf_tail_copy_left()
694 if (hdto + hdlen > head->iov_len) in xdr_buf_tail_copy_left()
695 hdlen = head->iov_len - hdto; in xdr_buf_tail_copy_left()
732 unsigned int hdto = head->iov_len + base - shift; in xdr_buf_pages_copy_left()
735 if (WARN_ONCE(shift > head->iov_len + base, in xdr_buf_pages_copy_left()
738 if (hdto + hdlen > head->iov_len) in xdr_buf_pages_copy_left()
739 hdlen = head->iov_len - hdto; in xdr_buf_pages_copy_left()
796 if (base < head->iov_len) { in xdr_buf_head_shift_left()
797 bytes = min_t(unsigned int, len, head->iov_len - base); in xdr_buf_head_shift_left()
803 xdr_buf_pages_shift_left(buf, base - head->iov_len, len, shift); in xdr_buf_head_shift_left()
820 WARN_ON_ONCE(len > head->iov_len); in xdr_shrink_bufhead()
821 if (head->iov_len > buflen) { in xdr_shrink_bufhead()
822 buf->buflen -= head->iov_len - buflen; in xdr_shrink_bufhead()
823 head->iov_len = buflen; in xdr_shrink_bufhead()
825 if (len >= head->iov_len) in xdr_shrink_bufhead()
827 shift = head->iov_len - len; in xdr_shrink_bufhead()
830 head->iov_len = len; in xdr_shrink_bufhead()
846 unsigned int shift, buflen = buf->len - buf->head->iov_len; in xdr_shrink_pagelen()
849 if (buf->head->iov_len >= buf->len || len > buflen) in xdr_shrink_pagelen()
869 xdr_shrink_bufhead(buf, buf->head->iov_len - len); in xdr_shift_buf()
892 xdr_stream_set_pos(xdr, pos + xdr->buf->head[0].iov_len); in xdr_stream_page_set_pos()
903 WARN_ON(pos < xdr->buf->head[0].iov_len); in xdr_page_pos()
904 return pos - xdr->buf->head[0].iov_len; in xdr_page_pos()
926 int scratch_len = buf->buflen - buf->page_len - buf->tail[0].iov_len; in xdr_init_encode()
932 xdr->p = (__be32 *)((char *)iov->iov_base + iov->iov_len); in xdr_init_encode()
934 BUG_ON(iov->iov_len > scratch_len); in xdr_init_encode()
943 iov->iov_len += len; in xdr_init_encode()
986 size_t shift = xdr->scratch.iov_len; in __xdr_commit_encode()
1015 xdr->iov->iov_len += frag1bytes; in xdr_get_next_encode_buffer()
1073 xdr->iov->iov_len += nbytes; in xdr_reserve_space()
1117 vec[v].iov_len = thislen; in xdr_reserve_space_vec()
1159 fraglen = min_t(int, buf->len - len, tail->iov_len); in xdr_truncate_encode()
1160 tail->iov_len -= fraglen; in xdr_truncate_encode()
1162 if (tail->iov_len) { in xdr_truncate_encode()
1163 xdr->p = tail->iov_base + tail->iov_len; in xdr_truncate_encode()
1185 xdr->end = head->iov_base + head->iov_len; in xdr_truncate_encode()
1188 head->iov_len = len; in xdr_truncate_encode()
1190 xdr->p = head->iov_base + head->iov_len; in xdr_truncate_encode()
1242 iov->iov_len = 0; in xdr_write_pages()
1250 iov->iov_len += pad; in xdr_write_pages()
1262 if (len > iov->iov_len) in xdr_set_iov()
1263 len = iov->iov_len; in xdr_set_iov()
1278 xdr_stream_set_pos(xdr, base + buf->page_len + buf->head->iov_len); in xdr_set_tail_base()
1409 if (nbytes > xdr->scratch.iov_len) in xdr_copy_to_scratch()
1465 if (iov->iov_len > cur) { in xdr_realign_pages()
1577 static const struct kvec empty_iov = {.iov_base = NULL, .iov_len = 0};
1584 buf->buflen = buf->len = iov->iov_len; in xdr_buf_from_iov()
1606 if (base < buf->head[0].iov_len) { in xdr_buf_subsegment()
1608 subbuf->head[0].iov_len = min_t(unsigned int, len, in xdr_buf_subsegment()
1609 buf->head[0].iov_len - base); in xdr_buf_subsegment()
1610 len -= subbuf->head[0].iov_len; in xdr_buf_subsegment()
1613 base -= buf->head[0].iov_len; in xdr_buf_subsegment()
1615 subbuf->head[0].iov_len = 0; in xdr_buf_subsegment()
1632 if (base < buf->tail[0].iov_len) { in xdr_buf_subsegment()
1634 subbuf->tail[0].iov_len = min_t(unsigned int, len, in xdr_buf_subsegment()
1635 buf->tail[0].iov_len - base); in xdr_buf_subsegment()
1636 len -= subbuf->tail[0].iov_len; in xdr_buf_subsegment()
1639 base -= buf->tail[0].iov_len; in xdr_buf_subsegment()
1641 subbuf->tail[0].iov_len = 0; in xdr_buf_subsegment()
1741 if (buf.head[0].iov_len) in xdr_stream_zero()
1742 xdr_buf_iov_zero(buf.head, 0, buf.head[0].iov_len); in xdr_stream_zero()
1745 if (buf.tail[0].iov_len) in xdr_stream_zero()
1746 xdr_buf_iov_zero(buf.tail, 0, buf.tail[0].iov_len); in xdr_stream_zero()
1766 if (buf->tail[0].iov_len) { in xdr_buf_trim()
1767 cur = min_t(size_t, buf->tail[0].iov_len, trim); in xdr_buf_trim()
1768 buf->tail[0].iov_len -= cur; in xdr_buf_trim()
1782 if (buf->head[0].iov_len) { in xdr_buf_trim()
1783 cur = min_t(size_t, buf->head[0].iov_len, trim); in xdr_buf_trim()
1784 buf->head[0].iov_len -= cur; in xdr_buf_trim()
1797 this_len = min_t(unsigned int, len, subbuf->head[0].iov_len); in __read_bytes_from_xdr_buf()
1805 this_len = min_t(unsigned int, len, subbuf->tail[0].iov_len); in __read_bytes_from_xdr_buf()
1829 this_len = min_t(unsigned int, len, subbuf->head[0].iov_len); in __write_bytes_to_xdr_buf()
1837 this_len = min_t(unsigned int, len, subbuf->tail[0].iov_len); in __write_bytes_to_xdr_buf()
1904 if (todo && base < buf->head->iov_len) { in xdr_xcode_array2()
1907 buf->head->iov_len - base); in xdr_xcode_array2()
1933 base = buf->head->iov_len; /* align to start of pages */ in xdr_xcode_array2()
1937 base -= buf->head->iov_len; in xdr_xcode_array2()
2085 buf->head->iov_len + buf->page_len + buf->tail->iov_len) in xdr_encode_array2()
2102 if (offset >= buf->head[0].iov_len) { in xdr_process_buf()
2103 offset -= buf->head[0].iov_len; in xdr_process_buf()
2105 thislen = buf->head[0].iov_len - offset; in xdr_process_buf()
2144 if (offset < buf->tail[0].iov_len) { in xdr_process_buf()
2145 thislen = buf->tail[0].iov_len - offset; in xdr_process_buf()