mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 20:51:03 +02:00
NFSD: Update the NFSv2 READDIR result encoder to use struct xdr_stream
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
This commit is contained in:
@@ -574,17 +574,21 @@ nfssvc_encode_readres(struct svc_rqst *rqstp, __be32 *p)
|
|||||||
int
|
int
|
||||||
nfssvc_encode_readdirres(struct svc_rqst *rqstp, __be32 *p)
|
nfssvc_encode_readdirres(struct svc_rqst *rqstp, __be32 *p)
|
||||||
{
|
{
|
||||||
|
struct xdr_stream *xdr = &rqstp->rq_res_stream;
|
||||||
struct nfsd_readdirres *resp = rqstp->rq_resp;
|
struct nfsd_readdirres *resp = rqstp->rq_resp;
|
||||||
|
|
||||||
*p++ = resp->status;
|
if (!svcxdr_encode_stat(xdr, resp->status))
|
||||||
if (resp->status != nfs_ok)
|
return 0;
|
||||||
return xdr_ressize_check(rqstp, p);
|
switch (resp->status) {
|
||||||
|
case nfs_ok:
|
||||||
xdr_ressize_check(rqstp, p);
|
xdr_write_pages(xdr, &resp->page, 0, resp->count << 2);
|
||||||
p = resp->buffer;
|
/* no more entries */
|
||||||
*p++ = 0; /* no more entries */
|
if (xdr_stream_encode_item_absent(xdr) < 0)
|
||||||
*p++ = htonl((resp->common.err == nfserr_eof));
|
return 0;
|
||||||
rqstp->rq_res.page_len = resp->count << 2;
|
if (xdr_stream_encode_bool(xdr, resp->common.err == nfserr_eof) < 0)
|
||||||
|
return 0;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@@ -114,6 +114,7 @@ struct nfsd_readdirres {
|
|||||||
__be32 * buffer;
|
__be32 * buffer;
|
||||||
int buflen;
|
int buflen;
|
||||||
__be32 * offset;
|
__be32 * offset;
|
||||||
|
struct page *page;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct nfsd_statfsres {
|
struct nfsd_statfsres {
|
||||||
|
Reference in New Issue
Block a user