* struct nlm4_lock alock;
* };
*/
-static int nlm4_xdr_enc_testargs(struct rpc_rqst *req, __be32 *p,
- const struct nlm_args *args)
+static void nlm4_xdr_enc_testargs(struct rpc_rqst *req,
+ struct xdr_stream *xdr,
+ const struct nlm_args *args)
{
const struct nlm_lock *lock = &args->lock;
- struct xdr_stream xdr;
- xdr_init_encode(&xdr, &req->rq_snd_buf, p);
- encode_cookie(&xdr, &args->cookie);
- encode_bool(&xdr, lock->fl.fl_type == F_WRLCK);
- encode_nlm4_lock(&xdr, lock);
- return 0;
+ encode_cookie(xdr, &args->cookie);
+ encode_bool(xdr, lock->fl.fl_type == F_WRLCK);
+ encode_nlm4_lock(xdr, lock);
}
/*
* int state;
* };
*/
-static int nlm4_xdr_enc_lockargs(struct rpc_rqst *req, __be32 *p,
- const struct nlm_args *args)
+static void nlm4_xdr_enc_lockargs(struct rpc_rqst *req,
+ struct xdr_stream *xdr,
+ const struct nlm_args *args)
{
const struct nlm_lock *lock = &args->lock;
- struct xdr_stream xdr;
-
- xdr_init_encode(&xdr, &req->rq_snd_buf, p);
- encode_cookie(&xdr, &args->cookie);
- encode_bool(&xdr, args->block);
- encode_bool(&xdr, lock->fl.fl_type == F_WRLCK);
- encode_nlm4_lock(&xdr, lock);
- encode_bool(&xdr, args->reclaim);
- encode_int32(&xdr, args->state);
- return 0;
+
+ encode_cookie(xdr, &args->cookie);
+ encode_bool(xdr, args->block);
+ encode_bool(xdr, lock->fl.fl_type == F_WRLCK);
+ encode_nlm4_lock(xdr, lock);
+ encode_bool(xdr, args->reclaim);
+ encode_int32(xdr, args->state);
}
/*
* struct nlm4_lock alock;
* };
*/
-static int nlm4_xdr_enc_cancargs(struct rpc_rqst *req, __be32 *p,
- const struct nlm_args *args)
+static void nlm4_xdr_enc_cancargs(struct rpc_rqst *req,
+ struct xdr_stream *xdr,
+ const struct nlm_args *args)
{
const struct nlm_lock *lock = &args->lock;
- struct xdr_stream xdr;
- xdr_init_encode(&xdr, &req->rq_snd_buf, p);
- encode_cookie(&xdr, &args->cookie);
- encode_bool(&xdr, args->block);
- encode_bool(&xdr, lock->fl.fl_type == F_WRLCK);
- encode_nlm4_lock(&xdr, lock);
- return 0;
+ encode_cookie(xdr, &args->cookie);
+ encode_bool(xdr, args->block);
+ encode_bool(xdr, lock->fl.fl_type == F_WRLCK);
+ encode_nlm4_lock(xdr, lock);
}
/*
* struct nlm4_lock alock;
* };
*/
-static int nlm4_xdr_enc_unlockargs(struct rpc_rqst *req, __be32 *p,
- const struct nlm_args *args)
+static void nlm4_xdr_enc_unlockargs(struct rpc_rqst *req,
+ struct xdr_stream *xdr,
+ const struct nlm_args *args)
{
const struct nlm_lock *lock = &args->lock;
- struct xdr_stream xdr;
- xdr_init_encode(&xdr, &req->rq_snd_buf, p);
- encode_cookie(&xdr, &args->cookie);
- encode_nlm4_lock(&xdr, lock);
- return 0;
+ encode_cookie(xdr, &args->cookie);
+ encode_nlm4_lock(xdr, lock);
}
/*
* nlm4_stat stat;
* };
*/
-static int nlm4_xdr_enc_res(struct rpc_rqst *req, __be32 *p,
- const struct nlm_res *result)
+static void nlm4_xdr_enc_res(struct rpc_rqst *req,
+ struct xdr_stream *xdr,
+ const struct nlm_res *result)
{
- struct xdr_stream xdr;
-
- xdr_init_encode(&xdr, &req->rq_snd_buf, p);
- encode_cookie(&xdr, &result->cookie);
- encode_nlm4_stat(&xdr, result->status);
- return 0;
+ encode_cookie(xdr, &result->cookie);
+ encode_nlm4_stat(xdr, result->status);
}
/*
* nlm4_testrply test_stat;
* };
*/
-static int nlm4_xdr_enc_testres(struct rpc_rqst *req, __be32 *p,
- const struct nlm_res *result)
+static void nlm4_xdr_enc_testres(struct rpc_rqst *req,
+ struct xdr_stream *xdr,
+ const struct nlm_res *result)
{
- struct xdr_stream xdr;
-
- xdr_init_encode(&xdr, &req->rq_snd_buf, p);
- encode_cookie(&xdr, &result->cookie);
- encode_nlm4_stat(&xdr, result->status);
+ encode_cookie(xdr, &result->cookie);
+ encode_nlm4_stat(xdr, result->status);
if (result->status == nlm_lck_denied)
- encode_nlm4_holder(&xdr, result);
- return 0;
+ encode_nlm4_holder(xdr, result);
}
return error;
}
-static int nlm4_xdr_dec_testres(struct rpc_rqst *req, __be32 *p,
+static int nlm4_xdr_dec_testres(struct rpc_rqst *req,
+ struct xdr_stream *xdr,
struct nlm_res *result)
{
- struct xdr_stream xdr;
int error;
- xdr_init_decode(&xdr, &req->rq_rcv_buf, p);
- error = decode_cookie(&xdr, &result->cookie);
+ error = decode_cookie(xdr, &result->cookie);
if (unlikely(error))
goto out;
- error = decode_nlm4_testrply(&xdr, result);
+ error = decode_nlm4_testrply(xdr, result);
out:
return error;
}
* nlm4_stat stat;
* };
*/
-static int nlm4_xdr_dec_res(struct rpc_rqst *req, __be32 *p,
+static int nlm4_xdr_dec_res(struct rpc_rqst *req,
+ struct xdr_stream *xdr,
struct nlm_res *result)
{
- struct xdr_stream xdr;
int error;
- xdr_init_decode(&xdr, &req->rq_rcv_buf, p);
- error = decode_cookie(&xdr, &result->cookie);
+ error = decode_cookie(xdr, &result->cookie);
if (unlikely(error))
goto out;
- error = decode_nlm4_stat(&xdr, &result->status);
+ error = decode_nlm4_stat(xdr, &result->status);
out:
return error;
}
#define PROC(proc, argtype, restype) \
[NLMPROC_##proc] = { \
.p_proc = NLMPROC_##proc, \
- .p_encode = (kxdrproc_t)nlm4_xdr_enc_##argtype, \
- .p_decode = (kxdrproc_t)nlm4_xdr_dec_##restype, \
+ .p_encode = (kxdreproc_t)nlm4_xdr_enc_##argtype, \
+ .p_decode = (kxdrdproc_t)nlm4_xdr_dec_##restype, \
.p_arglen = NLM4_##argtype##_sz, \
.p_replen = NLM4_##restype##_sz, \
.p_statidx = NLMPROC_##proc, \