lockd: constify nlmsvc_binding structure
authorJulia Lawall <Julia.Lawall@lip6.fr>
Wed, 23 Dec 2015 21:25:13 +0000 (22:25 +0100)
committerJ. Bruce Fields <bfields@redhat.com>
Thu, 7 Jan 2016 15:10:50 +0000 (10:10 -0500)
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>
fs/lockd/svc.c
fs/nfsd/lockd.c
include/linux/lockd/bind.h

index b4006c7..154a107 100644 (file)
@@ -48,7 +48,7 @@
 
 static struct svc_program      nlmsvc_program;
 
-struct nlmsvc_binding *                nlmsvc_ops;
+const struct nlmsvc_binding    *nlmsvc_ops;
 EXPORT_SYMBOL_GPL(nlmsvc_ops);
 
 static DEFINE_MUTEX(nlmsvc_mutex);
index 77e7a5c..1a03bc3 100644 (file)
@@ -58,7 +58,7 @@ nlm_fclose(struct file *filp)
        fput(filp);
 }
 
-static struct nlmsvc_binding   nfsd_nlm_ops = {
+static const struct nlmsvc_binding nfsd_nlm_ops = {
        .fopen          = nlm_fopen,            /* open file for locking */
        .fclose         = nlm_fclose,           /* close file */
 };
index 4d24d64..140edab 100644 (file)
@@ -29,7 +29,7 @@ struct nlmsvc_binding {
        void                    (*fclose)(struct file *);
 };
 
-extern struct nlmsvc_binding * nlmsvc_ops;
+extern const struct nlmsvc_binding *nlmsvc_ops;
 
 /*
  * Similar to nfs_client_initdata, but without the NFS-specific