]> err.no Git - linux-2.6/commitdiff
NFS: Add extra const qualifiers
authorDavid Howells <dhowells@redhat.com>
Wed, 23 Aug 2006 00:06:11 +0000 (20:06 -0400)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Sat, 23 Sep 2006 03:24:34 +0000 (23:24 -0400)
Add some extra const qualifiers into NFS.

Signed-Off-By: David Howells <dhowells@redhat.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
fs/nfs/namespace.c
fs/nfs/nfs3proc.c
fs/nfs/nfs4namespace.c
fs/nfs/nfs4proc.c
fs/nfs/proc.c
fs/nfs/super.c
include/linux/nfs_fs_sb.h
include/linux/nfs_xdr.h

index 86b3169c8cac0b01eded9d13c59edf01912b6f68..85d9ed1dcf42af289eebad328609ea2b7a329b64 100644 (file)
@@ -172,7 +172,8 @@ void nfs_release_automount_timer(void)
 /*
  * Clone a mountpoint of the appropriate type
  */
-static struct vfsmount *nfs_do_clone_mount(struct nfs_server *server, char *devname,
+static struct vfsmount *nfs_do_clone_mount(struct nfs_server *server,
+                                          const char *devname,
                                           struct nfs_clone_mount *mountdata)
 {
 #ifdef CONFIG_NFS_V4
index 7143b1f82cea40980d9f5d0d63ed1a18db877a6d..3e5371241cea4263029f14a44f4498cdfb2339d1 100644 (file)
@@ -886,7 +886,7 @@ nfs3_proc_lock(struct file *filp, int cmd, struct file_lock *fl)
        return nlmclnt_proc(filp->f_dentry->d_inode, cmd, fl);
 }
 
-struct nfs_rpc_ops     nfs_v3_clientops = {
+const struct nfs_rpc_ops nfs_v3_clientops = {
        .version        = 3,                    /* protocol version */
        .dentry_ops     = &nfs_dentry_operations,
        .dir_inode_ops  = &nfs3_dir_inode_operations,
index ea38d27b74e6f6e39b43d6be378c577dee411b4a..faed9bcba50fb0121d6c266a4cd94e63d01b7169 100644 (file)
@@ -23,7 +23,7 @@
 /*
  * Check if fs_root is valid
  */
-static inline char *nfs4_pathname_string(struct nfs4_pathname *pathname,
+static inline char *nfs4_pathname_string(const struct nfs4_pathname *pathname,
                                         char *buffer, ssize_t buflen)
 {
        char *end = buffer + buflen;
@@ -34,7 +34,7 @@ static inline char *nfs4_pathname_string(struct nfs4_pathname *pathname,
 
        n = pathname->ncomponents;
        while (--n >= 0) {
-               struct nfs4_string *component = &pathname->components[n];
+               const struct nfs4_string *component = &pathname->components[n];
                buflen -= component->len + 1;
                if (buflen < 0)
                        goto Elong;
@@ -60,7 +60,7 @@ Elong:
  */
 static struct vfsmount *nfs_follow_referral(const struct vfsmount *mnt_parent,
                                            const struct dentry *dentry,
-                                           struct nfs4_fs_locations *locations)
+                                           const struct nfs4_fs_locations *locations)
 {
        struct vfsmount *mnt = ERR_PTR(-ENOENT);
        struct nfs_clone_mount mountdata = {
@@ -108,7 +108,7 @@ static struct vfsmount *nfs_follow_referral(const struct vfsmount *mnt_parent,
 
        loc = 0;
        while (loc < locations->nlocations && IS_ERR(mnt)) {
-               struct nfs4_fs_location *location = &locations->locations[loc];
+               const struct nfs4_fs_location *location = &locations->locations[loc];
                char *mnt_path;
 
                if (location == NULL || location->nservers <= 0 ||
index 803c31b88bb5207023f2381bdf529ae7275fec4a..061be713b206da1b1dcd50cea75e6a973a990948 100644 (file)
@@ -3761,7 +3761,7 @@ static struct inode_operations nfs4_file_inode_operations = {
        .listxattr      = nfs4_listxattr,
 };
 
-struct nfs_rpc_ops     nfs_v4_clientops = {
+const struct nfs_rpc_ops nfs_v4_clientops = {
        .version        = 4,                    /* protocol version */
        .dentry_ops     = &nfs4_dentry_operations,
        .dir_inode_ops  = &nfs4_dir_inode_operations,
index b3899ea3229e31819ede03a1ab22936e90741acb..77676903e0f5205ae00540e1499e50ed1b52582f 100644 (file)
@@ -671,7 +671,7 @@ nfs_proc_lock(struct file *filp, int cmd, struct file_lock *fl)
 }
 
 
-struct nfs_rpc_ops     nfs_v2_clientops = {
+const struct nfs_rpc_ops nfs_v2_clientops = {
        .version        = 2,                   /* protocol version */
        .dentry_ops     = &nfs_dentry_operations,
        .dir_inode_ops  = &nfs_dir_inode_operations,
index a41d516ed595b954fed1979f371912ba85fa32d5..c97f30967955b4d9c7d3784357cff8984ee507ab 100644 (file)
@@ -329,10 +329,10 @@ static const char *nfs_pseudoflavour_to_name(rpc_authflavor_t flavour)
  */
 static void nfs_show_mount_options(struct seq_file *m, struct nfs_server *nfss, int showdefaults)
 {
-       static struct proc_nfs_info {
+       static const struct proc_nfs_info {
                int flag;
-               char *str;
-               char *nostr;
+               const char *str;
+               const char *nostr;
        } nfs_info[] = {
                { NFS_MOUNT_SOFT, ",soft", ",hard" },
                { NFS_MOUNT_INTR, ",intr", "" },
@@ -342,9 +342,9 @@ static void nfs_show_mount_options(struct seq_file *m, struct nfs_server *nfss,
                { NFS_MOUNT_NOACL, ",noacl", "" },
                { 0, NULL, NULL }
        };
-       struct proc_nfs_info *nfs_infop;
+       const struct proc_nfs_info *nfs_infop;
        char buf[12];
-       char *proto;
+       const char *proto;
 
        seq_printf(m, ",vers=%d", nfss->rpc_ops->version);
        seq_printf(m, ",rsize=%d", nfss->rsize);
index a727657e0ad315b1357a4e327f17db0dfedb1a90..95f32d5f6e9cdc6ebf1249afafcffa5e6faed151 100644 (file)
@@ -73,7 +73,7 @@ struct nfs_server {
        struct rpc_clnt *       client;         /* RPC client handle */
        struct rpc_clnt *       client_sys;     /* 2nd handle for FSINFO */
        struct rpc_clnt *       client_acl;     /* ACL RPC client handle */
-       struct nfs_rpc_ops *    rpc_ops;        /* NFS protocol vector */
+       const struct nfs_rpc_ops *rpc_ops;      /* NFS protocol vector */
        struct nfs_iostats *    io_stats;       /* I/O statistics */
        struct backing_dev_info backing_dev_info;
        int                     flags;          /* various flags */
index dd9ae6761f7170a328f3419b4fc3df711a38ef4b..2426b11b6cce5093e6eca363db4a213a36ea3311 100644 (file)
@@ -833,9 +833,9 @@ struct nfs_rpc_ops {
 /*
  * Function vectors etc. for the NFS client
  */
-extern struct nfs_rpc_ops      nfs_v2_clientops;
-extern struct nfs_rpc_ops      nfs_v3_clientops;
-extern struct nfs_rpc_ops      nfs_v4_clientops;
+extern const struct nfs_rpc_ops        nfs_v2_clientops;
+extern const struct nfs_rpc_ops        nfs_v3_clientops;
+extern const struct nfs_rpc_ops        nfs_v4_clientops;
 extern struct rpc_version      nfs_version2;
 extern struct rpc_version      nfs_version3;
 extern struct rpc_version      nfs_version4;