Skip to content

Commit a613fa1

Browse files
Trond MyklebustTrond Myklebust
authored andcommitted
SUNRPC: constify the rpc_program
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
1 parent 080b794 commit a613fa1

17 files changed

Lines changed: 54 additions & 54 deletions

File tree

‎fs/lockd/clnt4xdr.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,7 @@ static struct rpc_procinfo nlm4_procedures[] = {
598598
PROC(GRANTED_RES, res, norep),
599599
};
600600

601-
struct rpc_version nlm_version4 = {
601+
const struct rpc_version nlm_version4 = {
602602
.number = 4,
603603
.nrprocs = ARRAY_SIZE(nlm4_procedures),
604604
.procs = nlm4_procedures,

‎fs/lockd/clntxdr.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -596,19 +596,19 @@ static struct rpc_procinfo nlm_procedures[] = {
596596
PROC(GRANTED_RES, res, norep),
597597
};
598598

599-
static struct rpc_version nlm_version1 = {
599+
static const struct rpc_version nlm_version1 = {
600600
.number = 1,
601601
.nrprocs = ARRAY_SIZE(nlm_procedures),
602602
.procs = nlm_procedures,
603603
};
604604

605-
static struct rpc_version nlm_version3 = {
605+
static const struct rpc_version nlm_version3 = {
606606
.number = 3,
607607
.nrprocs = ARRAY_SIZE(nlm_procedures),
608608
.procs = nlm_procedures,
609609
};
610610

611-
static struct rpc_version *nlm_versions[] = {
611+
static const struct rpc_version *nlm_versions[] = {
612612
[1] = &nlm_version1,
613613
[3] = &nlm_version3,
614614
#ifdef CONFIG_LOCKD_V4
@@ -618,7 +618,7 @@ static struct rpc_version *nlm_versions[] = {
618618

619619
static struct rpc_stat nlm_rpc_stats;
620620

621-
struct rpc_program nlm_program = {
621+
const struct rpc_program nlm_program = {
622622
.name = "lockd",
623623
.number = NLM_PROGRAM,
624624
.nrvers = ARRAY_SIZE(nlm_versions),

‎fs/lockd/mon.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ struct nsm_res {
4747
u32 state;
4848
};
4949

50-
static struct rpc_program nsm_program;
50+
static const struct rpc_program nsm_program;
5151
static LIST_HEAD(nsm_handles);
5252
static DEFINE_SPINLOCK(nsm_lock);
5353

@@ -534,19 +534,19 @@ static struct rpc_procinfo nsm_procedures[] = {
534534
},
535535
};
536536

537-
static struct rpc_version nsm_version1 = {
537+
static const struct rpc_version nsm_version1 = {
538538
.number = 1,
539539
.nrprocs = ARRAY_SIZE(nsm_procedures),
540540
.procs = nsm_procedures
541541
};
542542

543-
static struct rpc_version * nsm_version[] = {
543+
static const struct rpc_version *nsm_version[] = {
544544
[1] = &nsm_version1,
545545
};
546546

547547
static struct rpc_stat nsm_stats;
548548

549-
static struct rpc_program nsm_program = {
549+
static const struct rpc_program nsm_program = {
550550
.name = "statd",
551551
.number = NSM_PROGRAM,
552552
.nrvers = ARRAY_SIZE(nsm_version),

‎fs/nfs/client.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ static bool nfs4_disable_idmapping = true;
8989
/*
9090
* RPC cruft for NFS
9191
*/
92-
static struct rpc_version *nfs_version[5] = {
92+
static const struct rpc_version *nfs_version[5] = {
9393
[2] = &nfs_version2,
9494
#ifdef CONFIG_NFS_V3
9595
[3] = &nfs_version3,
@@ -99,7 +99,7 @@ static struct rpc_version *nfs_version[5] = {
9999
#endif
100100
};
101101

102-
struct rpc_program nfs_program = {
102+
const struct rpc_program nfs_program = {
103103
.name = "nfs",
104104
.number = NFS_PROGRAM,
105105
.nrvers = ARRAY_SIZE(nfs_version),
@@ -115,11 +115,11 @@ struct rpc_stat nfs_rpcstat = {
115115

116116
#ifdef CONFIG_NFS_V3_ACL
117117
static struct rpc_stat nfsacl_rpcstat = { &nfsacl_program };
118-
static struct rpc_version * nfsacl_version[] = {
118+
static const struct rpc_version *nfsacl_version[] = {
119119
[3] = &nfsacl_version3,
120120
};
121121

122-
struct rpc_program nfsacl_program = {
122+
const struct rpc_program nfsacl_program = {
123123
.name = "nfsacl",
124124
.number = NFS_ACL_PROGRAM,
125125
.nrvers = ARRAY_SIZE(nfsacl_version),

‎fs/nfs/internal.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ extern int nfs_mount(struct nfs_mount_request *info);
145145
extern void nfs_umount(const struct nfs_mount_request *info);
146146

147147
/* client.c */
148-
extern struct rpc_program nfs_program;
148+
extern const struct rpc_program nfs_program;
149149

150150
extern void nfs_cleanup_cb_ident_idr(void);
151151
extern void nfs_put_client(struct nfs_client *);

‎fs/nfs/mount_clnt.c‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ enum {
6767
MOUNTPROC3_EXPORT = 5,
6868
};
6969

70-
static struct rpc_program mnt_program;
70+
static const struct rpc_program mnt_program;
7171

7272
/*
7373
* Defined by OpenGroup XNFS Version 3W, chapter 8
@@ -488,19 +488,19 @@ static struct rpc_procinfo mnt3_procedures[] = {
488488
};
489489

490490

491-
static struct rpc_version mnt_version1 = {
491+
static const struct rpc_version mnt_version1 = {
492492
.number = 1,
493493
.nrprocs = ARRAY_SIZE(mnt_procedures),
494494
.procs = mnt_procedures,
495495
};
496496

497-
static struct rpc_version mnt_version3 = {
497+
static const struct rpc_version mnt_version3 = {
498498
.number = 3,
499499
.nrprocs = ARRAY_SIZE(mnt3_procedures),
500500
.procs = mnt3_procedures,
501501
};
502502

503-
static struct rpc_version *mnt_version[] = {
503+
static const struct rpc_version *mnt_version[] = {
504504
NULL,
505505
&mnt_version1,
506506
NULL,
@@ -509,7 +509,7 @@ static struct rpc_version *mnt_version[] = {
509509

510510
static struct rpc_stat mnt_stats;
511511

512-
static struct rpc_program mnt_program = {
512+
static const struct rpc_program mnt_program = {
513513
.name = "mount",
514514
.number = NFS_MNT_PROGRAM,
515515
.nrvers = ARRAY_SIZE(mnt_version),

‎fs/nfs/nfs2xdr.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1150,7 +1150,7 @@ struct rpc_procinfo nfs_procedures[] = {
11501150
PROC(STATFS, fhandle, statfsres, 0),
11511151
};
11521152

1153-
struct rpc_version nfs_version2 = {
1153+
const struct rpc_version nfs_version2 = {
11541154
.number = 2,
11551155
.nrprocs = ARRAY_SIZE(nfs_procedures),
11561156
.procs = nfs_procedures

‎fs/nfs/nfs3xdr.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2461,7 +2461,7 @@ struct rpc_procinfo nfs3_procedures[] = {
24612461
PROC(COMMIT, commit, commit, 5),
24622462
};
24632463

2464-
struct rpc_version nfs_version3 = {
2464+
const struct rpc_version nfs_version3 = {
24652465
.number = 3,
24662466
.nrprocs = ARRAY_SIZE(nfs3_procedures),
24672467
.procs = nfs3_procedures
@@ -2489,7 +2489,7 @@ static struct rpc_procinfo nfs3_acl_procedures[] = {
24892489
},
24902490
};
24912491

2492-
struct rpc_version nfsacl_version3 = {
2492+
const struct rpc_version nfsacl_version3 = {
24932493
.number = 3,
24942494
.nrprocs = sizeof(nfs3_acl_procedures)/
24952495
sizeof(nfs3_acl_procedures[0]),

‎fs/nfs/nfs4xdr.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7109,7 +7109,7 @@ struct rpc_procinfo nfs4_procedures[] = {
71097109
#endif /* CONFIG_NFS_V4_1 */
71107110
};
71117111

7112-
struct rpc_version nfs_version4 = {
7112+
const struct rpc_version nfs_version4 = {
71137113
.number = 4,
71147114
.nrprocs = ARRAY_SIZE(nfs4_procedures),
71157115
.procs = nfs4_procedures

‎fs/nfsd/nfs4callback.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -605,18 +605,18 @@ static struct rpc_version nfs_cb_version4 = {
605605
.procs = nfs4_cb_procedures
606606
};
607607

608-
static struct rpc_version *nfs_cb_version[] = {
608+
static const struct rpc_version *nfs_cb_version[] = {
609609
&nfs_cb_version4,
610610
};
611611

612-
static struct rpc_program cb_program;
612+
static const struct rpc_program cb_program;
613613

614614
static struct rpc_stat cb_stats = {
615615
.program = &cb_program
616616
};
617617

618618
#define NFS4_CALLBACK 0x40000000
619-
static struct rpc_program cb_program = {
619+
static const struct rpc_program cb_program = {
620620
.name = "nfs4_cb",
621621
.number = NFS4_CALLBACK,
622622
.nrvers = ARRAY_SIZE(nfs_cb_version),

0 commit comments

Comments
 (0)