]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - fs/nfsd/nfs3acl.c
sunrpc: properly type pc_encode callbacks
[karo-tx-linux.git] / fs / nfsd / nfs3acl.c
index dcb5f79076c0cb3cb12400575cb7e3d3cfa9e26d..9437b758cbfdbb93fa34ad3f0251b727aba7b8b6 100644 (file)
@@ -18,7 +18,7 @@
  * NULL call.
  */
 static __be32
-nfsd3_proc_null(struct svc_rqst *rqstp, void *argp, void *resp)
+nfsd3_proc_null(struct svc_rqst *rqstp)
 {
        return nfs_ok;
 }
@@ -26,9 +26,10 @@ nfsd3_proc_null(struct svc_rqst *rqstp, void *argp, void *resp)
 /*
  * Get the Access and/or Default ACL of a file.
  */
-static __be32 nfsd3_proc_getacl(struct svc_rqst * rqstp,
-               struct nfsd3_getaclargs *argp, struct nfsd3_getaclres *resp)
+static __be32 nfsd3_proc_getacl(struct svc_rqst *rqstp)
 {
+       struct nfsd3_getaclargs *argp = rqstp->rq_argp;
+       struct nfsd3_getaclres *resp = rqstp->rq_resp;
        struct posix_acl *acl;
        struct inode *inode;
        svc_fh *fh;
@@ -80,10 +81,10 @@ fail:
 /*
  * Set the Access and/or Default ACL of a file.
  */
-static __be32 nfsd3_proc_setacl(struct svc_rqst * rqstp,
-               struct nfsd3_setaclargs *argp,
-               struct nfsd3_attrstat *resp)
+static __be32 nfsd3_proc_setacl(struct svc_rqst *rqstp)
 {
+       struct nfsd3_setaclargs *argp = rqstp->rq_argp;
+       struct nfsd3_attrstat *resp = rqstp->rq_resp;
        struct inode *inode;
        svc_fh *fh;
        __be32 nfserr = 0;
@@ -123,9 +124,10 @@ out:
 /*
  * XDR decode functions
  */
-static int nfs3svc_decode_getaclargs(struct svc_rqst *rqstp, __be32 *p,
-               struct nfsd3_getaclargs *args)
+static int nfs3svc_decode_getaclargs(struct svc_rqst *rqstp, __be32 *p)
 {
+       struct nfsd3_getaclargs *args = rqstp->rq_argp;
+
        p = nfs3svc_decode_fh(p, &args->fh);
        if (!p)
                return 0;
@@ -135,9 +137,9 @@ static int nfs3svc_decode_getaclargs(struct svc_rqst *rqstp, __be32 *p,
 }
 
 
-static int nfs3svc_decode_setaclargs(struct svc_rqst *rqstp, __be32 *p,
-               struct nfsd3_setaclargs *args)
+static int nfs3svc_decode_setaclargs(struct svc_rqst *rqstp, __be32 *p)
 {
+       struct nfsd3_setaclargs *args = rqstp->rq_argp;
        struct kvec *head = rqstp->rq_arg.head;
        unsigned int base;
        int n;
@@ -166,9 +168,9 @@ static int nfs3svc_decode_setaclargs(struct svc_rqst *rqstp, __be32 *p,
  */
 
 /* GETACL */
-static int nfs3svc_encode_getaclres(struct svc_rqst *rqstp, __be32 *p,
-               struct nfsd3_getaclres *resp)
+static int nfs3svc_encode_getaclres(struct svc_rqst *rqstp, __be32 *p)
 {
+       struct nfsd3_getaclres *resp = rqstp->rq_resp;
        struct dentry *dentry = resp->fh.fh_dentry;
 
        p = nfs3svc_encode_post_op_attr(rqstp, p, &resp->fh);
@@ -211,9 +213,10 @@ static int nfs3svc_encode_getaclres(struct svc_rqst *rqstp, __be32 *p,
 }
 
 /* SETACL */
-static int nfs3svc_encode_setaclres(struct svc_rqst *rqstp, __be32 *p,
-               struct nfsd3_attrstat *resp)
+static int nfs3svc_encode_setaclres(struct svc_rqst *rqstp, __be32 *p)
 {
+       struct nfsd3_attrstat *resp = rqstp->rq_resp;
+
        p = nfs3svc_encode_post_op_attr(rqstp, p, &resp->fh);
 
        return xdr_ressize_check(rqstp, p);
@@ -222,13 +225,13 @@ static int nfs3svc_encode_setaclres(struct svc_rqst *rqstp, __be32 *p,
 /*
  * XDR release functions
  */
-static int nfs3svc_release_getacl(struct svc_rqst *rqstp, __be32 *p,
-               struct nfsd3_getaclres *resp)
+static void nfs3svc_release_getacl(struct svc_rqst *rqstp)
 {
+       struct nfsd3_getaclres *resp = rqstp->rq_resp;
+
        fh_put(&resp->fh);
        posix_acl_release(resp->acl_access);
        posix_acl_release(resp->acl_default);
-       return 1;
 }
 
 #define nfs3svc_decode_voidargs                NULL
@@ -237,17 +240,17 @@ static int nfs3svc_release_getacl(struct svc_rqst *rqstp, __be32 *p,
 #define nfsd3_voidres                  nfsd3_voidargs
 struct nfsd3_voidargs { int dummy; };
 
-#define PROC(name, argt, rest, relt, cache, respsize)  \
- { (svc_procfunc) nfsd3_proc_##name,           \
-   (kxdrproc_t) nfs3svc_decode_##argt##args,   \
-   (kxdrproc_t) nfs3svc_encode_##rest##res,    \
-   (kxdrproc_t) nfs3svc_release_##relt,                \
-   sizeof(struct nfsd3_##argt##args),          \
-   sizeof(struct nfsd3_##rest##res),           \
-   0,                                          \
-   cache,                                      \
-   respsize,                                   \
- }
+#define PROC(name, argt, rest, relt, cache, respsize)                  \
+{                                                                      \
+       .pc_func        = nfsd3_proc_##name,                            \
+       .pc_decode      = nfs3svc_decode_##argt##args,                  \
+       .pc_encode      = nfs3svc_encode_##rest##res,                   \
+       .pc_release     = nfs3svc_release_##relt,                       \
+       .pc_argsize     = sizeof(struct nfsd3_##argt##args),            \
+       .pc_ressize     = sizeof(struct nfsd3_##rest##res),             \
+       .pc_cachetype   = cache,                                        \
+       .pc_xdrressize  = respsize,                                     \
+}
 
 #define ST 1           /* status*/
 #define AT 21          /* attributes */