nfsd: recover: constify nfsd4_client_tracking_ops structures
authorJulia Lawall <Julia.Lawall@lip6.fr>
Sun, 22 Nov 2015 07:22:10 +0000 (08:22 +0100)
committerJ. Bruce Fields <bfields@redhat.com>
Mon, 23 Nov 2015 19:15:30 +0000 (12:15 -0700)
The nfsd4_client_tracking_ops structures are never modified, so declare
them as const.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Reviewed-by: Jeff Layton <jlayton@poochiereds.net>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
fs/nfsd/netns.h
fs/nfsd/nfs4recover.c

index d8b16c2568f30f906dc49eb77597fabbd718ee4b..5fbf3bbd00d04656f1a459cc6c4027989fbb977e 100644 (file)
@@ -92,7 +92,7 @@ struct nfsd_net {
 
        struct file *rec_file;
        bool in_grace;
-       struct nfsd4_client_tracking_ops *client_tracking_ops;
+       const struct nfsd4_client_tracking_ops *client_tracking_ops;
 
        time_t nfsd4_lease;
        time_t nfsd4_grace;
index e3d47091b191db40ccbbdf64c8123fed75b8bab3..79f0307a5ec8331426ef331c5c843d59966dd5ff 100644 (file)
@@ -631,7 +631,7 @@ nfsd4_check_legacy_client(struct nfs4_client *clp)
        return -ENOENT;
 }
 
-static struct nfsd4_client_tracking_ops nfsd4_legacy_tracking_ops = {
+static const struct nfsd4_client_tracking_ops nfsd4_legacy_tracking_ops = {
        .init           = nfsd4_legacy_tracking_init,
        .exit           = nfsd4_legacy_tracking_exit,
        .create         = nfsd4_create_clid_dir,
@@ -1050,7 +1050,7 @@ out_err:
                printk(KERN_ERR "NFSD: Unable to end grace period: %d\n", ret);
 }
 
-static struct nfsd4_client_tracking_ops nfsd4_cld_tracking_ops = {
+static const struct nfsd4_client_tracking_ops nfsd4_cld_tracking_ops = {
        .init           = nfsd4_init_cld_pipe,
        .exit           = nfsd4_remove_cld_pipe,
        .create         = nfsd4_cld_create,
@@ -1394,7 +1394,7 @@ nfsd4_umh_cltrack_grace_done(struct nfsd_net *nn)
        kfree(legacy);
 }
 
-static struct nfsd4_client_tracking_ops nfsd4_umh_tracking_ops = {
+static const struct nfsd4_client_tracking_ops nfsd4_umh_tracking_ops = {
        .init           = nfsd4_umh_cltrack_init,
        .exit           = NULL,
        .create         = nfsd4_umh_cltrack_create,