diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-01-20 13:53:56 -0500 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-01-31 19:28:20 -0500 |
commit | a613fa168afc19179a7547fbba45644c5b6912bf (patch) | |
tree | 02db1b9ca905ff49d9811175607757e3a885325f | |
parent | 080b794ce5ad318ce34c52abaedf1bc6788a5abb (diff) |
SUNRPC: constify the rpc_program
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
-rw-r--r-- | fs/lockd/clnt4xdr.c | 2 | ||||
-rw-r--r-- | fs/lockd/clntxdr.c | 8 | ||||
-rw-r--r-- | fs/lockd/mon.c | 8 | ||||
-rw-r--r-- | fs/nfs/client.c | 8 | ||||
-rw-r--r-- | fs/nfs/internal.h | 2 | ||||
-rw-r--r-- | fs/nfs/mount_clnt.c | 10 | ||||
-rw-r--r-- | fs/nfs/nfs2xdr.c | 2 | ||||
-rw-r--r-- | fs/nfs/nfs3xdr.c | 4 | ||||
-rw-r--r-- | fs/nfs/nfs4xdr.c | 2 | ||||
-rw-r--r-- | fs/nfsd/nfs4callback.c | 6 | ||||
-rw-r--r-- | include/linux/lockd/lockd.h | 2 | ||||
-rw-r--r-- | include/linux/lockd/xdr4.h | 2 | ||||
-rw-r--r-- | include/linux/nfs_xdr.h | 10 | ||||
-rw-r--r-- | include/linux/sunrpc/clnt.h | 8 | ||||
-rw-r--r-- | include/linux/sunrpc/stats.h | 6 | ||||
-rw-r--r-- | net/sunrpc/clnt.c | 8 | ||||
-rw-r--r-- | net/sunrpc/rpcb_clnt.c | 20 |
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 | ||
601 | struct rpc_version nlm_version4 = { | 601 | const 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 | ||
599 | static struct rpc_version nlm_version1 = { | 599 | static 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 | ||
605 | static struct rpc_version nlm_version3 = { | 605 | static 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 | ||
611 | static struct rpc_version *nlm_versions[] = { | 611 | static 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 | ||
619 | static struct rpc_stat nlm_rpc_stats; | 619 | static struct rpc_stat nlm_rpc_stats; |
620 | 620 | ||
621 | struct rpc_program nlm_program = { | 621 | const 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 | ||
50 | static struct rpc_program nsm_program; | 50 | static const struct rpc_program nsm_program; |
51 | static LIST_HEAD(nsm_handles); | 51 | static LIST_HEAD(nsm_handles); |
52 | static DEFINE_SPINLOCK(nsm_lock); | 52 | static DEFINE_SPINLOCK(nsm_lock); |
53 | 53 | ||
@@ -534,19 +534,19 @@ static struct rpc_procinfo nsm_procedures[] = { | |||
534 | }, | 534 | }, |
535 | }; | 535 | }; |
536 | 536 | ||
537 | static struct rpc_version nsm_version1 = { | 537 | static 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 | ||
543 | static struct rpc_version * nsm_version[] = { | 543 | static const struct rpc_version *nsm_version[] = { |
544 | [1] = &nsm_version1, | 544 | [1] = &nsm_version1, |
545 | }; | 545 | }; |
546 | 546 | ||
547 | static struct rpc_stat nsm_stats; | 547 | static struct rpc_stat nsm_stats; |
548 | 548 | ||
549 | static struct rpc_program nsm_program = { | 549 | static 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 | */ |
92 | static struct rpc_version *nfs_version[5] = { | 92 | static 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 | ||
102 | struct rpc_program nfs_program = { | 102 | const 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 |
117 | static struct rpc_stat nfsacl_rpcstat = { &nfsacl_program }; | 117 | static struct rpc_stat nfsacl_rpcstat = { &nfsacl_program }; |
118 | static struct rpc_version * nfsacl_version[] = { | 118 | static const struct rpc_version *nfsacl_version[] = { |
119 | [3] = &nfsacl_version3, | 119 | [3] = &nfsacl_version3, |
120 | }; | 120 | }; |
121 | 121 | ||
122 | struct rpc_program nfsacl_program = { | 122 | const 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); | |||
145 | extern void nfs_umount(const struct nfs_mount_request *info); | 145 | extern void nfs_umount(const struct nfs_mount_request *info); |
146 | 146 | ||
147 | /* client.c */ | 147 | /* client.c */ |
148 | extern struct rpc_program nfs_program; | 148 | extern const struct rpc_program nfs_program; |
149 | 149 | ||
150 | extern void nfs_cleanup_cb_ident_idr(void); | 150 | extern void nfs_cleanup_cb_ident_idr(void); |
151 | extern void nfs_put_client(struct nfs_client *); | 151 | extern 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 | ||
70 | static struct rpc_program mnt_program; | 70 | static 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 | ||
491 | static struct rpc_version mnt_version1 = { | 491 | static 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 | ||
497 | static struct rpc_version mnt_version3 = { | 497 | static 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 | ||
503 | static struct rpc_version *mnt_version[] = { | 503 | static 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 | ||
510 | static struct rpc_stat mnt_stats; | 510 | static struct rpc_stat mnt_stats; |
511 | 511 | ||
512 | static struct rpc_program mnt_program = { | 512 | static 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 | ||
1153 | struct rpc_version nfs_version2 = { | 1153 | const 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 | ||
2464 | struct rpc_version nfs_version3 = { | 2464 | const 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 | ||
2492 | struct rpc_version nfsacl_version3 = { | 2492 | const 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 | ||
7112 | struct rpc_version nfs_version4 = { | 7112 | const 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 | ||
608 | static struct rpc_version *nfs_cb_version[] = { | 608 | static const struct rpc_version *nfs_cb_version[] = { |
609 | &nfs_cb_version4, | 609 | &nfs_cb_version4, |
610 | }; | 610 | }; |
611 | 611 | ||
612 | static struct rpc_program cb_program; | 612 | static const struct rpc_program cb_program; |
613 | 613 | ||
614 | static struct rpc_stat cb_stats = { | 614 | static 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 |
619 | static struct rpc_program cb_program = { | 619 | static 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 | */ |
191 | extern struct rpc_program nlm_program; | 191 | extern const struct rpc_program nlm_program; |
192 | extern struct svc_procedure nlmsvc_procedures[]; | 192 | extern struct svc_procedure nlmsvc_procedures[]; |
193 | #ifdef CONFIG_LOCKD_V4 | 193 | #ifdef CONFIG_LOCKD_V4 |
194 | extern struct svc_procedure nlmsvc_procedures4[]; | 194 | extern 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 *); | |||
42 | int nlmclt_encode_cancargs(struct rpc_rqst *, u32 *, struct nlm_args *); | 42 | int nlmclt_encode_cancargs(struct rpc_rqst *, u32 *, struct nlm_args *); |
43 | int nlmclt_encode_unlockargs(struct rpc_rqst *, u32 *, struct nlm_args *); | 43 | int nlmclt_encode_unlockargs(struct rpc_rqst *, u32 *, struct nlm_args *); |
44 | */ | 44 | */ |
45 | extern struct rpc_version nlm_version4; | 45 | extern 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 { | |||
1274 | extern const struct nfs_rpc_ops nfs_v2_clientops; | 1274 | extern const struct nfs_rpc_ops nfs_v2_clientops; |
1275 | extern const struct nfs_rpc_ops nfs_v3_clientops; | 1275 | extern const struct nfs_rpc_ops nfs_v3_clientops; |
1276 | extern const struct nfs_rpc_ops nfs_v4_clientops; | 1276 | extern const struct nfs_rpc_ops nfs_v4_clientops; |
1277 | extern struct rpc_version nfs_version2; | 1277 | extern const struct rpc_version nfs_version2; |
1278 | extern struct rpc_version nfs_version3; | 1278 | extern const struct rpc_version nfs_version3; |
1279 | extern struct rpc_version nfs_version4; | 1279 | extern const struct rpc_version nfs_version4; |
1280 | 1280 | ||
1281 | extern struct rpc_version nfsacl_version3; | 1281 | extern const struct rpc_version nfsacl_version3; |
1282 | extern struct rpc_program nfsacl_program; | 1282 | extern 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 | ||
129 | struct rpc_clnt *rpc_create(struct rpc_create_args *args); | 129 | struct rpc_clnt *rpc_create(struct rpc_create_args *args); |
130 | struct rpc_clnt *rpc_bind_new_program(struct rpc_clnt *, | 130 | struct rpc_clnt *rpc_bind_new_program(struct rpc_clnt *, |
131 | struct rpc_program *, u32); | 131 | const struct rpc_program *, u32); |
132 | void rpc_task_reset_client(struct rpc_task *task, struct rpc_clnt *clnt); | 132 | void rpc_task_reset_client(struct rpc_task *task, struct rpc_clnt *clnt); |
133 | struct rpc_clnt *rpc_clone_client(struct rpc_clnt *); | 133 | struct rpc_clnt *rpc_clone_client(struct rpc_clnt *); |
134 | void rpc_shutdown_client(struct rpc_clnt *); | 134 | void 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 | ||
14 | struct rpc_stat { | 14 | struct 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 |
61 | struct proc_dir_entry * rpc_proc_register(struct net *,struct rpc_stat *); | 61 | struct proc_dir_entry * rpc_proc_register(struct net *,struct rpc_stat *); |
62 | void rpc_proc_unregister(struct net *,const char *); | 62 | void rpc_proc_unregister(struct net *,const char *); |
63 | void rpc_proc_zero(struct rpc_program *); | 63 | void rpc_proc_zero(const struct rpc_program *); |
64 | struct proc_dir_entry * svc_proc_register(struct net *, struct svc_stat *, | 64 | struct proc_dir_entry * svc_proc_register(struct net *, struct svc_stat *, |
65 | const struct file_operations *); | 65 | const struct file_operations *); |
66 | void svc_proc_unregister(struct net *, const char *); | 66 | void svc_proc_unregister(struct net *, const char *); |
@@ -71,7 +71,7 @@ void svc_seq_show(struct seq_file *, | |||
71 | 71 | ||
72 | static inline struct proc_dir_entry *rpc_proc_register(struct net *net, struct rpc_stat *s) { return NULL; } | 72 | static inline struct proc_dir_entry *rpc_proc_register(struct net *net, struct rpc_stat *s) { return NULL; } |
73 | static inline void rpc_proc_unregister(struct net *net, const char *p) {} | 73 | static inline void rpc_proc_unregister(struct net *net, const char *p) {} |
74 | static inline void rpc_proc_zero(struct rpc_program *p) {} | 74 | static inline void rpc_proc_zero(const struct rpc_program *p) {} |
75 | 75 | ||
76 | static inline struct proc_dir_entry *svc_proc_register(struct net *net, struct svc_stat *s, | 76 | static 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 | ||
239 | static struct rpc_clnt * rpc_new_client(const struct rpc_create_args *args, struct rpc_xprt *xprt) | 239 | static 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 | */ |
628 | struct rpc_clnt *rpc_bind_new_program(struct rpc_clnt *old, | 628 | struct 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 | ||
113 | static void rpcb_getport_done(struct rpc_task *, void *); | 113 | static void rpcb_getport_done(struct rpc_task *, void *); |
114 | static void rpcb_map_release(void *data); | 114 | static void rpcb_map_release(void *data); |
115 | static struct rpc_program rpcb_program; | 115 | static const struct rpc_program rpcb_program; |
116 | 116 | ||
117 | struct rpcbind_args { | 117 | struct 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 | ||
140 | static struct rpcb_info rpcb_next_version[]; | 140 | static const struct rpcb_info rpcb_next_version[]; |
141 | static struct rpcb_info rpcb_next_version6[]; | 141 | static const struct rpcb_info rpcb_next_version6[]; |
142 | 142 | ||
143 | static const struct rpc_call_ops rpcb_getport_ops = { | 143 | static 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 | ||
1054 | static struct rpcb_info rpcb_next_version[] = { | 1054 | static 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 | ||
1064 | static struct rpcb_info rpcb_next_version6[] = { | 1064 | static 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 | ||
1078 | static struct rpc_version rpcb_version2 = { | 1078 | static 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 | ||
1084 | static struct rpc_version rpcb_version3 = { | 1084 | static 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 | ||
1090 | static struct rpc_version rpcb_version4 = { | 1090 | static 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 | ||
1096 | static struct rpc_version *rpcb_version[] = { | 1096 | static 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 | ||
1104 | static struct rpc_stat rpcb_stats; | 1104 | static struct rpc_stat rpcb_stats; |
1105 | 1105 | ||
1106 | static struct rpc_program rpcb_program = { | 1106 | static 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), |