Lines Matching defs:nbytes
44 * @nbytes: size of data.
46 * Copy the array of data of length nbytes at ptr to the XDR buffer
54 __be32 *xdr_encode_opaque_fixed(__be32 *p, const void *ptr, unsigned int nbytes)
56 if (likely(nbytes != 0)) {
57 unsigned int quadlen = XDR_QUADLEN(nbytes);
58 unsigned int padding = (quadlen << 2) - nbytes;
61 memcpy(p, ptr, nbytes);
63 memset((char *)p + nbytes, 0, padding);
74 * @nbytes: size of data.
78 __be32 *xdr_encode_opaque(__be32 *p, const void *ptr, unsigned int nbytes)
80 *p++ = cpu_to_be32(nbytes);
81 return xdr_encode_opaque_fixed(p, ptr, nbytes);
1218 size_t nbytes)
1224 if (nbytes > PAGE_SIZE)
1226 if (xdr->buf->len + nbytes > xdr->buf->buflen)
1229 frag2bytes = nbytes - frag1bytes;
1259 xdr->buf->len += nbytes;
1262 trace_rpc_xdr_overflow(xdr, nbytes);
1269 * @nbytes: number of bytes to reserve
1271 * Checks that we have enough buffer space to encode 'nbytes' more
1281 __be32 * xdr_reserve_space(struct xdr_stream *xdr, size_t nbytes)
1287 /* align nbytes on the next 32-bit boundary */
1288 nbytes += 3;
1289 nbytes &= ~3;
1290 q = p + (nbytes >> 2);
1292 return xdr_get_next_encode_buffer(xdr, nbytes);
1295 xdr->iov->iov_len += nbytes;
1297 xdr->buf->page_len += nbytes;
1298 xdr->buf->len += nbytes;
1306 * @nbytes: number of bytes to reserve
1316 int xdr_reserve_space_vec(struct xdr_stream *xdr, size_t nbytes)
1331 while (nbytes) {
1333 thislen = min_t(size_t, nbytes, PAGE_SIZE - thislen);
1339 nbytes -= thislen;
1423 unsigned int nbytes = xdr_align_size(len);
1425 xdr->buf->len -= nbytes;
1426 xdr->nwords -= XDR_QUADLEN(nbytes);
1654 static __be32 * __xdr_inline_decode(struct xdr_stream *xdr, size_t nbytes)
1656 unsigned int nwords = XDR_QUADLEN(nbytes);
1667 static __be32 *xdr_copy_to_scratch(struct xdr_stream *xdr, size_t nbytes)
1673 if (nbytes > xdr->scratch.iov_len)
1682 nbytes -= cplen;
1683 p = __xdr_inline_decode(xdr, nbytes);
1686 memcpy(cpdest, p, nbytes);
1689 trace_rpc_xdr_overflow(xdr, nbytes);
1696 * @nbytes: number of bytes of data to decode
1699 * 'nbytes' more bytes of data starting at the current position.
1703 __be32 * xdr_inline_decode(struct xdr_stream *xdr, size_t nbytes)
1707 if (unlikely(nbytes == 0))
1711 p = __xdr_inline_decode(xdr, nbytes);
1714 return xdr_copy_to_scratch(xdr, nbytes);
1716 trace_rpc_xdr_overflow(xdr, nbytes);
1918 * @nbytes: length of @xdr to extract, in bytes
1922 * of @nbytes. If this is successful, @xdr is advanced to the next
1930 unsigned int nbytes)
1936 if (xdr_buf_subsegment(xdr->buf, subbuf, start, nbytes))
1939 /* Advance @xdr by @nbytes */
1940 for (remaining = nbytes; remaining;) {
1947 (remaining + xdr_pad_size(nbytes)));
1956 xdr_stream_set_pos(xdr, start + nbytes);