Skip to content

Commit 2a29745

Browse files
JuliaLawallJ. Bruce Fields
authored andcommitted
lockd: constify nlmsvc_binding structure
The nlmsvc_binding structure is never modified, so declare it as const. Done with the help of Coccinelle. Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
1 parent ea44463 commit 2a29745

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

‎fs/lockd/svc.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848

4949
static struct svc_program nlmsvc_program;
5050

51-
struct nlmsvc_binding * nlmsvc_ops;
51+
const struct nlmsvc_binding *nlmsvc_ops;
5252
EXPORT_SYMBOL_GPL(nlmsvc_ops);
5353

5454
static DEFINE_MUTEX(nlmsvc_mutex);

‎fs/nfsd/lockd.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ nlm_fclose(struct file *filp)
5858
fput(filp);
5959
}
6060

61-
static struct nlmsvc_binding nfsd_nlm_ops = {
61+
static const struct nlmsvc_binding nfsd_nlm_ops = {
6262
.fopen = nlm_fopen, /* open file for locking */
6363
.fclose = nlm_fclose, /* close file */
6464
};

‎include/linux/lockd/bind.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ struct nlmsvc_binding {
2929
void (*fclose)(struct file *);
3030
};
3131

32-
extern struct nlmsvc_binding * nlmsvc_ops;
32+
extern const struct nlmsvc_binding *nlmsvc_ops;
3333

3434
/*
3535
* Similar to nfs_client_initdata, but without the NFS-specific

0 commit comments

Comments
 (0)