From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Howells Subject: [PATCH 12/30] NFS: Add extra const qualifiers [try #11] Date: Thu, 27 Jul 2006 21:52:52 +0100 Message-ID: <20060727205252.8443.7412.stgit@warthog.cambridge.redhat.com> References: <20060727205222.8443.29381.stgit@warthog.cambridge.redhat.com> Reply-To: Linux filesystem caching discussion list Content-Type: text/plain; charset=utf-8; format=fixed Content-Transfer-Encoding: quoted-printable Cc: linux-fsdevel@vger.kernel.org, linux-cachefs@redhat.com, nfsv4@linux-nfs.org, linux-kernel@vger.kernel.org Return-path: To: torvalds@osdl.org, akpm@osdl.org, steved@redhat.com, trond.myklebust@fys.uio.no In-Reply-To: <20060727205222.8443.29381.stgit@warthog.cambridge.redhat.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-cachefs-bounces@redhat.com Errors-To: linux-cachefs-bounces@redhat.com List-Id: linux-fsdevel.vger.kernel.org Add some extra const qualifiers into NFS. Signed-Off-By: David Howells Signed-off-by: Trond Myklebust --- fs/nfs/namespace.c | 3 ++- fs/nfs/nfs3proc.c | 2 +- fs/nfs/nfs4namespace.c | 8 ++++---- fs/nfs/nfs4proc.c | 2 +- fs/nfs/proc.c | 2 +- fs/nfs/super.c | 10 +++++----- include/linux/nfs_fs_sb.h | 2 +- include/linux/nfs_xdr.h | 6 +++--- 8 files changed, 18 insertions(+), 17 deletions(-) diff --git a/fs/nfs/namespace.c b/fs/nfs/namespace.c index 19b98ca..460a978 100644 --- a/fs/nfs/namespace.c +++ b/fs/nfs/namespace.c @@ -170,7 +170,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, ch= ar *devname, +static struct vfsmount *nfs_do_clone_mount(struct nfs_server *server, + const char *devname, struct nfs_clone_mount *mountdata) { #ifdef CONFIG_NFS_V4 diff --git a/fs/nfs/nfs3proc.c b/fs/nfs/nfs3proc.c index 7143b1f..3e53712 100644 --- a/fs/nfs/nfs3proc.c +++ b/fs/nfs/nfs3proc.c @@ -886,7 +886,7 @@ nfs3_proc_lock(struct file *filp, int cm return nlmclnt_proc(filp->f_dentry->d_inode, cmd, fl); } =20 -struct nfs_rpc_ops nfs_v3_clientops =3D { +const struct nfs_rpc_ops nfs_v3_clientops =3D { .version =3D 3, /* protocol version */ .dentry_ops =3D &nfs_dentry_operations, .dir_inode_ops =3D &nfs3_dir_inode_operations, diff --git a/fs/nfs/nfs4namespace.c b/fs/nfs/nfs4namespace.c index ea38d27..faed9bc 100644 --- a/fs/nfs/nfs4namespace.c +++ b/fs/nfs/nfs4namespace.c @@ -23,7 +23,7 @@ #define NFSDBG_FACILITY NFSDBG_VFS /* * 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 *pat= hname, char *buffer, ssize_t buflen) { char *end =3D buffer + buflen; @@ -34,7 +34,7 @@ static inline char *nfs4_pathname_string =20 n =3D pathname->ncomponents; while (--n >=3D 0) { - struct nfs4_string *component =3D &pathname->components[n]; + const struct nfs4_string *component =3D &pathname->components[n]; buflen -=3D component->len + 1; if (buflen < 0) goto Elong; @@ -60,7 +60,7 @@ Elong: */ static struct vfsmount *nfs_follow_referral(const struct vfsmount *mnt_p= arent, const struct dentry *dentry, - struct nfs4_fs_locations *locations) + const struct nfs4_fs_locations *locations) { struct vfsmount *mnt =3D ERR_PTR(-ENOENT); struct nfs_clone_mount mountdata =3D { @@ -108,7 +108,7 @@ static struct vfsmount *nfs_follow_refer =20 loc =3D 0; while (loc < locations->nlocations && IS_ERR(mnt)) { - struct nfs4_fs_location *location =3D &locations->locations[loc]; + const struct nfs4_fs_location *location =3D &locations->locations[loc]= ; char *mnt_path; =20 if (location =3D=3D NULL || location->nservers <=3D 0 || diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 2925d37..a3adfb1 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c @@ -3736,7 +3736,7 @@ static struct inode_operations nfs4_file .listxattr =3D nfs4_listxattr, }; =20 -struct nfs_rpc_ops nfs_v4_clientops =3D { +const struct nfs_rpc_ops nfs_v4_clientops =3D { .version =3D 4, /* protocol version */ .dentry_ops =3D &nfs4_dentry_operations, .dir_inode_ops =3D &nfs4_dir_inode_operations, diff --git a/fs/nfs/proc.c b/fs/nfs/proc.c index b3899ea..7767690 100644 --- a/fs/nfs/proc.c +++ b/fs/nfs/proc.c @@ -671,7 +671,7 @@ nfs_proc_lock(struct file *filp, int cmd } =20 =20 -struct nfs_rpc_ops nfs_v2_clientops =3D { +const struct nfs_rpc_ops nfs_v2_clientops =3D { .version =3D 2, /* protocol version */ .dentry_ops =3D &nfs_dentry_operations, .dir_inode_ops =3D &nfs_dir_inode_operations, diff --git a/fs/nfs/super.c b/fs/nfs/super.c index 4e128fe..65e1bec 100644 --- a/fs/nfs/super.c +++ b/fs/nfs/super.c @@ -324,10 +324,10 @@ static const char *nfs_pseudoflavour_to_ */ 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[] =3D { { NFS_MOUNT_SOFT, ",soft", ",hard" }, { NFS_MOUNT_INTR, ",intr", "" }, @@ -337,9 +337,9 @@ static void nfs_show_mount_options(struc { 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; =20 seq_printf(m, ",vers=3D%d", nfss->rpc_ops->version); seq_printf(m, ",rsize=3D%d", nfss->rsize); diff --git a/include/linux/nfs_fs_sb.h b/include/linux/nfs_fs_sb.h index a727657..95f32d5 100644 --- a/include/linux/nfs_fs_sb.h +++ b/include/linux/nfs_fs_sb.h @@ -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 */ diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h index 24ceac1..7f5b96e 100644 --- a/include/linux/nfs_xdr.h +++ b/include/linux/nfs_xdr.h @@ -833,9 +833,9 @@ #define NFS_CALL(op, inode, args) NFS_PR /* * 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;