@@ -264,35 +264,40 @@ nlm4svc_decode_testargs(struct svc_rqst *rqstp, __be32 *p)
264
264
return 1 ;
265
265
}
266
266
267
- int
268
- nlm4svc_encode_testres (struct svc_rqst * rqstp , __be32 * p )
269
- {
270
- struct nlm_res * resp = rqstp -> rq_resp ;
271
-
272
- if (!(p = nlm4_encode_testres (p , resp )))
273
- return 0 ;
274
- return xdr_ressize_check (rqstp , p );
275
- }
276
-
277
267
int
278
268
nlm4svc_decode_lockargs (struct svc_rqst * rqstp , __be32 * p )
279
269
{
270
+ struct xdr_stream * xdr = & rqstp -> rq_arg_stream ;
280
271
struct nlm_args * argp = rqstp -> rq_argp ;
281
- u32 exclusive ;
272
+ u32 exclusive ;
282
273
283
- if (!( p = nlm4_decode_cookie ( p , & argp -> cookie ) ))
274
+ if (!svcxdr_decode_cookie ( xdr , & argp -> cookie ))
284
275
return 0 ;
285
- argp -> block = ntohl (* p ++ );
286
- exclusive = ntohl (* p ++ );
287
- if (!(p = nlm4_decode_lock (p , & argp -> lock )))
276
+ if (xdr_stream_decode_bool (xdr , & argp -> block ) < 0 )
277
+ return 0 ;
278
+ if (xdr_stream_decode_bool (xdr , & exclusive ) < 0 )
279
+ return 0 ;
280
+ if (!svcxdr_decode_lock (xdr , & argp -> lock ))
288
281
return 0 ;
289
282
if (exclusive )
290
283
argp -> lock .fl .fl_type = F_WRLCK ;
291
- argp -> reclaim = ntohl (* p ++ );
292
- argp -> state = ntohl (* p ++ );
284
+ if (xdr_stream_decode_bool (xdr , & argp -> reclaim ) < 0 )
285
+ return 0 ;
286
+ if (xdr_stream_decode_u32 (xdr , & argp -> state ) < 0 )
287
+ return 0 ;
293
288
argp -> monitor = 1 ; /* monitor client by default */
294
289
295
- return xdr_argsize_check (rqstp , p );
290
+ return 1 ;
291
+ }
292
+
293
+ int
294
+ nlm4svc_encode_testres (struct svc_rqst * rqstp , __be32 * p )
295
+ {
296
+ struct nlm_res * resp = rqstp -> rq_resp ;
297
+
298
+ if (!(p = nlm4_encode_testres (p , resp )))
299
+ return 0 ;
300
+ return xdr_ressize_check (rqstp , p );
296
301
}
297
302
298
303
int
0 commit comments