]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - fs/nfsd/nfs4callback.c
Merge tag 'uuid-for-4.13-2' of git://git.infradead.org/users/hch/uuid
[linux.git] / fs / nfsd / nfs4callback.c
index 0274db6e65d0d6775d0b6c9c9e72e2f0c6a5fa57..49b0a9e7ff18bb70d8be183718c598eb90009a49 100644 (file)
@@ -468,7 +468,7 @@ static int decode_cb_sequence4res(struct xdr_stream *xdr,
  * NB: Without this zero space reservation, callbacks over krb5p fail
  */
 static void nfs4_xdr_enc_cb_null(struct rpc_rqst *req, struct xdr_stream *xdr,
-                                void *__unused)
+                                const void *__unused)
 {
        xdr_reserve_space(xdr, 0);
 }
@@ -477,8 +477,9 @@ static void nfs4_xdr_enc_cb_null(struct rpc_rqst *req, struct xdr_stream *xdr,
  * 20.2. Operation 4: CB_RECALL - Recall a Delegation
  */
 static void nfs4_xdr_enc_cb_recall(struct rpc_rqst *req, struct xdr_stream *xdr,
-                                  const struct nfsd4_callback *cb)
+                                  const void *data)
 {
+       const struct nfsd4_callback *cb = data;
        const struct nfs4_delegation *dp = cb_to_delegation(cb);
        struct nfs4_cb_compound_hdr hdr = {
                .ident = cb->cb_clp->cl_cb_ident,
@@ -512,8 +513,9 @@ static int nfs4_xdr_dec_cb_null(struct rpc_rqst *req, struct xdr_stream *xdr,
  */
 static int nfs4_xdr_dec_cb_recall(struct rpc_rqst *rqstp,
                                  struct xdr_stream *xdr,
-                                 struct nfsd4_callback *cb)
+                                 void *data)
 {
+       struct nfsd4_callback *cb = data;
        struct nfs4_cb_compound_hdr hdr;
        int status;
 
@@ -585,8 +587,9 @@ static void encode_cb_layout4args(struct xdr_stream *xdr,
 
 static void nfs4_xdr_enc_cb_layout(struct rpc_rqst *req,
                                   struct xdr_stream *xdr,
-                                  const struct nfsd4_callback *cb)
+                                  const void *data)
 {
+       const struct nfsd4_callback *cb = data;
        const struct nfs4_layout_stateid *ls =
                container_of(cb, struct nfs4_layout_stateid, ls_recall);
        struct nfs4_cb_compound_hdr hdr = {
@@ -602,8 +605,9 @@ static void nfs4_xdr_enc_cb_layout(struct rpc_rqst *req,
 
 static int nfs4_xdr_dec_cb_layout(struct rpc_rqst *rqstp,
                                  struct xdr_stream *xdr,
-                                 struct nfsd4_callback *cb)
+                                 void *data)
 {
+       struct nfsd4_callback *cb = data;
        struct nfs4_cb_compound_hdr hdr;
        int status;
 
@@ -631,8 +635,9 @@ static void encode_stateowner(struct xdr_stream *xdr, struct nfs4_stateowner *so
 
 static void nfs4_xdr_enc_cb_notify_lock(struct rpc_rqst *req,
                                        struct xdr_stream *xdr,
-                                       const struct nfsd4_callback *cb)
+                                       const void *data)
 {
+       const struct nfsd4_callback *cb = data;
        const struct nfsd4_blocked_lock *nbl =
                container_of(cb, struct nfsd4_blocked_lock, nbl_cb);
        struct nfs4_lockowner *lo = (struct nfs4_lockowner *)nbl->nbl_lock.fl_owner;
@@ -659,8 +664,9 @@ static void nfs4_xdr_enc_cb_notify_lock(struct rpc_rqst *req,
 
 static int nfs4_xdr_dec_cb_notify_lock(struct rpc_rqst *rqstp,
                                        struct xdr_stream *xdr,
-                                       struct nfsd4_callback *cb)
+                                       void *data)
 {
+       struct nfsd4_callback *cb = data;
        struct nfs4_cb_compound_hdr hdr;
        int status;
 
@@ -682,15 +688,15 @@ static int nfs4_xdr_dec_cb_notify_lock(struct rpc_rqst *rqstp,
 #define PROC(proc, call, argtype, restype)                             \
 [NFSPROC4_CLNT_##proc] = {                                             \
        .p_proc    = NFSPROC4_CB_##call,                                \
-       .p_encode  = (kxdreproc_t)nfs4_xdr_enc_##argtype,               \
-       .p_decode  = (kxdrdproc_t)nfs4_xdr_dec_##restype,               \
+       .p_encode  = nfs4_xdr_enc_##argtype,            \
+       .p_decode  = nfs4_xdr_dec_##restype,                            \
        .p_arglen  = NFS4_enc_##argtype##_sz,                           \
        .p_replen  = NFS4_dec_##restype##_sz,                           \
        .p_statidx = NFSPROC4_CB_##call,                                \
        .p_name    = #proc,                                             \
 }
 
-static struct rpc_procinfo nfs4_cb_procedures[] = {
+static const struct rpc_procinfo nfs4_cb_procedures[] = {
        PROC(CB_NULL,   NULL,           cb_null,        cb_null),
        PROC(CB_RECALL, COMPOUND,       cb_recall,      cb_recall),
 #ifdef CONFIG_NFSD_PNFS
@@ -699,7 +705,8 @@ static struct rpc_procinfo nfs4_cb_procedures[] = {
        PROC(CB_NOTIFY_LOCK,    COMPOUND,       cb_notify_lock, cb_notify_lock),
 };
 
-static struct rpc_version nfs_cb_version4 = {
+static unsigned int nfs4_cb_counts[ARRAY_SIZE(nfs4_cb_procedures)];
+static const struct rpc_version nfs_cb_version4 = {
 /*
  * Note on the callback rpc program version number: despite language in rfc
  * 5661 section 18.36.3 requiring servers to use 4 in this field, the
@@ -709,11 +716,12 @@ static struct rpc_version nfs_cb_version4 = {
  */
        .number                 = 1,
        .nrprocs                = ARRAY_SIZE(nfs4_cb_procedures),
-       .procs                  = nfs4_cb_procedures
+       .procs                  = nfs4_cb_procedures,
+       .counts                 = nfs4_cb_counts,
 };
 
-static const struct rpc_version *nfs_cb_version[] = {
-       &nfs_cb_version4,
+static const struct rpc_version *nfs_cb_version[2] = {
+       [1] = &nfs_cb_version4,
 };
 
 static const struct rpc_program cb_program;
@@ -787,7 +795,7 @@ static int setup_callback_client(struct nfs4_client *clp, struct nfs4_cb_conn *c
                .saddress       = (struct sockaddr *) &conn->cb_saddr,
                .timeout        = &timeparms,
                .program        = &cb_program,
-               .version        = 0,
+               .version        = 1,
                .flags          = (RPC_CLNT_CREATE_NOPING | RPC_CLNT_CREATE_QUIET),
        };
        struct rpc_clnt *client;