Skip to content

Commit b4c24b5

Browse files
chuckleverJ. Bruce Fields
authored andcommitted
lockd: Update the NLMv4 nlm_res arguments decoder to use struct xdr_stream
Signed-off-by: Chuck Lever <[email protected]> Signed-off-by: J. Bruce Fields <[email protected]>
1 parent d76d8c2 commit b4c24b5

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

fs/lockd/xdr4.c

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,20 @@ nlm4svc_decode_unlockargs(struct svc_rqst *rqstp, __be32 *p)
295295
return 1;
296296
}
297297

298+
int
299+
nlm4svc_decode_res(struct svc_rqst *rqstp, __be32 *p)
300+
{
301+
struct xdr_stream *xdr = &rqstp->rq_arg_stream;
302+
struct nlm_res *resp = rqstp->rq_argp;
303+
304+
if (!svcxdr_decode_cookie(xdr, &resp->cookie))
305+
return 0;
306+
if (!svcxdr_decode_stats(xdr, &resp->status))
307+
return 0;
308+
309+
return 1;
310+
}
311+
298312
int
299313
nlm4svc_encode_testres(struct svc_rqst *rqstp, __be32 *p)
300314
{
@@ -375,17 +389,6 @@ nlm4svc_decode_reboot(struct svc_rqst *rqstp, __be32 *p)
375389
return xdr_argsize_check(rqstp, p);
376390
}
377391

378-
int
379-
nlm4svc_decode_res(struct svc_rqst *rqstp, __be32 *p)
380-
{
381-
struct nlm_res *resp = rqstp->rq_argp;
382-
383-
if (!(p = nlm4_decode_cookie(p, &resp->cookie)))
384-
return 0;
385-
resp->status = *p++;
386-
return xdr_argsize_check(rqstp, p);
387-
}
388-
389392
int
390393
nlm4svc_encode_void(struct svc_rqst *rqstp, __be32 *p)
391394
{

0 commit comments

Comments
 (0)