]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
lockd: fix encoder callback prototypes
authorChristoph Hellwig <hch@lst.de>
Mon, 8 May 2017 07:34:04 +0000 (09:34 +0200)
committerAnna Schumaker <Anna.Schumaker@Netapp.com>
Thu, 13 Jul 2017 19:57:53 +0000 (15:57 -0400)
Declare the p_encode callbacks with the proper prototype instead of
casting to kxdreproc_t and losing all type safety.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Jeff Layton <jlayton@redhat.com>
Acked-by: Trond Myklebust <trond.myklebust@primarydata.com>
fs/lockd/clnt4xdr.c
fs/lockd/clntxdr.c
fs/lockd/mon.c

index d3e40db289302b6de209f32ee0fd7926372d3e16..3cbad662120a58758a250b00f3955fbaec630a8e 100644 (file)
@@ -381,8 +381,9 @@ static void encode_nlm4_lock(struct xdr_stream *xdr,
  */
 static void nlm4_xdr_enc_testargs(struct rpc_rqst *req,
                                  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;
 
        encode_cookie(xdr, &args->cookie);
@@ -402,8 +403,9 @@ static void nlm4_xdr_enc_testargs(struct rpc_rqst *req,
  */
 static void nlm4_xdr_enc_lockargs(struct rpc_rqst *req,
                                  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;
 
        encode_cookie(xdr, &args->cookie);
@@ -424,8 +426,9 @@ static void nlm4_xdr_enc_lockargs(struct rpc_rqst *req,
  */
 static void nlm4_xdr_enc_cancargs(struct rpc_rqst *req,
                                  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;
 
        encode_cookie(xdr, &args->cookie);
@@ -442,8 +445,9 @@ static void nlm4_xdr_enc_cancargs(struct rpc_rqst *req,
  */
 static void nlm4_xdr_enc_unlockargs(struct rpc_rqst *req,
                                    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;
 
        encode_cookie(xdr, &args->cookie);
@@ -458,8 +462,10 @@ static void nlm4_xdr_enc_unlockargs(struct rpc_rqst *req,
  */
 static void nlm4_xdr_enc_res(struct rpc_rqst *req,
                             struct xdr_stream *xdr,
-                            const struct nlm_res *result)
+                            const void *data)
 {
+       const struct nlm_res *result = data;
+
        encode_cookie(xdr, &result->cookie);
        encode_nlm4_stat(xdr, result->status);
 }
@@ -479,8 +485,10 @@ static void nlm4_xdr_enc_res(struct rpc_rqst *req,
  */
 static void nlm4_xdr_enc_testres(struct rpc_rqst *req,
                                 struct xdr_stream *xdr,
-                                const struct nlm_res *result)
+                                const void *data)
 {
+       const struct nlm_res *result = data;
+
        encode_cookie(xdr, &result->cookie);
        encode_nlm4_stat(xdr, result->status);
        if (result->status == nlm_lck_denied)
@@ -566,7 +574,7 @@ out:
 #define PROC(proc, argtype, restype)                                   \
 [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_arglen    = NLM4_##argtype##_sz,                             \
        .p_replen    = NLM4_##restype##_sz,                             \
index 3e9f7874b9755485952632757c74aad7389e5f56..825c0fde8c80bdfc5554253beb48234a0eac2c52 100644 (file)
@@ -374,8 +374,9 @@ static void encode_nlm_lock(struct xdr_stream *xdr,
  */
 static void nlm_xdr_enc_testargs(struct rpc_rqst *req,
                                 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;
 
        encode_cookie(xdr, &args->cookie);
@@ -395,8 +396,9 @@ static void nlm_xdr_enc_testargs(struct rpc_rqst *req,
  */
 static void nlm_xdr_enc_lockargs(struct rpc_rqst *req,
                                 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;
 
        encode_cookie(xdr, &args->cookie);
@@ -417,8 +419,9 @@ static void nlm_xdr_enc_lockargs(struct rpc_rqst *req,
  */
 static void nlm_xdr_enc_cancargs(struct rpc_rqst *req,
                                 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;
 
        encode_cookie(xdr, &args->cookie);
@@ -435,8 +438,9 @@ static void nlm_xdr_enc_cancargs(struct rpc_rqst *req,
  */
 static void nlm_xdr_enc_unlockargs(struct rpc_rqst *req,
                                   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;
 
        encode_cookie(xdr, &args->cookie);
@@ -451,8 +455,10 @@ static void nlm_xdr_enc_unlockargs(struct rpc_rqst *req,
  */
 static void nlm_xdr_enc_res(struct rpc_rqst *req,
                            struct xdr_stream *xdr,
-                           const struct nlm_res *result)
+                           const void *data)
 {
+       const struct nlm_res *result = data;
+
        encode_cookie(xdr, &result->cookie);
        encode_nlm_stat(xdr, result->status);
 }
@@ -479,8 +485,10 @@ static void encode_nlm_testrply(struct xdr_stream *xdr,
 
 static void nlm_xdr_enc_testres(struct rpc_rqst *req,
                                struct xdr_stream *xdr,
-                               const struct nlm_res *result)
+                               const void *data)
 {
+       const struct nlm_res *result = data;
+
        encode_cookie(xdr, &result->cookie);
        encode_nlm_stat(xdr, result->status);
        encode_nlm_testrply(xdr, result);
@@ -564,7 +572,7 @@ out:
 #define PROC(proc, argtype, restype)   \
 [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_arglen    = NLM_##argtype##_sz,                              \
        .p_replen    = NLM_##restype##_sz,                              \
index 19166d4a8d313b73424d5668bcffa3c3baee2683..8043fd4b8a5c2caa63da28c44eefe472faa601f5 100644 (file)
@@ -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,
-                           const struct nsm_args *argp)
+                           const void *argp)
 {
        encode_mon_id(xdr, argp);
        encode_priv(xdr, argp);
 }
 
 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);
 }
@@ -532,7 +532,7 @@ static int nsm_xdr_dec_stat(struct rpc_rqst *rqstp,
 static struct rpc_procinfo     nsm_procedures[] = {
 [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_arglen       = SM_mon_sz,
                .p_replen       = SM_monres_sz,
@@ -541,7 +541,7 @@ static struct rpc_procinfo  nsm_procedures[] = {
        },
 [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_arglen       = SM_mon_id_sz,
                .p_replen       = SM_unmonres_sz,