Skip to content

Commit 16ddcab

Browse files
chuckleverJ. Bruce Fields
authored andcommitted
lockd: Update the NLMv1 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 c27045d commit 16ddcab

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

fs/lockd/xdr.c

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,20 @@ nlmsvc_decode_unlockargs(struct svc_rqst *rqstp, __be32 *p)
299299
return 1;
300300
}
301301

302+
int
303+
nlmsvc_decode_res(struct svc_rqst *rqstp, __be32 *p)
304+
{
305+
struct xdr_stream *xdr = &rqstp->rq_arg_stream;
306+
struct nlm_res *resp = rqstp->rq_argp;
307+
308+
if (!svcxdr_decode_cookie(xdr, &resp->cookie))
309+
return 0;
310+
if (!svcxdr_decode_stats(xdr, &resp->status))
311+
return 0;
312+
313+
return 1;
314+
}
315+
302316
int
303317
nlmsvc_encode_testres(struct svc_rqst *rqstp, __be32 *p)
304318
{
@@ -379,17 +393,6 @@ nlmsvc_decode_reboot(struct svc_rqst *rqstp, __be32 *p)
379393
return xdr_argsize_check(rqstp, p);
380394
}
381395

382-
int
383-
nlmsvc_decode_res(struct svc_rqst *rqstp, __be32 *p)
384-
{
385-
struct nlm_res *resp = rqstp->rq_argp;
386-
387-
if (!(p = nlm_decode_cookie(p, &resp->cookie)))
388-
return 0;
389-
resp->status = *p++;
390-
return xdr_argsize_check(rqstp, p);
391-
}
392-
393396
int
394397
nlmsvc_encode_void(struct svc_rqst *rqstp, __be32 *p)
395398
{

0 commit comments

Comments
 (0)