Skip to content

Commit 3049e97

Browse files
chuckleverJ. Bruce Fields
authored andcommitted
lockd: Update the NLMv4 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 7cf96b6 commit 3049e97

File tree

1 file changed

+15
-13
lines changed

1 file changed

+15
-13
lines changed

fs/lockd/xdr4.c

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,21 @@ nlm4svc_decode_shareargs(struct svc_rqst *rqstp, __be32 *p)
309309
return 1;
310310
}
311311

312+
int
313+
nlm4svc_decode_notify(struct svc_rqst *rqstp, __be32 *p)
314+
{
315+
struct xdr_stream *xdr = &rqstp->rq_arg_stream;
316+
struct nlm_args *argp = rqstp->rq_argp;
317+
struct nlm_lock *lock = &argp->lock;
318+
319+
if (!svcxdr_decode_string(xdr, &lock->caller, &lock->len))
320+
return 0;
321+
if (xdr_stream_decode_u32(xdr, &argp->state) < 0)
322+
return 0;
323+
324+
return 1;
325+
}
326+
312327
int
313328
nlm4svc_encode_testres(struct svc_rqst *rqstp, __be32 *p)
314329
{
@@ -342,19 +357,6 @@ nlm4svc_encode_res(struct svc_rqst *rqstp, __be32 *p)
342357
return xdr_ressize_check(rqstp, p);
343358
}
344359

345-
int
346-
nlm4svc_decode_notify(struct svc_rqst *rqstp, __be32 *p)
347-
{
348-
struct nlm_args *argp = rqstp->rq_argp;
349-
struct nlm_lock *lock = &argp->lock;
350-
351-
if (!(p = xdr_decode_string_inplace(p, &lock->caller,
352-
&lock->len, NLM_MAXSTRLEN)))
353-
return 0;
354-
argp->state = ntohl(*p++);
355-
return xdr_argsize_check(rqstp, p);
356-
}
357-
358360
int
359361
nlm4svc_encode_void(struct svc_rqst *rqstp, __be32 *p)
360362
{

0 commit comments

Comments
 (0)