Lines Matching full:tail
184 struct kvec *tail = xdr->tail; in xdr_inline_pages() local
194 tail->iov_base = buf + offset; in xdr_inline_pages()
195 tail->iov_len = buflen - offset; in xdr_inline_pages()
197 tail->iov_len -= sizeof(__be32); in xdr_inline_pages()
272 struct kvec *tail = buf->tail; in _shift_data_left_tail() local
274 if (len > tail->iov_len) in _shift_data_left_tail()
275 len = tail->iov_len; in _shift_data_left_tail()
279 (char *)tail->iov_base, in _shift_data_left_tail()
281 tail->iov_len -= len; in _shift_data_left_tail()
283 if (tail->iov_len > 0) in _shift_data_left_tail()
284 memmove((char *)tail->iov_base, in _shift_data_left_tail()
285 tail->iov_base + len, in _shift_data_left_tail()
286 tail->iov_len); in _shift_data_left_tail()
357 struct kvec *tail = buf->tail; in _shift_data_right_tail() local
364 /* Shift the tail first */ in _shift_data_right_tail()
366 unsigned int free_space = tailbuf_len - tail->iov_len; in _shift_data_right_tail()
373 tail->iov_len += free_space; in _shift_data_right_tail()
376 if (tail->iov_len > len) { in _shift_data_right_tail()
377 char *p = (char *)tail->iov_base + len; in _shift_data_right_tail()
378 memmove(p, tail->iov_base, tail->iov_len - free_space); in _shift_data_right_tail()
379 result += tail->iov_len - free_space; in _shift_data_right_tail()
381 copy = tail->iov_len; in _shift_data_right_tail()
383 /* Copy from the inlined pages into the tail */ in _shift_data_right_tail()
384 _copy_from_pages((char *)tail->iov_base, in _shift_data_right_tail()
517 * moved into the inlined pages and/or the tail.
522 struct kvec *head, *tail; in xdr_shrink_bufhead() local
528 tail = buf->tail; in xdr_shrink_bufhead()
535 /* Shift the tail first */ in xdr_shrink_bufhead()
536 if (tail->iov_len != 0) { in xdr_shrink_bufhead()
537 if (tail->iov_len > len) { in xdr_shrink_bufhead()
538 copy = tail->iov_len - len; in xdr_shrink_bufhead()
539 memmove((char *)tail->iov_base + len, in xdr_shrink_bufhead()
540 tail->iov_base, copy); in xdr_shrink_bufhead()
543 /* Copy from the inlined pages into the tail */ in xdr_shrink_bufhead()
548 if (offs >= tail->iov_len) in xdr_shrink_bufhead()
550 else if (copy > tail->iov_len - offs) in xdr_shrink_bufhead()
551 copy = tail->iov_len - offs; in xdr_shrink_bufhead()
553 _copy_from_pages((char *)tail->iov_base + offs, in xdr_shrink_bufhead()
559 /* Do we also need to copy data from the head into the tail ? */ in xdr_shrink_bufhead()
562 if (copy > tail->iov_len) in xdr_shrink_bufhead()
563 copy = tail->iov_len; in xdr_shrink_bufhead()
564 memcpy(tail->iov_base, in xdr_shrink_bufhead()
600 * The extra data is not lost, but is instead moved into buf->tail.
670 int scratch_len = buf->buflen - buf->page_len - buf->tail[0].iov_len; in xdr_init_encode()
851 * head, tail, and page lengths are adjusted to correspond.
860 * simple case of truncating from one position in the tail to another.
867 struct kvec *tail = buf->tail; in xdr_truncate_encode() local
877 fraglen = min_t(int, buf->len - len, tail->iov_len); in xdr_truncate_encode()
878 tail->iov_len -= fraglen; in xdr_truncate_encode()
880 if (tail->iov_len) { in xdr_truncate_encode()
881 xdr->p = tail->iov_base + tail->iov_len; in xdr_truncate_encode()
954 struct kvec *iov = buf->tail; in xdr_write_pages()
1025 xdr_set_iov(xdr, xdr->buf->tail, xdr->nwords << 2); in xdr_set_page()
1214 /* Truncate page data and move it into the tail */ in xdr_align_pages()
1230 * bytes is moved into the XDR tail[].
1247 xdr->iov = iov = buf->tail; in xdr_read_pages()
1254 * Position current pointer at beginning of tail, and in xdr_read_pages()
1290 /* Move tail data into the pages, if necessary */ in xdr_align_data()
1345 * bytes is moved into the XDR tail[]. The current pointer is then
1352 * Position current pointer at beginning of tail, and in xdr_enter_page()
1366 buf->tail[0] = empty_iov; in xdr_buf_from_iov()
1417 if (base < buf->tail[0].iov_len) { in xdr_buf_subsegment()
1418 subbuf->tail[0].iov_base = buf->tail[0].iov_base + base; in xdr_buf_subsegment()
1419 subbuf->tail[0].iov_len = min_t(unsigned int, len, in xdr_buf_subsegment()
1420 buf->tail[0].iov_len - base); in xdr_buf_subsegment()
1421 len -= subbuf->tail[0].iov_len; in xdr_buf_subsegment()
1424 base -= buf->tail[0].iov_len; in xdr_buf_subsegment()
1425 subbuf->tail[0].iov_base = buf->tail[0].iov_base; in xdr_buf_subsegment()
1426 subbuf->tail[0].iov_len = 0; in xdr_buf_subsegment()
1450 if (buf->tail[0].iov_len) { in xdr_buf_trim()
1451 cur = min_t(size_t, buf->tail[0].iov_len, trim); in xdr_buf_trim()
1452 buf->tail[0].iov_len -= cur; in xdr_buf_trim()
1489 this_len = min_t(unsigned int, len, subbuf->tail[0].iov_len); in __read_bytes_from_xdr_buf()
1490 memcpy(obj, subbuf->tail[0].iov_base, this_len); in __read_bytes_from_xdr_buf()
1520 this_len = min_t(unsigned int, len, subbuf->tail[0].iov_len); in __write_bytes_to_xdr_buf()
1521 memcpy(subbuf->tail[0].iov_base, obj, this_len); in __write_bytes_to_xdr_buf()
1718 base = buf->page_len; /* align to start of tail */ in xdr_xcode_array2()
1721 /* process tail */ in xdr_xcode_array2()
1724 c = buf->tail->iov_base + base; in xdr_xcode_array2()
1772 buf->head->iov_len + buf->page_len + buf->tail->iov_len) in xdr_encode_array2()
1831 if (offset < buf->tail[0].iov_len) { in xdr_process_buf()
1832 thislen = buf->tail[0].iov_len - offset; in xdr_process_buf()
1835 sg_set_buf(sg, buf->tail[0].iov_base + offset, thislen); in xdr_process_buf()