Lines Matching refs:subbuf

1686 int xdr_buf_subsegment(const struct xdr_buf *buf, struct xdr_buf *subbuf,  in xdr_buf_subsegment()  argument
1689 subbuf->buflen = subbuf->len = len; in xdr_buf_subsegment()
1691 subbuf->head[0].iov_base = buf->head[0].iov_base + base; in xdr_buf_subsegment()
1692 subbuf->head[0].iov_len = min_t(unsigned int, len, in xdr_buf_subsegment()
1694 len -= subbuf->head[0].iov_len; in xdr_buf_subsegment()
1698 subbuf->head[0].iov_base = buf->head[0].iov_base; in xdr_buf_subsegment()
1699 subbuf->head[0].iov_len = 0; in xdr_buf_subsegment()
1703 subbuf->page_len = min(buf->page_len - base, len); in xdr_buf_subsegment()
1705 subbuf->page_base = base & ~PAGE_MASK; in xdr_buf_subsegment()
1706 subbuf->pages = &buf->pages[base >> PAGE_SHIFT]; in xdr_buf_subsegment()
1707 len -= subbuf->page_len; in xdr_buf_subsegment()
1711 subbuf->pages = buf->pages; in xdr_buf_subsegment()
1712 subbuf->page_base = 0; in xdr_buf_subsegment()
1713 subbuf->page_len = 0; in xdr_buf_subsegment()
1717 subbuf->tail[0].iov_base = buf->tail[0].iov_base + base; in xdr_buf_subsegment()
1718 subbuf->tail[0].iov_len = min_t(unsigned int, len, in xdr_buf_subsegment()
1720 len -= subbuf->tail[0].iov_len; in xdr_buf_subsegment()
1724 subbuf->tail[0].iov_base = buf->tail[0].iov_base; in xdr_buf_subsegment()
1725 subbuf->tail[0].iov_len = 0; in xdr_buf_subsegment()
1749 bool xdr_stream_subsegment(struct xdr_stream *xdr, struct xdr_buf *subbuf, in xdr_stream_subsegment() argument
1756 if (xdr_buf_subsegment(xdr->buf, subbuf, start, nbytes)) in xdr_stream_subsegment()
1876 static void __read_bytes_from_xdr_buf(const struct xdr_buf *subbuf, in __read_bytes_from_xdr_buf() argument
1881 this_len = min_t(unsigned int, len, subbuf->head[0].iov_len); in __read_bytes_from_xdr_buf()
1882 memcpy(obj, subbuf->head[0].iov_base, this_len); in __read_bytes_from_xdr_buf()
1885 this_len = min_t(unsigned int, len, subbuf->page_len); in __read_bytes_from_xdr_buf()
1886 _copy_from_pages(obj, subbuf->pages, subbuf->page_base, this_len); in __read_bytes_from_xdr_buf()
1889 this_len = min_t(unsigned int, len, subbuf->tail[0].iov_len); in __read_bytes_from_xdr_buf()
1890 memcpy(obj, subbuf->tail[0].iov_base, this_len); in __read_bytes_from_xdr_buf()
1897 struct xdr_buf subbuf; in read_bytes_from_xdr_buf() local
1900 status = xdr_buf_subsegment(buf, &subbuf, base, len); in read_bytes_from_xdr_buf()
1903 __read_bytes_from_xdr_buf(&subbuf, obj, len); in read_bytes_from_xdr_buf()
1908 static void __write_bytes_to_xdr_buf(const struct xdr_buf *subbuf, in __write_bytes_to_xdr_buf() argument
1913 this_len = min_t(unsigned int, len, subbuf->head[0].iov_len); in __write_bytes_to_xdr_buf()
1914 memcpy(subbuf->head[0].iov_base, obj, this_len); in __write_bytes_to_xdr_buf()
1917 this_len = min_t(unsigned int, len, subbuf->page_len); in __write_bytes_to_xdr_buf()
1918 _copy_to_pages(subbuf->pages, subbuf->page_base, obj, this_len); in __write_bytes_to_xdr_buf()
1921 this_len = min_t(unsigned int, len, subbuf->tail[0].iov_len); in __write_bytes_to_xdr_buf()
1922 memcpy(subbuf->tail[0].iov_base, obj, this_len); in __write_bytes_to_xdr_buf()
1929 struct xdr_buf subbuf; in write_bytes_to_xdr_buf() local
1932 status = xdr_buf_subsegment(buf, &subbuf, base, len); in write_bytes_to_xdr_buf()
1935 __write_bytes_to_xdr_buf(&subbuf, obj, len); in write_bytes_to_xdr_buf()