@@ -291,30 +291,33 @@ nlm4svc_decode_lockargs(struct svc_rqst *rqstp, __be32 *p)
291
291
}
292
292
293
293
int
294
- nlm4svc_encode_testres (struct svc_rqst * rqstp , __be32 * p )
294
+ nlm4svc_decode_cancargs (struct svc_rqst * rqstp , __be32 * p )
295
295
{
296
- struct nlm_res * resp = rqstp -> rq_resp ;
296
+ struct xdr_stream * xdr = & rqstp -> rq_arg_stream ;
297
+ struct nlm_args * argp = rqstp -> rq_argp ;
298
+ u32 exclusive ;
297
299
298
- if (!( p = nlm4_encode_testres ( p , resp ) ))
300
+ if (!svcxdr_decode_cookie ( xdr , & argp -> cookie ))
299
301
return 0 ;
300
- return xdr_ressize_check (rqstp , p );
302
+ if (xdr_stream_decode_bool (xdr , & argp -> block ) < 0 )
303
+ return 0 ;
304
+ if (xdr_stream_decode_bool (xdr , & exclusive ) < 0 )
305
+ return 0 ;
306
+ if (!svcxdr_decode_lock (xdr , & argp -> lock ))
307
+ return 0 ;
308
+ if (exclusive )
309
+ argp -> lock .fl .fl_type = F_WRLCK ;
310
+ return 1 ;
301
311
}
302
312
303
313
int
304
- nlm4svc_decode_cancargs (struct svc_rqst * rqstp , __be32 * p )
314
+ nlm4svc_encode_testres (struct svc_rqst * rqstp , __be32 * p )
305
315
{
306
- struct nlm_args * argp = rqstp -> rq_argp ;
307
- u32 exclusive ;
316
+ struct nlm_res * resp = rqstp -> rq_resp ;
308
317
309
- if (!(p = nlm4_decode_cookie (p , & argp -> cookie )))
310
- return 0 ;
311
- argp -> block = ntohl (* p ++ );
312
- exclusive = ntohl (* p ++ );
313
- if (!(p = nlm4_decode_lock (p , & argp -> lock )))
318
+ if (!(p = nlm4_encode_testres (p , resp )))
314
319
return 0 ;
315
- if (exclusive )
316
- argp -> lock .fl .fl_type = F_WRLCK ;
317
- return xdr_argsize_check (rqstp , p );
320
+ return xdr_ressize_check (rqstp , p );
318
321
}
319
322
320
323
int
0 commit comments