Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Julia Lawall and committed by
J. Bruce Fields
2a297450 ea44463f

+3 -3
+1 -1
fs/lockd/svc.c
··· 48 48 49 49 static struct svc_program nlmsvc_program; 50 50 51 - struct nlmsvc_binding * nlmsvc_ops; 51 + const struct nlmsvc_binding *nlmsvc_ops; 52 52 EXPORT_SYMBOL_GPL(nlmsvc_ops); 53 53 54 54 static DEFINE_MUTEX(nlmsvc_mutex);
+1 -1
fs/nfsd/lockd.c
··· 58 58 fput(filp); 59 59 } 60 60 61 - static struct nlmsvc_binding nfsd_nlm_ops = { 61 + static const struct nlmsvc_binding nfsd_nlm_ops = { 62 62 .fopen = nlm_fopen, /* open file for locking */ 63 63 .fclose = nlm_fclose, /* close file */ 64 64 };
+1 -1
include/linux/lockd/bind.h
··· 29 29 void (*fclose)(struct file *); 30 30 }; 31 31 32 - extern struct nlmsvc_binding * nlmsvc_ops; 32 + extern const struct nlmsvc_binding *nlmsvc_ops; 33 33 34 34 /* 35 35 * Similar to nfs_client_initdata, but without the NFS-specific