@@ -131,36 +131,6 @@ nlm4_decode_oh(__be32 *p, struct xdr_netobj *oh)
131
131
return xdr_decode_netobj (p , oh );
132
132
}
133
133
134
- static __be32 *
135
- nlm4_decode_lock (__be32 * p , struct nlm_lock * lock )
136
- {
137
- struct file_lock * fl = & lock -> fl ;
138
- __u64 len , start ;
139
- __s64 end ;
140
-
141
- if (!(p = xdr_decode_string_inplace (p , & lock -> caller ,
142
- & lock -> len , NLM_MAXSTRLEN ))
143
- || !(p = nlm4_decode_fh (p , & lock -> fh ))
144
- || !(p = nlm4_decode_oh (p , & lock -> oh )))
145
- return NULL ;
146
- lock -> svid = ntohl (* p ++ );
147
-
148
- locks_init_lock (fl );
149
- fl -> fl_flags = FL_POSIX ;
150
- fl -> fl_type = F_RDLCK ; /* as good as anything else */
151
- p = xdr_decode_hyper (p , & start );
152
- p = xdr_decode_hyper (p , & len );
153
- end = start + len - 1 ;
154
-
155
- fl -> fl_start = s64_to_loff_t (start );
156
-
157
- if (len == 0 || end < 0 )
158
- fl -> fl_end = OFFSET_MAX ;
159
- else
160
- fl -> fl_end = s64_to_loff_t (end );
161
- return p ;
162
- }
163
-
164
134
static bool
165
135
svcxdr_decode_lock (struct xdr_stream * xdr , struct nlm_lock * lock )
166
136
{
@@ -311,25 +281,28 @@ nlm4svc_decode_cancargs(struct svc_rqst *rqstp, __be32 *p)
311
281
}
312
282
313
283
int
314
- nlm4svc_encode_testres (struct svc_rqst * rqstp , __be32 * p )
284
+ nlm4svc_decode_unlockargs (struct svc_rqst * rqstp , __be32 * p )
315
285
{
316
- struct nlm_res * resp = rqstp -> rq_resp ;
286
+ struct xdr_stream * xdr = & rqstp -> rq_arg_stream ;
287
+ struct nlm_args * argp = rqstp -> rq_argp ;
317
288
318
- if (!( p = nlm4_encode_testres ( p , resp ) ))
289
+ if (!svcxdr_decode_cookie ( xdr , & argp -> cookie ))
319
290
return 0 ;
320
- return xdr_ressize_check (rqstp , p );
291
+ if (!svcxdr_decode_lock (xdr , & argp -> lock ))
292
+ return 0 ;
293
+ argp -> lock .fl .fl_type = F_UNLCK ;
294
+
295
+ return 1 ;
321
296
}
322
297
323
298
int
324
- nlm4svc_decode_unlockargs (struct svc_rqst * rqstp , __be32 * p )
299
+ nlm4svc_encode_testres (struct svc_rqst * rqstp , __be32 * p )
325
300
{
326
- struct nlm_args * argp = rqstp -> rq_argp ;
301
+ struct nlm_res * resp = rqstp -> rq_resp ;
327
302
328
- if (!(p = nlm4_decode_cookie (p , & argp -> cookie ))
329
- || !(p = nlm4_decode_lock (p , & argp -> lock )))
303
+ if (!(p = nlm4_encode_testres (p , resp )))
330
304
return 0 ;
331
- argp -> lock .fl .fl_type = F_UNLCK ;
332
- return xdr_argsize_check (rqstp , p );
305
+ return xdr_ressize_check (rqstp , p );
333
306
}
334
307
335
308
int
0 commit comments