Skip to content

Commit e96735a

Browse files
chuckleverJ. Bruce Fields
authored andcommitted
lockd: Update the NLMv1 nlm_res results encoder to use struct xdr_stream
Signed-off-by: Chuck Lever <[email protected]> Signed-off-by: J. Bruce Fields <[email protected]>
1 parent adf98a4 commit e96735a

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

fs/lockd/xdr.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -349,24 +349,23 @@ nlmsvc_encode_testres(struct svc_rqst *rqstp, __be32 *p)
349349
}
350350

351351
int
352-
nlmsvc_encode_shareres(struct svc_rqst *rqstp, __be32 *p)
352+
nlmsvc_encode_res(struct svc_rqst *rqstp, __be32 *p)
353353
{
354+
struct xdr_stream *xdr = &rqstp->rq_res_stream;
354355
struct nlm_res *resp = rqstp->rq_resp;
355356

356-
if (!(p = nlm_encode_cookie(p, &resp->cookie)))
357-
return 0;
358-
*p++ = resp->status;
359-
*p++ = xdr_zero; /* sequence argument */
360-
return xdr_ressize_check(rqstp, p);
357+
return svcxdr_encode_cookie(xdr, &resp->cookie) &&
358+
svcxdr_encode_stats(xdr, resp->status);
361359
}
362360

363361
int
364-
nlmsvc_encode_res(struct svc_rqst *rqstp, __be32 *p)
362+
nlmsvc_encode_shareres(struct svc_rqst *rqstp, __be32 *p)
365363
{
366364
struct nlm_res *resp = rqstp->rq_resp;
367365

368366
if (!(p = nlm_encode_cookie(p, &resp->cookie)))
369367
return 0;
370368
*p++ = resp->status;
369+
*p++ = xdr_zero; /* sequence argument */
371370
return xdr_ressize_check(rqstp, p);
372371
}

0 commit comments

Comments
 (0)