Commit d1607338 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Anna Schumaker

lockd: fix encoder callback prototypes

Declare the p_encode callbacks with the proper prototype instead of
casting to kxdreproc_t and losing all type safety.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarJeff Layton <jlayton@redhat.com>
Acked-by: default avatarTrond Myklebust <trond.myklebust@primarydata.com>
parent 8be9d07f
...@@ -381,8 +381,9 @@ static void encode_nlm4_lock(struct xdr_stream *xdr, ...@@ -381,8 +381,9 @@ static void encode_nlm4_lock(struct xdr_stream *xdr,
*/ */
static void nlm4_xdr_enc_testargs(struct rpc_rqst *req, static void nlm4_xdr_enc_testargs(struct rpc_rqst *req,
struct xdr_stream *xdr, struct xdr_stream *xdr,
const struct nlm_args *args) const void *data)
{ {
const struct nlm_args *args = data;
const struct nlm_lock *lock = &args->lock; const struct nlm_lock *lock = &args->lock;
encode_cookie(xdr, &args->cookie); encode_cookie(xdr, &args->cookie);
...@@ -402,8 +403,9 @@ static void nlm4_xdr_enc_testargs(struct rpc_rqst *req, ...@@ -402,8 +403,9 @@ static void nlm4_xdr_enc_testargs(struct rpc_rqst *req,
*/ */
static void nlm4_xdr_enc_lockargs(struct rpc_rqst *req, static void nlm4_xdr_enc_lockargs(struct rpc_rqst *req,
struct xdr_stream *xdr, struct xdr_stream *xdr,
const struct nlm_args *args) const void *data)
{ {
const struct nlm_args *args = data;
const struct nlm_lock *lock = &args->lock; const struct nlm_lock *lock = &args->lock;
encode_cookie(xdr, &args->cookie); encode_cookie(xdr, &args->cookie);
...@@ -424,8 +426,9 @@ static void nlm4_xdr_enc_lockargs(struct rpc_rqst *req, ...@@ -424,8 +426,9 @@ static void nlm4_xdr_enc_lockargs(struct rpc_rqst *req,
*/ */
static void nlm4_xdr_enc_cancargs(struct rpc_rqst *req, static void nlm4_xdr_enc_cancargs(struct rpc_rqst *req,
struct xdr_stream *xdr, struct xdr_stream *xdr,
const struct nlm_args *args) const void *data)
{ {
const struct nlm_args *args = data;
const struct nlm_lock *lock = &args->lock; const struct nlm_lock *lock = &args->lock;
encode_cookie(xdr, &args->cookie); encode_cookie(xdr, &args->cookie);
...@@ -442,8 +445,9 @@ static void nlm4_xdr_enc_cancargs(struct rpc_rqst *req, ...@@ -442,8 +445,9 @@ static void nlm4_xdr_enc_cancargs(struct rpc_rqst *req,
*/ */
static void nlm4_xdr_enc_unlockargs(struct rpc_rqst *req, static void nlm4_xdr_enc_unlockargs(struct rpc_rqst *req,
struct xdr_stream *xdr, struct xdr_stream *xdr,
const struct nlm_args *args) const void *data)
{ {
const struct nlm_args *args = data;
const struct nlm_lock *lock = &args->lock; const struct nlm_lock *lock = &args->lock;
encode_cookie(xdr, &args->cookie); encode_cookie(xdr, &args->cookie);
...@@ -458,8 +462,10 @@ static void nlm4_xdr_enc_unlockargs(struct rpc_rqst *req, ...@@ -458,8 +462,10 @@ static void nlm4_xdr_enc_unlockargs(struct rpc_rqst *req,
*/ */
static void nlm4_xdr_enc_res(struct rpc_rqst *req, static void nlm4_xdr_enc_res(struct rpc_rqst *req,
struct xdr_stream *xdr, struct xdr_stream *xdr,
const struct nlm_res *result) const void *data)
{ {
const struct nlm_res *result = data;
encode_cookie(xdr, &result->cookie); encode_cookie(xdr, &result->cookie);
encode_nlm4_stat(xdr, result->status); encode_nlm4_stat(xdr, result->status);
} }
...@@ -479,8 +485,10 @@ static void nlm4_xdr_enc_res(struct rpc_rqst *req, ...@@ -479,8 +485,10 @@ static void nlm4_xdr_enc_res(struct rpc_rqst *req,
*/ */
static void nlm4_xdr_enc_testres(struct rpc_rqst *req, static void nlm4_xdr_enc_testres(struct rpc_rqst *req,
struct xdr_stream *xdr, struct xdr_stream *xdr,
const struct nlm_res *result) const void *data)
{ {
const struct nlm_res *result = data;
encode_cookie(xdr, &result->cookie); encode_cookie(xdr, &result->cookie);
encode_nlm4_stat(xdr, result->status); encode_nlm4_stat(xdr, result->status);
if (result->status == nlm_lck_denied) if (result->status == nlm_lck_denied)
...@@ -566,7 +574,7 @@ static int nlm4_xdr_dec_res(struct rpc_rqst *req, ...@@ -566,7 +574,7 @@ static int nlm4_xdr_dec_res(struct rpc_rqst *req,
#define PROC(proc, argtype, restype) \ #define PROC(proc, argtype, restype) \
[NLMPROC_##proc] = { \ [NLMPROC_##proc] = { \
.p_proc = NLMPROC_##proc, \ .p_proc = NLMPROC_##proc, \
.p_encode = (kxdreproc_t)nlm4_xdr_enc_##argtype, \ .p_encode = nlm4_xdr_enc_##argtype, \
.p_decode = (kxdrdproc_t)nlm4_xdr_dec_##restype, \ .p_decode = (kxdrdproc_t)nlm4_xdr_dec_##restype, \
.p_arglen = NLM4_##argtype##_sz, \ .p_arglen = NLM4_##argtype##_sz, \
.p_replen = NLM4_##restype##_sz, \ .p_replen = NLM4_##restype##_sz, \
......
...@@ -374,8 +374,9 @@ static void encode_nlm_lock(struct xdr_stream *xdr, ...@@ -374,8 +374,9 @@ static void encode_nlm_lock(struct xdr_stream *xdr,
*/ */
static void nlm_xdr_enc_testargs(struct rpc_rqst *req, static void nlm_xdr_enc_testargs(struct rpc_rqst *req,
struct xdr_stream *xdr, struct xdr_stream *xdr,
const struct nlm_args *args) const void *data)
{ {
const struct nlm_args *args = data;
const struct nlm_lock *lock = &args->lock; const struct nlm_lock *lock = &args->lock;
encode_cookie(xdr, &args->cookie); encode_cookie(xdr, &args->cookie);
...@@ -395,8 +396,9 @@ static void nlm_xdr_enc_testargs(struct rpc_rqst *req, ...@@ -395,8 +396,9 @@ static void nlm_xdr_enc_testargs(struct rpc_rqst *req,
*/ */
static void nlm_xdr_enc_lockargs(struct rpc_rqst *req, static void nlm_xdr_enc_lockargs(struct rpc_rqst *req,
struct xdr_stream *xdr, struct xdr_stream *xdr,
const struct nlm_args *args) const void *data)
{ {
const struct nlm_args *args = data;
const struct nlm_lock *lock = &args->lock; const struct nlm_lock *lock = &args->lock;
encode_cookie(xdr, &args->cookie); encode_cookie(xdr, &args->cookie);
...@@ -417,8 +419,9 @@ static void nlm_xdr_enc_lockargs(struct rpc_rqst *req, ...@@ -417,8 +419,9 @@ static void nlm_xdr_enc_lockargs(struct rpc_rqst *req,
*/ */
static void nlm_xdr_enc_cancargs(struct rpc_rqst *req, static void nlm_xdr_enc_cancargs(struct rpc_rqst *req,
struct xdr_stream *xdr, struct xdr_stream *xdr,
const struct nlm_args *args) const void *data)
{ {
const struct nlm_args *args = data;
const struct nlm_lock *lock = &args->lock; const struct nlm_lock *lock = &args->lock;
encode_cookie(xdr, &args->cookie); encode_cookie(xdr, &args->cookie);
...@@ -435,8 +438,9 @@ static void nlm_xdr_enc_cancargs(struct rpc_rqst *req, ...@@ -435,8 +438,9 @@ static void nlm_xdr_enc_cancargs(struct rpc_rqst *req,
*/ */
static void nlm_xdr_enc_unlockargs(struct rpc_rqst *req, static void nlm_xdr_enc_unlockargs(struct rpc_rqst *req,
struct xdr_stream *xdr, struct xdr_stream *xdr,
const struct nlm_args *args) const void *data)
{ {
const struct nlm_args *args = data;
const struct nlm_lock *lock = &args->lock; const struct nlm_lock *lock = &args->lock;
encode_cookie(xdr, &args->cookie); encode_cookie(xdr, &args->cookie);
...@@ -451,8 +455,10 @@ static void nlm_xdr_enc_unlockargs(struct rpc_rqst *req, ...@@ -451,8 +455,10 @@ static void nlm_xdr_enc_unlockargs(struct rpc_rqst *req,
*/ */
static void nlm_xdr_enc_res(struct rpc_rqst *req, static void nlm_xdr_enc_res(struct rpc_rqst *req,
struct xdr_stream *xdr, struct xdr_stream *xdr,
const struct nlm_res *result) const void *data)
{ {
const struct nlm_res *result = data;
encode_cookie(xdr, &result->cookie); encode_cookie(xdr, &result->cookie);
encode_nlm_stat(xdr, result->status); encode_nlm_stat(xdr, result->status);
} }
...@@ -479,8 +485,10 @@ static void encode_nlm_testrply(struct xdr_stream *xdr, ...@@ -479,8 +485,10 @@ static void encode_nlm_testrply(struct xdr_stream *xdr,
static void nlm_xdr_enc_testres(struct rpc_rqst *req, static void nlm_xdr_enc_testres(struct rpc_rqst *req,
struct xdr_stream *xdr, struct xdr_stream *xdr,
const struct nlm_res *result) const void *data)
{ {
const struct nlm_res *result = data;
encode_cookie(xdr, &result->cookie); encode_cookie(xdr, &result->cookie);
encode_nlm_stat(xdr, result->status); encode_nlm_stat(xdr, result->status);
encode_nlm_testrply(xdr, result); encode_nlm_testrply(xdr, result);
...@@ -564,7 +572,7 @@ static int nlm_xdr_dec_res(struct rpc_rqst *req, ...@@ -564,7 +572,7 @@ static int nlm_xdr_dec_res(struct rpc_rqst *req,
#define PROC(proc, argtype, restype) \ #define PROC(proc, argtype, restype) \
[NLMPROC_##proc] = { \ [NLMPROC_##proc] = { \
.p_proc = NLMPROC_##proc, \ .p_proc = NLMPROC_##proc, \
.p_encode = (kxdreproc_t)nlm_xdr_enc_##argtype, \ .p_encode = nlm_xdr_enc_##argtype, \
.p_decode = (kxdrdproc_t)nlm_xdr_dec_##restype, \ .p_decode = (kxdrdproc_t)nlm_xdr_dec_##restype, \
.p_arglen = NLM_##argtype##_sz, \ .p_arglen = NLM_##argtype##_sz, \
.p_replen = NLM_##restype##_sz, \ .p_replen = NLM_##restype##_sz, \
......
...@@ -476,14 +476,14 @@ static void encode_priv(struct xdr_stream *xdr, const struct nsm_args *argp) ...@@ -476,14 +476,14 @@ static void encode_priv(struct xdr_stream *xdr, const struct nsm_args *argp)
} }
static void nsm_xdr_enc_mon(struct rpc_rqst *req, struct xdr_stream *xdr, static void nsm_xdr_enc_mon(struct rpc_rqst *req, struct xdr_stream *xdr,
const struct nsm_args *argp) const void *argp)
{ {
encode_mon_id(xdr, argp); encode_mon_id(xdr, argp);
encode_priv(xdr, argp); encode_priv(xdr, argp);
} }
static void nsm_xdr_enc_unmon(struct rpc_rqst *req, struct xdr_stream *xdr, static void nsm_xdr_enc_unmon(struct rpc_rqst *req, struct xdr_stream *xdr,
const struct nsm_args *argp) const void *argp)
{ {
encode_mon_id(xdr, argp); encode_mon_id(xdr, argp);
} }
...@@ -532,7 +532,7 @@ static int nsm_xdr_dec_stat(struct rpc_rqst *rqstp, ...@@ -532,7 +532,7 @@ static int nsm_xdr_dec_stat(struct rpc_rqst *rqstp,
static struct rpc_procinfo nsm_procedures[] = { static struct rpc_procinfo nsm_procedures[] = {
[NSMPROC_MON] = { [NSMPROC_MON] = {
.p_proc = NSMPROC_MON, .p_proc = NSMPROC_MON,
.p_encode = (kxdreproc_t)nsm_xdr_enc_mon, .p_encode = nsm_xdr_enc_mon,
.p_decode = (kxdrdproc_t)nsm_xdr_dec_stat_res, .p_decode = (kxdrdproc_t)nsm_xdr_dec_stat_res,
.p_arglen = SM_mon_sz, .p_arglen = SM_mon_sz,
.p_replen = SM_monres_sz, .p_replen = SM_monres_sz,
...@@ -541,7 +541,7 @@ static struct rpc_procinfo nsm_procedures[] = { ...@@ -541,7 +541,7 @@ static struct rpc_procinfo nsm_procedures[] = {
}, },
[NSMPROC_UNMON] = { [NSMPROC_UNMON] = {
.p_proc = NSMPROC_UNMON, .p_proc = NSMPROC_UNMON,
.p_encode = (kxdreproc_t)nsm_xdr_enc_unmon, .p_encode = nsm_xdr_enc_unmon,
.p_decode = (kxdrdproc_t)nsm_xdr_dec_stat, .p_decode = (kxdrdproc_t)nsm_xdr_dec_stat,
.p_arglen = SM_mon_id_sz, .p_arglen = SM_mon_id_sz,
.p_replen = SM_unmonres_sz, .p_replen = SM_unmonres_sz,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment