if (nfserr) {
xdr->p -= 2;
xdr->iov->iov_len -= 8;
+ xdr->buf->len -= 8;
return nfserr;
}
eof = (read->rd_offset + maxcount >=
WRITE32(eof);
WRITE32(maxcount);
- resp->xdr.buf->head[0].iov_len = (char *)p
- - (char *)resp->xdr.buf->head[0].iov_base;
+ WARN_ON_ONCE(resp->xdr.buf->head[0].iov_len != (char *)p
+ - (char *)resp->xdr.buf->head[0].iov_base);
resp->xdr.buf->page_len = maxcount;
+ xdr->buf->len += maxcount;
xdr->iov = xdr->buf->tail;
/* Use rest of head for padding and remaining ops: */
WRITE32(0);
resp->xdr.buf->tail[0].iov_base += maxcount&3;
resp->xdr.buf->tail[0].iov_len = 4 - (maxcount&3);
+ xdr->buf->len -= (maxcount&3);
}
return 0;
}
if (nfserr) {
xdr->p--;
xdr->iov->iov_len -= 4;
+ xdr->buf->len -= 4;
return nfserr;
}
resp->xdr.buf->head[0].iov_len = (char *)p
- (char *)resp->xdr.buf->head[0].iov_base;
resp->xdr.buf->page_len = maxcount;
+ xdr->buf->len += maxcount;
xdr->iov = xdr->buf->tail;
/* Use rest of head for padding and remaining ops: */
*p++ = htonl(readdir->common.err == nfserr_eof);
resp->xdr.buf->page_len = ((char *)p) -
(char*)page_address(*(resp->rqstp->rq_next_page-1));
+ xdr->buf->len += xdr->buf->page_len;
xdr->iov = xdr->buf->tail;
xdr->p = savep;
xdr->iov->iov_len = ((char *)resp->xdr.p)
- (char *)resp->xdr.buf->head[0].iov_base;
+ xdr->buf->len = xdr->iov->iov_len;
return nfserr;
}
* All that remains is to write the tag and operation count...
*/
struct nfsd4_compound_state *cs = &resp->cstate;
+ struct xdr_buf *buf = resp->xdr.buf;
+
+ WARN_ON_ONCE(buf->len != buf->head[0].iov_len + buf->page_len +
+ buf->tail[0].iov_len);
p = resp->tagp;
*p++ = htonl(resp->taglen);