Skip to content

Commit 14e1052

Browse files
chuckleverJ. Bruce Fields
authored andcommitted
lockd: Update the NLMv1 FREE_ALL arguments decoder to use struct xdr_stream
Signed-off-by: Chuck Lever <[email protected]> Signed-off-by: J. Bruce Fields <[email protected]>
1 parent 890939e commit 14e1052

File tree

1 file changed

+15
-13
lines changed

1 file changed

+15
-13
lines changed

fs/lockd/xdr.c

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,21 @@ nlmsvc_decode_shareargs(struct svc_rqst *rqstp, __be32 *p)
316316
return 1;
317317
}
318318

319+
int
320+
nlmsvc_decode_notify(struct svc_rqst *rqstp, __be32 *p)
321+
{
322+
struct xdr_stream *xdr = &rqstp->rq_arg_stream;
323+
struct nlm_args *argp = rqstp->rq_argp;
324+
struct nlm_lock *lock = &argp->lock;
325+
326+
if (!svcxdr_decode_string(xdr, &lock->caller, &lock->len))
327+
return 0;
328+
if (xdr_stream_decode_u32(xdr, &argp->state) < 0)
329+
return 0;
330+
331+
return 1;
332+
}
333+
319334
int
320335
nlmsvc_encode_testres(struct svc_rqst *rqstp, __be32 *p)
321336
{
@@ -349,19 +364,6 @@ nlmsvc_encode_res(struct svc_rqst *rqstp, __be32 *p)
349364
return xdr_ressize_check(rqstp, p);
350365
}
351366

352-
int
353-
nlmsvc_decode_notify(struct svc_rqst *rqstp, __be32 *p)
354-
{
355-
struct nlm_args *argp = rqstp->rq_argp;
356-
struct nlm_lock *lock = &argp->lock;
357-
358-
if (!(p = xdr_decode_string_inplace(p, &lock->caller,
359-
&lock->len, NLM_MAXSTRLEN)))
360-
return 0;
361-
argp->state = ntohl(*p++);
362-
return xdr_argsize_check(rqstp, p);
363-
}
364-
365367
int
366368
nlmsvc_encode_void(struct svc_rqst *rqstp, __be32 *p)
367369
{

0 commit comments

Comments
 (0)