aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2012-01-20 13:53:56 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2012-01-31 19:28:20 -0500
commita613fa168afc19179a7547fbba45644c5b6912bf (patch)
tree02db1b9ca905ff49d9811175607757e3a885325f
parent080b794ce5ad318ce34c52abaedf1bc6788a5abb (diff)
SUNRPC: constify the rpc_program
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
-rw-r--r--fs/lockd/clnt4xdr.c2
-rw-r--r--fs/lockd/clntxdr.c8
-rw-r--r--fs/lockd/mon.c8
-rw-r--r--fs/nfs/client.c8
-rw-r--r--fs/nfs/internal.h2
-rw-r--r--fs/nfs/mount_clnt.c10
-rw-r--r--fs/nfs/nfs2xdr.c2
-rw-r--r--fs/nfs/nfs3xdr.c4
-rw-r--r--fs/nfs/nfs4xdr.c2
-rw-r--r--fs/nfsd/nfs4callback.c6
-rw-r--r--include/linux/lockd/lockd.h2
-rw-r--r--include/linux/lockd/xdr4.h2
-rw-r--r--include/linux/nfs_xdr.h10
-rw-r--r--include/linux/sunrpc/clnt.h8
-rw-r--r--include/linux/sunrpc/stats.h6
-rw-r--r--net/sunrpc/clnt.c8
-rw-r--r--net/sunrpc/rpcb_clnt.c20
17 files changed, 54 insertions, 54 deletions
diff --git a/fs/lockd/clnt4xdr.c b/fs/lockd/clnt4xdr.c
index f848b52c67b1..3ddcbb1c0a43 100644
--- a/fs/lockd/clnt4xdr.c
+++ b/fs/lockd/clnt4xdr.c
@@ -598,7 +598,7 @@ static struct rpc_procinfo nlm4_procedures[] = {
598 PROC(GRANTED_RES, res, norep), 598 PROC(GRANTED_RES, res, norep),
599}; 599};
600 600
601struct rpc_version nlm_version4 = { 601const struct rpc_version nlm_version4 = {
602 .number = 4, 602 .number = 4,
603 .nrprocs = ARRAY_SIZE(nlm4_procedures), 603 .nrprocs = ARRAY_SIZE(nlm4_procedures),
604 .procs = nlm4_procedures, 604 .procs = nlm4_procedures,
diff --git a/fs/lockd/clntxdr.c b/fs/lockd/clntxdr.c
index 180ac34feb9a..3d35e3e80c1c 100644
--- a/fs/lockd/clntxdr.c
+++ b/fs/lockd/clntxdr.c
@@ -596,19 +596,19 @@ static struct rpc_procinfo nlm_procedures[] = {
596 PROC(GRANTED_RES, res, norep), 596 PROC(GRANTED_RES, res, norep),
597}; 597};
598 598
599static struct rpc_version nlm_version1 = { 599static const struct rpc_version nlm_version1 = {
600 .number = 1, 600 .number = 1,
601 .nrprocs = ARRAY_SIZE(nlm_procedures), 601 .nrprocs = ARRAY_SIZE(nlm_procedures),
602 .procs = nlm_procedures, 602 .procs = nlm_procedures,
603}; 603};
604 604
605static struct rpc_version nlm_version3 = { 605static const struct rpc_version nlm_version3 = {
606 .number = 3, 606 .number = 3,
607 .nrprocs = ARRAY_SIZE(nlm_procedures), 607 .nrprocs = ARRAY_SIZE(nlm_procedures),
608 .procs = nlm_procedures, 608 .procs = nlm_procedures,
609}; 609};
610 610
611static struct rpc_version *nlm_versions[] = { 611static const struct rpc_version *nlm_versions[] = {
612 [1] = &nlm_version1, 612 [1] = &nlm_version1,
613 [3] = &nlm_version3, 613 [3] = &nlm_version3,
614#ifdef CONFIG_LOCKD_V4 614#ifdef CONFIG_LOCKD_V4
@@ -618,7 +618,7 @@ static struct rpc_version *nlm_versions[] = {
618 618
619static struct rpc_stat nlm_rpc_stats; 619static struct rpc_stat nlm_rpc_stats;
620 620
621struct rpc_program nlm_program = { 621const struct rpc_program nlm_program = {
622 .name = "lockd", 622 .name = "lockd",
623 .number = NLM_PROGRAM, 623 .number = NLM_PROGRAM,
624 .nrvers = ARRAY_SIZE(nlm_versions), 624 .nrvers = ARRAY_SIZE(nlm_versions),
diff --git a/fs/lockd/mon.c b/fs/lockd/mon.c
index 65ba36b80a9e..c196030e530a 100644
--- a/fs/lockd/mon.c
+++ b/fs/lockd/mon.c
@@ -47,7 +47,7 @@ struct nsm_res {
47 u32 state; 47 u32 state;
48}; 48};
49 49
50static struct rpc_program nsm_program; 50static const struct rpc_program nsm_program;
51static LIST_HEAD(nsm_handles); 51static LIST_HEAD(nsm_handles);
52static DEFINE_SPINLOCK(nsm_lock); 52static DEFINE_SPINLOCK(nsm_lock);
53 53
@@ -534,19 +534,19 @@ static struct rpc_procinfo nsm_procedures[] = {
534 }, 534 },
535}; 535};
536 536
537static struct rpc_version nsm_version1 = { 537static const struct rpc_version nsm_version1 = {
538 .number = 1, 538 .number = 1,
539 .nrprocs = ARRAY_SIZE(nsm_procedures), 539 .nrprocs = ARRAY_SIZE(nsm_procedures),
540 .procs = nsm_procedures 540 .procs = nsm_procedures
541}; 541};
542 542
543static struct rpc_version * nsm_version[] = { 543static const struct rpc_version *nsm_version[] = {
544 [1] = &nsm_version1, 544 [1] = &nsm_version1,
545}; 545};
546 546
547static struct rpc_stat nsm_stats; 547static struct rpc_stat nsm_stats;
548 548
549static struct rpc_program nsm_program = { 549static const struct rpc_program nsm_program = {
550 .name = "statd", 550 .name = "statd",
551 .number = NSM_PROGRAM, 551 .number = NSM_PROGRAM,
552 .nrvers = ARRAY_SIZE(nsm_version), 552 .nrvers = ARRAY_SIZE(nsm_version),
diff --git a/fs/nfs/client.c b/fs/nfs/client.c
index 34c8d1cbf06e..98af1cb28ee3 100644
--- a/fs/nfs/client.c
+++ b/fs/nfs/client.c
@@ -89,7 +89,7 @@ static bool nfs4_disable_idmapping = true;
89/* 89/*
90 * RPC cruft for NFS 90 * RPC cruft for NFS
91 */ 91 */
92static struct rpc_version *nfs_version[5] = { 92static const struct rpc_version *nfs_version[5] = {
93 [2] = &nfs_version2, 93 [2] = &nfs_version2,
94#ifdef CONFIG_NFS_V3 94#ifdef CONFIG_NFS_V3
95 [3] = &nfs_version3, 95 [3] = &nfs_version3,
@@ -99,7 +99,7 @@ static struct rpc_version *nfs_version[5] = {
99#endif 99#endif
100}; 100};
101 101
102struct rpc_program nfs_program = { 102const struct rpc_program nfs_program = {
103 .name = "nfs", 103 .name = "nfs",
104 .number = NFS_PROGRAM, 104 .number = NFS_PROGRAM,
105 .nrvers = ARRAY_SIZE(nfs_version), 105 .nrvers = ARRAY_SIZE(nfs_version),
@@ -115,11 +115,11 @@ struct rpc_stat nfs_rpcstat = {
115 115
116#ifdef CONFIG_NFS_V3_ACL 116#ifdef CONFIG_NFS_V3_ACL
117static struct rpc_stat nfsacl_rpcstat = { &nfsacl_program }; 117static struct rpc_stat nfsacl_rpcstat = { &nfsacl_program };
118static struct rpc_version * nfsacl_version[] = { 118static const struct rpc_version *nfsacl_version[] = {
119 [3] = &nfsacl_version3, 119 [3] = &nfsacl_version3,
120}; 120};
121 121
122struct rpc_program nfsacl_program = { 122const struct rpc_program nfsacl_program = {
123 .name = "nfsacl", 123 .name = "nfsacl",
124 .number = NFS_ACL_PROGRAM, 124 .number = NFS_ACL_PROGRAM,
125 .nrvers = ARRAY_SIZE(nfsacl_version), 125 .nrvers = ARRAY_SIZE(nfsacl_version),
diff --git a/fs/nfs/internal.h b/fs/nfs/internal.h
index eda4cde40fb2..cdb121d3c6f4 100644
--- a/fs/nfs/internal.h
+++ b/fs/nfs/internal.h
@@ -145,7 +145,7 @@ extern int nfs_mount(struct nfs_mount_request *info);
145extern void nfs_umount(const struct nfs_mount_request *info); 145extern void nfs_umount(const struct nfs_mount_request *info);
146 146
147/* client.c */ 147/* client.c */
148extern struct rpc_program nfs_program; 148extern const struct rpc_program nfs_program;
149 149
150extern void nfs_cleanup_cb_ident_idr(void); 150extern void nfs_cleanup_cb_ident_idr(void);
151extern void nfs_put_client(struct nfs_client *); 151extern void nfs_put_client(struct nfs_client *);
diff --git a/fs/nfs/mount_clnt.c b/fs/nfs/mount_clnt.c
index 4fbe3a8e5e6b..b37ca34af903 100644
--- a/fs/nfs/mount_clnt.c
+++ b/fs/nfs/mount_clnt.c
@@ -67,7 +67,7 @@ enum {
67 MOUNTPROC3_EXPORT = 5, 67 MOUNTPROC3_EXPORT = 5,
68}; 68};
69 69
70static struct rpc_program mnt_program; 70static const struct rpc_program mnt_program;
71 71
72/* 72/*
73 * Defined by OpenGroup XNFS Version 3W, chapter 8 73 * Defined by OpenGroup XNFS Version 3W, chapter 8
@@ -488,19 +488,19 @@ static struct rpc_procinfo mnt3_procedures[] = {
488}; 488};
489 489
490 490
491static struct rpc_version mnt_version1 = { 491static const struct rpc_version mnt_version1 = {
492 .number = 1, 492 .number = 1,
493 .nrprocs = ARRAY_SIZE(mnt_procedures), 493 .nrprocs = ARRAY_SIZE(mnt_procedures),
494 .procs = mnt_procedures, 494 .procs = mnt_procedures,
495}; 495};
496 496
497static struct rpc_version mnt_version3 = { 497static const struct rpc_version mnt_version3 = {
498 .number = 3, 498 .number = 3,
499 .nrprocs = ARRAY_SIZE(mnt3_procedures), 499 .nrprocs = ARRAY_SIZE(mnt3_procedures),
500 .procs = mnt3_procedures, 500 .procs = mnt3_procedures,
501}; 501};
502 502
503static struct rpc_version *mnt_version[] = { 503static const struct rpc_version *mnt_version[] = {
504 NULL, 504 NULL,
505 &mnt_version1, 505 &mnt_version1,
506 NULL, 506 NULL,
@@ -509,7 +509,7 @@ static struct rpc_version *mnt_version[] = {
509 509
510static struct rpc_stat mnt_stats; 510static struct rpc_stat mnt_stats;
511 511
512static struct rpc_program mnt_program = { 512static const struct rpc_program mnt_program = {
513 .name = "mount", 513 .name = "mount",
514 .number = NFS_MNT_PROGRAM, 514 .number = NFS_MNT_PROGRAM,
515 .nrvers = ARRAY_SIZE(mnt_version), 515 .nrvers = ARRAY_SIZE(mnt_version),
diff --git a/fs/nfs/nfs2xdr.c b/fs/nfs/nfs2xdr.c
index 792cb13a4304..1f56000fabbd 100644
--- a/fs/nfs/nfs2xdr.c
+++ b/fs/nfs/nfs2xdr.c
@@ -1150,7 +1150,7 @@ struct rpc_procinfo nfs_procedures[] = {
1150 PROC(STATFS, fhandle, statfsres, 0), 1150 PROC(STATFS, fhandle, statfsres, 0),
1151}; 1151};
1152 1152
1153struct rpc_version nfs_version2 = { 1153const struct rpc_version nfs_version2 = {
1154 .number = 2, 1154 .number = 2,
1155 .nrprocs = ARRAY_SIZE(nfs_procedures), 1155 .nrprocs = ARRAY_SIZE(nfs_procedures),
1156 .procs = nfs_procedures 1156 .procs = nfs_procedures
diff --git a/fs/nfs/nfs3xdr.c b/fs/nfs/nfs3xdr.c
index 183c6b123d0f..a77cc9a3ce55 100644
--- a/fs/nfs/nfs3xdr.c
+++ b/fs/nfs/nfs3xdr.c
@@ -2461,7 +2461,7 @@ struct rpc_procinfo nfs3_procedures[] = {
2461 PROC(COMMIT, commit, commit, 5), 2461 PROC(COMMIT, commit, commit, 5),
2462}; 2462};
2463 2463
2464struct rpc_version nfs_version3 = { 2464const struct rpc_version nfs_version3 = {
2465 .number = 3, 2465 .number = 3,
2466 .nrprocs = ARRAY_SIZE(nfs3_procedures), 2466 .nrprocs = ARRAY_SIZE(nfs3_procedures),
2467 .procs = nfs3_procedures 2467 .procs = nfs3_procedures
@@ -2489,7 +2489,7 @@ static struct rpc_procinfo nfs3_acl_procedures[] = {
2489 }, 2489 },
2490}; 2490};
2491 2491
2492struct rpc_version nfsacl_version3 = { 2492const struct rpc_version nfsacl_version3 = {
2493 .number = 3, 2493 .number = 3,
2494 .nrprocs = sizeof(nfs3_acl_procedures)/ 2494 .nrprocs = sizeof(nfs3_acl_procedures)/
2495 sizeof(nfs3_acl_procedures[0]), 2495 sizeof(nfs3_acl_procedures[0]),
diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c
index 95e92e438407..4633d405a94c 100644
--- a/fs/nfs/nfs4xdr.c
+++ b/fs/nfs/nfs4xdr.c
@@ -7109,7 +7109,7 @@ struct rpc_procinfo nfs4_procedures[] = {
7109#endif /* CONFIG_NFS_V4_1 */ 7109#endif /* CONFIG_NFS_V4_1 */
7110}; 7110};
7111 7111
7112struct rpc_version nfs_version4 = { 7112const struct rpc_version nfs_version4 = {
7113 .number = 4, 7113 .number = 4,
7114 .nrprocs = ARRAY_SIZE(nfs4_procedures), 7114 .nrprocs = ARRAY_SIZE(nfs4_procedures),
7115 .procs = nfs4_procedures 7115 .procs = nfs4_procedures
diff --git a/fs/nfsd/nfs4callback.c b/fs/nfsd/nfs4callback.c
index 426ccb171650..0e262f32ac41 100644
--- a/fs/nfsd/nfs4callback.c
+++ b/fs/nfsd/nfs4callback.c
@@ -605,18 +605,18 @@ static struct rpc_version nfs_cb_version4 = {
605 .procs = nfs4_cb_procedures 605 .procs = nfs4_cb_procedures
606}; 606};
607 607
608static struct rpc_version *nfs_cb_version[] = { 608static const struct rpc_version *nfs_cb_version[] = {
609 &nfs_cb_version4, 609 &nfs_cb_version4,
610}; 610};
611 611
612static struct rpc_program cb_program; 612static const struct rpc_program cb_program;
613 613
614static struct rpc_stat cb_stats = { 614static struct rpc_stat cb_stats = {
615 .program = &cb_program 615 .program = &cb_program
616}; 616};
617 617
618#define NFS4_CALLBACK 0x40000000 618#define NFS4_CALLBACK 0x40000000
619static struct rpc_program cb_program = { 619static const struct rpc_program cb_program = {
620 .name = "nfs4_cb", 620 .name = "nfs4_cb",
621 .number = NFS4_CALLBACK, 621 .number = NFS4_CALLBACK,
622 .nrvers = ARRAY_SIZE(nfs_cb_version), 622 .nrvers = ARRAY_SIZE(nfs_cb_version),
diff --git a/include/linux/lockd/lockd.h b/include/linux/lockd/lockd.h
index 88a114fce477..8949167a148d 100644
--- a/include/linux/lockd/lockd.h
+++ b/include/linux/lockd/lockd.h
@@ -188,7 +188,7 @@ struct nlm_block {
188/* 188/*
189 * Global variables 189 * Global variables
190 */ 190 */
191extern struct rpc_program nlm_program; 191extern const struct rpc_program nlm_program;
192extern struct svc_procedure nlmsvc_procedures[]; 192extern struct svc_procedure nlmsvc_procedures[];
193#ifdef CONFIG_LOCKD_V4 193#ifdef CONFIG_LOCKD_V4
194extern struct svc_procedure nlmsvc_procedures4[]; 194extern struct svc_procedure nlmsvc_procedures4[];
diff --git a/include/linux/lockd/xdr4.h b/include/linux/lockd/xdr4.h
index 7353821341ed..e58c88b52ce1 100644
--- a/include/linux/lockd/xdr4.h
+++ b/include/linux/lockd/xdr4.h
@@ -42,6 +42,6 @@ int nlmclt_encode_lockargs(struct rpc_rqst *, u32 *, struct nlm_args *);
42int nlmclt_encode_cancargs(struct rpc_rqst *, u32 *, struct nlm_args *); 42int nlmclt_encode_cancargs(struct rpc_rqst *, u32 *, struct nlm_args *);
43int nlmclt_encode_unlockargs(struct rpc_rqst *, u32 *, struct nlm_args *); 43int nlmclt_encode_unlockargs(struct rpc_rqst *, u32 *, struct nlm_args *);
44 */ 44 */
45extern struct rpc_version nlm_version4; 45extern const struct rpc_version nlm_version4;
46 46
47#endif /* LOCKD_XDR4_H */ 47#endif /* LOCKD_XDR4_H */
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h
index f5188e10ea0e..144419a9cbd3 100644
--- a/include/linux/nfs_xdr.h
+++ b/include/linux/nfs_xdr.h
@@ -1274,11 +1274,11 @@ struct nfs_rpc_ops {
1274extern const struct nfs_rpc_ops nfs_v2_clientops; 1274extern const struct nfs_rpc_ops nfs_v2_clientops;
1275extern const struct nfs_rpc_ops nfs_v3_clientops; 1275extern const struct nfs_rpc_ops nfs_v3_clientops;
1276extern const struct nfs_rpc_ops nfs_v4_clientops; 1276extern const struct nfs_rpc_ops nfs_v4_clientops;
1277extern struct rpc_version nfs_version2; 1277extern const struct rpc_version nfs_version2;
1278extern struct rpc_version nfs_version3; 1278extern const struct rpc_version nfs_version3;
1279extern struct rpc_version nfs_version4; 1279extern const struct rpc_version nfs_version4;
1280 1280
1281extern struct rpc_version nfsacl_version3; 1281extern const struct rpc_version nfsacl_version3;
1282extern struct rpc_program nfsacl_program; 1282extern const struct rpc_program nfsacl_program;
1283 1283
1284#endif 1284#endif
diff --git a/include/linux/sunrpc/clnt.h b/include/linux/sunrpc/clnt.h
index 4a46ffd73a04..a4c62e95c720 100644
--- a/include/linux/sunrpc/clnt.h
+++ b/include/linux/sunrpc/clnt.h
@@ -61,7 +61,7 @@ struct rpc_clnt {
61 struct rpc_clnt * cl_parent; /* Points to parent of clones */ 61 struct rpc_clnt * cl_parent; /* Points to parent of clones */
62 struct rpc_rtt cl_rtt_default; 62 struct rpc_rtt cl_rtt_default;
63 struct rpc_timeout cl_timeout_default; 63 struct rpc_timeout cl_timeout_default;
64 struct rpc_program * cl_program; 64 const struct rpc_program *cl_program;
65 char *cl_principal; /* target to authenticate to */ 65 char *cl_principal; /* target to authenticate to */
66}; 66};
67 67
@@ -73,7 +73,7 @@ struct rpc_program {
73 const char * name; /* protocol name */ 73 const char * name; /* protocol name */
74 u32 number; /* program number */ 74 u32 number; /* program number */
75 unsigned int nrvers; /* number of versions */ 75 unsigned int nrvers; /* number of versions */
76 struct rpc_version ** version; /* version array */ 76 const struct rpc_version ** version; /* version array */
77 struct rpc_stat * stats; /* statistics */ 77 struct rpc_stat * stats; /* statistics */
78 const char * pipe_dir_name; /* path to rpc_pipefs dir */ 78 const char * pipe_dir_name; /* path to rpc_pipefs dir */
79}; 79};
@@ -109,7 +109,7 @@ struct rpc_create_args {
109 struct sockaddr *saddress; 109 struct sockaddr *saddress;
110 const struct rpc_timeout *timeout; 110 const struct rpc_timeout *timeout;
111 const char *servername; 111 const char *servername;
112 struct rpc_program *program; 112 const struct rpc_program *program;
113 u32 prognumber; /* overrides program->number */ 113 u32 prognumber; /* overrides program->number */
114 u32 version; 114 u32 version;
115 rpc_authflavor_t authflavor; 115 rpc_authflavor_t authflavor;
@@ -128,7 +128,7 @@ struct rpc_create_args {
128 128
129struct rpc_clnt *rpc_create(struct rpc_create_args *args); 129struct rpc_clnt *rpc_create(struct rpc_create_args *args);
130struct rpc_clnt *rpc_bind_new_program(struct rpc_clnt *, 130struct rpc_clnt *rpc_bind_new_program(struct rpc_clnt *,
131 struct rpc_program *, u32); 131 const struct rpc_program *, u32);
132void rpc_task_reset_client(struct rpc_task *task, struct rpc_clnt *clnt); 132void rpc_task_reset_client(struct rpc_task *task, struct rpc_clnt *clnt);
133struct rpc_clnt *rpc_clone_client(struct rpc_clnt *); 133struct rpc_clnt *rpc_clone_client(struct rpc_clnt *);
134void rpc_shutdown_client(struct rpc_clnt *); 134void rpc_shutdown_client(struct rpc_clnt *);
diff --git a/include/linux/sunrpc/stats.h b/include/linux/sunrpc/stats.h
index 76f3f7cc6e33..edc64219f92b 100644
--- a/include/linux/sunrpc/stats.h
+++ b/include/linux/sunrpc/stats.h
@@ -12,7 +12,7 @@
12#include <linux/proc_fs.h> 12#include <linux/proc_fs.h>
13 13
14struct rpc_stat { 14struct rpc_stat {
15 struct rpc_program * program; 15 const struct rpc_program *program;
16 16
17 unsigned int netcnt, 17 unsigned int netcnt,
18 netudpcnt, 18 netudpcnt,
@@ -60,7 +60,7 @@ void rpc_modcount(struct inode *, int);
60#ifdef CONFIG_PROC_FS 60#ifdef CONFIG_PROC_FS
61struct proc_dir_entry * rpc_proc_register(struct net *,struct rpc_stat *); 61struct proc_dir_entry * rpc_proc_register(struct net *,struct rpc_stat *);
62void rpc_proc_unregister(struct net *,const char *); 62void rpc_proc_unregister(struct net *,const char *);
63void rpc_proc_zero(struct rpc_program *); 63void rpc_proc_zero(const struct rpc_program *);
64struct proc_dir_entry * svc_proc_register(struct net *, struct svc_stat *, 64struct proc_dir_entry * svc_proc_register(struct net *, struct svc_stat *,
65 const struct file_operations *); 65 const struct file_operations *);
66void svc_proc_unregister(struct net *, const char *); 66void svc_proc_unregister(struct net *, const char *);
@@ -71,7 +71,7 @@ void svc_seq_show(struct seq_file *,
71 71
72static inline struct proc_dir_entry *rpc_proc_register(struct net *net, struct rpc_stat *s) { return NULL; } 72static inline struct proc_dir_entry *rpc_proc_register(struct net *net, struct rpc_stat *s) { return NULL; }
73static inline void rpc_proc_unregister(struct net *net, const char *p) {} 73static inline void rpc_proc_unregister(struct net *net, const char *p) {}
74static inline void rpc_proc_zero(struct rpc_program *p) {} 74static inline void rpc_proc_zero(const struct rpc_program *p) {}
75 75
76static inline struct proc_dir_entry *svc_proc_register(struct net *net, struct svc_stat *s, 76static inline struct proc_dir_entry *svc_proc_register(struct net *net, struct svc_stat *s,
77 const struct file_operations *f) { return NULL; } 77 const struct file_operations *f) { return NULL; }
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c
index 1b2317fa4043..db7220d87732 100644
--- a/net/sunrpc/clnt.c
+++ b/net/sunrpc/clnt.c
@@ -238,8 +238,8 @@ void rpc_clients_notifier_unregister(void)
238 238
239static struct rpc_clnt * rpc_new_client(const struct rpc_create_args *args, struct rpc_xprt *xprt) 239static struct rpc_clnt * rpc_new_client(const struct rpc_create_args *args, struct rpc_xprt *xprt)
240{ 240{
241 struct rpc_program *program = args->program; 241 const struct rpc_program *program = args->program;
242 struct rpc_version *version; 242 const struct rpc_version *version;
243 struct rpc_clnt *clnt = NULL; 243 struct rpc_clnt *clnt = NULL;
244 struct rpc_auth *auth; 244 struct rpc_auth *auth;
245 int err; 245 int err;
@@ -626,11 +626,11 @@ rpc_release_client(struct rpc_clnt *clnt)
626 * The Sun NFSv2/v3 ACL protocol can do this. 626 * The Sun NFSv2/v3 ACL protocol can do this.
627 */ 627 */
628struct rpc_clnt *rpc_bind_new_program(struct rpc_clnt *old, 628struct rpc_clnt *rpc_bind_new_program(struct rpc_clnt *old,
629 struct rpc_program *program, 629 const struct rpc_program *program,
630 u32 vers) 630 u32 vers)
631{ 631{
632 struct rpc_clnt *clnt; 632 struct rpc_clnt *clnt;
633 struct rpc_version *version; 633 const struct rpc_version *version;
634 int err; 634 int err;
635 635
636 BUG_ON(vers >= program->nrvers || !program->version[vers]); 636 BUG_ON(vers >= program->nrvers || !program->version[vers]);
diff --git a/net/sunrpc/rpcb_clnt.c b/net/sunrpc/rpcb_clnt.c
index d3978017b25d..b1f08bd67883 100644
--- a/net/sunrpc/rpcb_clnt.c
+++ b/net/sunrpc/rpcb_clnt.c
@@ -112,7 +112,7 @@ enum {
112 112
113static void rpcb_getport_done(struct rpc_task *, void *); 113static void rpcb_getport_done(struct rpc_task *, void *);
114static void rpcb_map_release(void *data); 114static void rpcb_map_release(void *data);
115static struct rpc_program rpcb_program; 115static const struct rpc_program rpcb_program;
116 116
117struct rpcbind_args { 117struct rpcbind_args {
118 struct rpc_xprt * r_xprt; 118 struct rpc_xprt * r_xprt;
@@ -137,8 +137,8 @@ struct rpcb_info {
137 struct rpc_procinfo * rpc_proc; 137 struct rpc_procinfo * rpc_proc;
138}; 138};
139 139
140static struct rpcb_info rpcb_next_version[]; 140static const struct rpcb_info rpcb_next_version[];
141static struct rpcb_info rpcb_next_version6[]; 141static const struct rpcb_info rpcb_next_version6[];
142 142
143static const struct rpc_call_ops rpcb_getport_ops = { 143static const struct rpc_call_ops rpcb_getport_ops = {
144 .rpc_call_done = rpcb_getport_done, 144 .rpc_call_done = rpcb_getport_done,
@@ -1051,7 +1051,7 @@ static struct rpc_procinfo rpcb_procedures4[] = {
1051 }, 1051 },
1052}; 1052};
1053 1053
1054static struct rpcb_info rpcb_next_version[] = { 1054static const struct rpcb_info rpcb_next_version[] = {
1055 { 1055 {
1056 .rpc_vers = RPCBVERS_2, 1056 .rpc_vers = RPCBVERS_2,
1057 .rpc_proc = &rpcb_procedures2[RPCBPROC_GETPORT], 1057 .rpc_proc = &rpcb_procedures2[RPCBPROC_GETPORT],
@@ -1061,7 +1061,7 @@ static struct rpcb_info rpcb_next_version[] = {
1061 }, 1061 },
1062}; 1062};
1063 1063
1064static struct rpcb_info rpcb_next_version6[] = { 1064static const struct rpcb_info rpcb_next_version6[] = {
1065 { 1065 {
1066 .rpc_vers = RPCBVERS_4, 1066 .rpc_vers = RPCBVERS_4,
1067 .rpc_proc = &rpcb_procedures4[RPCBPROC_GETADDR], 1067 .rpc_proc = &rpcb_procedures4[RPCBPROC_GETADDR],
@@ -1075,25 +1075,25 @@ static struct rpcb_info rpcb_next_version6[] = {
1075 }, 1075 },
1076}; 1076};
1077 1077
1078static struct rpc_version rpcb_version2 = { 1078static const struct rpc_version rpcb_version2 = {
1079 .number = RPCBVERS_2, 1079 .number = RPCBVERS_2,
1080 .nrprocs = ARRAY_SIZE(rpcb_procedures2), 1080 .nrprocs = ARRAY_SIZE(rpcb_procedures2),
1081 .procs = rpcb_procedures2 1081 .procs = rpcb_procedures2
1082}; 1082};
1083 1083
1084static struct rpc_version rpcb_version3 = { 1084static const struct rpc_version rpcb_version3 = {
1085 .number = RPCBVERS_3, 1085 .number = RPCBVERS_3,
1086 .nrprocs = ARRAY_SIZE(rpcb_procedures3), 1086 .nrprocs = ARRAY_SIZE(rpcb_procedures3),
1087 .procs = rpcb_procedures3 1087 .procs = rpcb_procedures3
1088}; 1088};
1089 1089
1090static struct rpc_version rpcb_version4 = { 1090static const struct rpc_version rpcb_version4 = {
1091 .number = RPCBVERS_4, 1091 .number = RPCBVERS_4,
1092 .nrprocs = ARRAY_SIZE(rpcb_procedures4), 1092 .nrprocs = ARRAY_SIZE(rpcb_procedures4),
1093 .procs = rpcb_procedures4 1093 .procs = rpcb_procedures4
1094}; 1094};
1095 1095
1096static struct rpc_version *rpcb_version[] = { 1096static const struct rpc_version *rpcb_version[] = {
1097 NULL, 1097 NULL,
1098 NULL, 1098 NULL,
1099 &rpcb_version2, 1099 &rpcb_version2,
@@ -1103,7 +1103,7 @@ static struct rpc_version *rpcb_version[] = {
1103 1103
1104static struct rpc_stat rpcb_stats; 1104static struct rpc_stat rpcb_stats;
1105 1105
1106static struct rpc_program rpcb_program = { 1106static const struct rpc_program rpcb_program = {
1107 .name = "rpcbind", 1107 .name = "rpcbind",
1108 .number = RPCBIND_PROGRAM, 1108 .number = RPCBIND_PROGRAM,
1109 .nrvers = ARRAY_SIZE(rpcb_version), 1109 .nrvers = ARRAY_SIZE(rpcb_version),