]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
sunrpc: mark all struct svc_version instances as const
authorChristoph Hellwig <hch@lst.de>
Fri, 12 May 2017 14:21:37 +0000 (16:21 +0200)
committerAnna Schumaker <Anna.Schumaker@Netapp.com>
Thu, 13 Jul 2017 19:58:03 +0000 (15:58 -0400)
Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: Trond Myklebust <trond.myklebust@primarydata.com>
14 files changed:
fs/lockd/svc.c
fs/nfs/callback.c
fs/nfs/callback_xdr.c
fs/nfs/internal.h
fs/nfs/nfs4_fs.h
fs/nfsd/nfs2acl.c
fs/nfsd/nfs3acl.c
fs/nfsd/nfs3proc.c
fs/nfsd/nfs4proc.c
fs/nfsd/nfsd.h
fs/nfsd/nfsproc.c
fs/nfsd/nfssvc.c
include/linux/sunrpc/svc.h
net/sunrpc/svc.c

index cc6abe6280bce7479a144f8619a1489d98d881be..726b6cecf430d8d9cd522338436562df71efe6dc 100644 (file)
@@ -740,32 +740,32 @@ module_exit(exit_nlm);
  * Define NLM program and procedures
  */
 static unsigned int nlmsvc_version1_count[17];
-static struct svc_version      nlmsvc_version1 = {
-               .vs_vers        = 1,
-               .vs_nproc       = 17,
-               .vs_proc        = nlmsvc_procedures,
-               .vs_count       = nlmsvc_version1_count,
-               .vs_xdrsize     = NLMSVC_XDRSIZE,
+static const struct svc_version        nlmsvc_version1 = {
+       .vs_vers        = 1,
+       .vs_nproc       = 17,
+       .vs_proc        = nlmsvc_procedures,
+       .vs_count       = nlmsvc_version1_count,
+       .vs_xdrsize     = NLMSVC_XDRSIZE,
 };
 static unsigned int nlmsvc_version3_count[24];
-static struct svc_version      nlmsvc_version3 = {
-               .vs_vers        = 3,
-               .vs_nproc       = 24,
-               .vs_proc        = nlmsvc_procedures,
-               .vs_count       = nlmsvc_version3_count,
-               .vs_xdrsize     = NLMSVC_XDRSIZE,
+static const struct svc_version        nlmsvc_version3 = {
+       .vs_vers        = 3,
+       .vs_nproc       = 24,
+       .vs_proc        = nlmsvc_procedures,
+       .vs_count       = nlmsvc_version3_count,
+       .vs_xdrsize     = NLMSVC_XDRSIZE,
 };
 #ifdef CONFIG_LOCKD_V4
 static unsigned int nlmsvc_version4_count[24];
-static struct svc_version      nlmsvc_version4 = {
-               .vs_vers        = 4,
-               .vs_nproc       = 24,
-               .vs_proc        = nlmsvc_procedures4,
-               .vs_count       = nlmsvc_version4_count,
-               .vs_xdrsize     = NLMSVC_XDRSIZE,
+static const struct svc_version        nlmsvc_version4 = {
+       .vs_vers        = 4,
+       .vs_nproc       = 24,
+       .vs_proc        = nlmsvc_procedures4,
+       .vs_count       = nlmsvc_version4_count,
+       .vs_xdrsize     = NLMSVC_XDRSIZE,
 };
 #endif
-static struct svc_version *    nlmsvc_version[] = {
+static const struct svc_version *nlmsvc_version[] = {
        [1] = &nlmsvc_version1,
        [3] = &nlmsvc_version3,
 #ifdef CONFIG_LOCKD_V4
index 73a1f928226c05706bab82a37468973bff7b185c..34323877ec132f8b163d2c1118e45ab8c319fe71 100644 (file)
@@ -439,7 +439,7 @@ static int nfs_callback_authenticate(struct svc_rqst *rqstp)
 /*
  * Define NFS4 callback program
  */
-static struct svc_version *nfs4_callback_version[] = {
+static const struct svc_version *nfs4_callback_version[] = {
        [1] = &nfs4_callback_version1,
        [4] = &nfs4_callback_version4,
 };
index ae249f27297f94f1e3b56fe55365c4e664a5094f..01a430e51daade430cb3d2a4c3bc9f31decdc62f 100644 (file)
@@ -1012,7 +1012,7 @@ static const struct svc_procedure nfs4_callback_procedures1[] = {
 };
 
 static unsigned int nfs4_callback_count1[ARRAY_SIZE(nfs4_callback_procedures1)];
-struct svc_version nfs4_callback_version1 = {
+const struct svc_version nfs4_callback_version1 = {
        .vs_vers = 1,
        .vs_nproc = ARRAY_SIZE(nfs4_callback_procedures1),
        .vs_proc = nfs4_callback_procedures1,
@@ -1024,7 +1024,7 @@ struct svc_version nfs4_callback_version1 = {
 };
 
 static unsigned int nfs4_callback_count4[ARRAY_SIZE(nfs4_callback_procedures1)];
-struct svc_version nfs4_callback_version4 = {
+const struct svc_version nfs4_callback_version4 = {
        .vs_vers = 4,
        .vs_nproc = ARRAY_SIZE(nfs4_callback_procedures1),
        .vs_proc = nfs4_callback_procedures1,
index dc2a29a7d48b00f064909a61dc1ba5798cb66d5a..1c0ce9c15e944d848de6f889ee2a93ce39407ca7 100644 (file)
@@ -225,8 +225,8 @@ static inline void nfs_fs_proc_exit(void)
 #endif
 
 /* callback_xdr.c */
-extern struct svc_version nfs4_callback_version1;
-extern struct svc_version nfs4_callback_version4;
+extern const struct svc_version nfs4_callback_version1;
+extern const struct svc_version nfs4_callback_version4;
 
 struct nfs_pageio_descriptor;
 /* pagelist.c */
index 9b0cf3872722b9de0b75b14d99c1dc4b0dd70938..40bd05f05e743f01228d09b7d9d23d8fbe7bb213 100644 (file)
@@ -498,8 +498,8 @@ extern const struct rpc_procinfo nfs4_procedures[];
 struct nfs4_mount_data;
 
 /* callback_xdr.c */
-extern struct svc_version nfs4_callback_version1;
-extern struct svc_version nfs4_callback_version4;
+extern const struct svc_version nfs4_callback_version1;
+extern const struct svc_version nfs4_callback_version4;
 
 static inline void nfs4_stateid_copy(nfs4_stateid *dst, const nfs4_stateid *src)
 {
index c3f6b8a6b659c5d7a091ea5ad6c566ea5ee3d552..6276ec8608b0674a5bcd9d35a1c271a4816b1613 100644 (file)
@@ -379,11 +379,11 @@ static const struct svc_procedure nfsd_acl_procedures2[] = {
 };
 
 static unsigned int nfsd_acl_count2[ARRAY_SIZE(nfsd_acl_procedures2)];
-struct svc_version     nfsd_acl_version2 = {
-               .vs_vers        = 2,
-               .vs_nproc       = 5,
-               .vs_proc        = nfsd_acl_procedures2,
-               .vs_count       = nfsd_acl_count2,
-               .vs_dispatch    = nfsd_dispatch,
-               .vs_xdrsize     = NFS3_SVC_XDRSIZE,
+const struct svc_version nfsd_acl_version2 = {
+       .vs_vers        = 2,
+       .vs_nproc       = 5,
+       .vs_proc        = nfsd_acl_procedures2,
+       .vs_count       = nfsd_acl_count2,
+       .vs_dispatch    = nfsd_dispatch,
+       .vs_xdrsize     = NFS3_SVC_XDRSIZE,
 };
index 1a482ac9d4e953082bcb1746ba9413ca5b1ba1a9..01976529f04240f45cf7dcf0246c193e5be8d77a 100644 (file)
@@ -264,12 +264,12 @@ static const struct svc_procedure nfsd_acl_procedures3[] = {
 };
 
 static unsigned int nfsd_acl_count3[ARRAY_SIZE(nfsd_acl_procedures3)];
-struct svc_version     nfsd_acl_version3 = {
-               .vs_vers        = 3,
-               .vs_nproc       = 3,
-               .vs_proc        = nfsd_acl_procedures3,
-               .vs_count       = nfsd_acl_count3,
-               .vs_dispatch    = nfsd_dispatch,
-               .vs_xdrsize     = NFS3_SVC_XDRSIZE,
+const struct svc_version nfsd_acl_version3 = {
+       .vs_vers        = 3,
+       .vs_nproc       = 3,
+       .vs_proc        = nfsd_acl_procedures3,
+       .vs_count       = nfsd_acl_count3,
+       .vs_dispatch    = nfsd_dispatch,
+       .vs_xdrsize     = NFS3_SVC_XDRSIZE,
 };
 
index 96e0e6a2af5109f9f8e97a34a1da7355fb2f996c..2cb56a0d6625f07db79447768fac92c86940d9b7 100644 (file)
@@ -891,11 +891,11 @@ static const struct svc_procedure nfsd_procedures3[22] = {
 };
 
 static unsigned int nfsd_count3[ARRAY_SIZE(nfsd_procedures3)];
-struct svc_version     nfsd_version3 = {
-               .vs_vers        = 3,
-               .vs_nproc       = 22,
-               .vs_proc        = nfsd_procedures3,
-               .vs_count       = nfsd_count3,
-               .vs_dispatch    = nfsd_dispatch,
-               .vs_xdrsize     = NFS3_SVC_XDRSIZE,
+const struct svc_version nfsd_version3 = {
+       .vs_vers        = 3,
+       .vs_nproc       = 22,
+       .vs_proc        = nfsd_procedures3,
+       .vs_dispatch    = nfsd_dispatch,
+       .vs_count       = nfsd_count3,
+       .vs_xdrsize     = NFS3_SVC_XDRSIZE,
 };
index 68aa175b1cb32149ef5119f5a33c7611bf40344f..3cbd065c639f86cc0e6b0990ecbec1da8f8aaeb8 100644 (file)
@@ -2554,7 +2554,7 @@ static const struct svc_procedure nfsd_procedures4[2] = {
 };
 
 static unsigned int nfsd_count3[ARRAY_SIZE(nfsd_procedures4)];
-struct svc_version     nfsd_version4 = {
+const struct svc_version nfsd_version4 = {
        .vs_vers                = 4,
        .vs_nproc               = 2,
        .vs_proc                = nfsd_procedures4,
index d96606801d47ae6ee9927a2991263780c00840d7..b9c538ab7a59bf48cd56f956045804596ad040e2 100644 (file)
@@ -60,7 +60,7 @@ struct readdir_cd {
 
 
 extern struct svc_program      nfsd_program;
-extern struct svc_version      nfsd_version2, nfsd_version3,
+extern const struct svc_version        nfsd_version2, nfsd_version3,
                                nfsd_version4;
 extern struct mutex            nfsd_mutex;
 extern spinlock_t              nfsd_drc_lock;
@@ -86,12 +86,12 @@ void                nfsd_destroy(struct net *net);
 
 #if defined(CONFIG_NFSD_V2_ACL) || defined(CONFIG_NFSD_V3_ACL)
 #ifdef CONFIG_NFSD_V2_ACL
-extern struct svc_version nfsd_acl_version2;
+extern const struct svc_version nfsd_acl_version2;
 #else
 #define nfsd_acl_version2 NULL
 #endif
 #ifdef CONFIG_NFSD_V3_ACL
-extern struct svc_version nfsd_acl_version3;
+extern const struct svc_version nfsd_acl_version3;
 #else
 #define nfsd_acl_version3 NULL
 #endif
index a68b686fda121fba4f1088808a95502c9eeeb842..5076ae2b82585fb563822483cf1b10f208f5e9ab 100644 (file)
@@ -744,13 +744,13 @@ static const struct svc_procedure nfsd_procedures2[18] = {
 
 
 static unsigned int nfsd_count2[ARRAY_SIZE(nfsd_procedures2)];
-struct svc_version     nfsd_version2 = {
-               .vs_vers        = 2,
-               .vs_nproc       = 18,
-               .vs_proc        = nfsd_procedures2,
-               .vs_count       = nfsd_count2,
-               .vs_dispatch    = nfsd_dispatch,
-               .vs_xdrsize     = NFS2_SVC_XDRSIZE,
+const struct svc_version nfsd_version2 = {
+       .vs_vers        = 2,
+       .vs_nproc       = 18,
+       .vs_proc        = nfsd_procedures2,
+       .vs_count       = nfsd_count2,
+       .vs_dispatch    = nfsd_dispatch,
+       .vs_xdrsize     = NFS2_SVC_XDRSIZE,
 };
 
 /*
index 379b310c445d3c0352dc00d951da1a27f9dce341..063ae7de2c12245fdce41a8b72d97003490fa69f 100644 (file)
@@ -68,14 +68,14 @@ unsigned long       nfsd_drc_mem_used;
 
 #if defined(CONFIG_NFSD_V2_ACL) || defined(CONFIG_NFSD_V3_ACL)
 static struct svc_stat nfsd_acl_svcstats;
-static struct svc_version *    nfsd_acl_version[] = {
+static const struct svc_version *nfsd_acl_version[] = {
        [2] = &nfsd_acl_version2,
        [3] = &nfsd_acl_version3,
 };
 
 #define NFSD_ACL_MINVERS            2
 #define NFSD_ACL_NRVERS                ARRAY_SIZE(nfsd_acl_version)
-static struct svc_version *nfsd_acl_versions[NFSD_ACL_NRVERS];
+static const struct svc_version *nfsd_acl_versions[NFSD_ACL_NRVERS];
 
 static struct svc_program      nfsd_acl_program = {
        .pg_prog                = NFS_ACL_PROGRAM,
@@ -92,7 +92,7 @@ static struct svc_stat        nfsd_acl_svcstats = {
 };
 #endif /* defined(CONFIG_NFSD_V2_ACL) || defined(CONFIG_NFSD_V3_ACL) */
 
-static struct svc_version *    nfsd_version[] = {
+static const struct svc_version *nfsd_version[] = {
        [2] = &nfsd_version2,
 #if defined(CONFIG_NFSD_V3)
        [3] = &nfsd_version3,
@@ -104,7 +104,7 @@ static struct svc_version * nfsd_version[] = {
 
 #define NFSD_MINVERS           2
 #define NFSD_NRVERS            ARRAY_SIZE(nfsd_version)
-static struct svc_version *nfsd_versions[NFSD_NRVERS];
+static const struct svc_version *nfsd_versions[NFSD_NRVERS];
 
 struct svc_program             nfsd_program = {
 #if defined(CONFIG_NFSD_V2_ACL) || defined(CONFIG_NFSD_V3_ACL)
index 992ea34197958a8c56cb99b8ee8df2947c5d8da6..eec04982a7ea355dcefebeeb7d8488aa56c4e2e8 100644 (file)
@@ -384,7 +384,7 @@ struct svc_program {
        unsigned int            pg_lovers;      /* lowest version */
        unsigned int            pg_hivers;      /* highest version */
        unsigned int            pg_nvers;       /* number of versions */
-       struct svc_version **   pg_vers;        /* version array */
+       const struct svc_version **pg_vers;     /* version array */
        char *                  pg_name;        /* service name */
        char *                  pg_class;       /* class name: services sharing authentication */
        struct svc_stat *       pg_stats;       /* rpc statistics */
index 049963d676a79fc05d983e1bd093ba03cb080cc4..45b4f2d2e3bdfa226dc6bb484f5e1741e7d6515f 100644 (file)
@@ -1008,7 +1008,7 @@ int svc_register(const struct svc_serv *serv, struct net *net,
                 const unsigned short port)
 {
        struct svc_program      *progp;
-       struct svc_version      *vers;
+       const struct svc_version *vers;
        unsigned int            i;
        int                     error = 0;
 
@@ -1151,7 +1151,7 @@ static int
 svc_process_common(struct svc_rqst *rqstp, struct kvec *argv, struct kvec *resv)
 {
        struct svc_program      *progp;
-       struct svc_version      *versp = NULL;  /* compiler food */
+       const struct svc_version *versp = NULL; /* compiler food */
        const struct svc_procedure *procp = NULL;
        struct svc_serv         *serv = rqstp->rq_server;
        __be32                  *statp;