From: David Howells <dhowells@redhat.com>
To: torvalds@osdl.org, akpm@osdl.org, steved@redhat.com,
trond.myklebust@fys.uio.no
Cc: linux-fsdevel@vger.kernel.org, linux-cachefs@redhat.com,
nfsv4@linux-nfs.org, linux-kernel@vger.kernel.org
Subject: [PATCH 12/30] NFS: Add extra const qualifiers [try #11]
Date: Thu, 27 Jul 2006 21:52:52 +0100 [thread overview]
Message-ID: <20060727205252.8443.7412.stgit@warthog.cambridge.redhat.com> (raw)
In-Reply-To: <20060727205222.8443.29381.stgit@warthog.cambridge.redhat.com>
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 | 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, 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
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);
}
-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,
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 *pathname,
char *buffer, ssize_t buflen)
{
char *end = buffer + buflen;
@@ -34,7 +34,7 @@ static inline char *nfs4_pathname_string
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_refer
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 ||
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 = 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,
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
}
-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,
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[] = {
{ 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;
seq_printf(m, ",vers=%d", nfss->rpc_ops->version);
seq_printf(m, ",rsize=%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;
next prev parent reply other threads:[~2006-07-27 21:04 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-07-27 20:52 [PATCH 00/30] Permit filesystem local caching and NFS superblock sharing " David Howells
2006-07-27 20:52 ` [PATCH 01/30] NFS: Add dentry materialisation op " David Howells
2006-07-27 20:52 ` [PATCH 02/30] NFS: Fix up split of fs/nfs/inode.c " David Howells
2006-07-27 20:52 ` [PATCH 03/30] NFS: Disambiguate nfs_stat_to_errno() " David Howells
2006-07-27 20:52 ` [PATCH 04/30] NFS: Fix NFS4 callback up/down prototypes " David Howells
2006-07-27 20:52 ` [PATCH 05/30] NFS: Rename struct nfs4_client to struct nfs_client " David Howells
2006-07-27 20:52 ` [PATCH 06/30] NFS: Rename nfs_server::nfs4_state " David Howells
2006-07-27 20:52 ` [PATCH 07/30] NFS: Return an error when starting the idmapping pipe " David Howells
2006-07-27 20:52 ` [PATCH 08/30] NFS: Add a lookupfh NFS RPC op " David Howells
2006-07-27 20:52 ` [PATCH 09/30] NFS: Add a server capabilities " David Howells
2006-07-27 20:52 ` [PATCH 10/30] NFS: Generalise the nfs_client structure " David Howells
2006-07-27 20:52 ` [PATCH 11/30] NFS: Use the dentry superblock directly in nfs_statfs() " David Howells
2006-07-27 20:52 ` David Howells [this message]
2006-07-27 20:52 ` [PATCH 13/30] NFS: Maintain a common server record for NFS2/3 as well as for NFS4 " David Howells
2006-07-27 20:52 ` [PATCH 14/30] NFS: Make better use of inode* dereferencing macros " David Howells
2006-07-27 20:53 ` [PATCH 15/30] NFS: Move rpc_ops from nfs_server to nfs_client " David Howells
2006-07-27 20:53 ` [PATCH 16/30] NFS: Eliminate client_sys in favour of cl_rpcclient " David Howells
2006-07-27 20:53 ` [PATCH 17/30] NFS: Start rpciod in server common management " David Howells
2006-07-27 20:53 ` [PATCH 19/30] NFS: Add server and volume lists to /proc " David Howells
2006-07-27 20:53 ` [PATCH 20/30] NFS: Fix error handling " David Howells
2006-07-27 20:53 ` [PATCH 21/30] NFS: Secure the roots of the NFS subtrees in a shared superblock " David Howells
2006-07-27 20:53 ` [PATCH 22/30] FS-Cache: Provide a filesystem-specific sync'able page bit " David Howells
2006-07-27 20:53 ` [PATCH 24/30] FS-Cache: Release page->private in failed readahead " David Howells
2006-07-27 20:53 ` [PATCH 25/30] FS-Cache: Make kAFS use FS-Cache " David Howells
2006-07-27 20:53 ` [PATCH 26/30] NFS: Use local caching " David Howells
2006-07-27 20:53 ` [PATCH 27/30] FS-Cache: CacheFiles: ia64: missing copy_page export " David Howells
2006-07-27 20:53 ` [PATCH 29/30] AUTOFS: Make sure all dentries refs are released before calling kill_anon_super() " David Howells
2006-07-27 20:53 ` [PATCH 30/30] VFS: Destroy the dentries contributed by a superblock on unmounting " David Howells
2006-08-01 9:03 ` Jan Blunck
2006-08-01 10:18 ` David Howells
2006-07-28 8:55 ` [PATCH 00/30] Permit filesystem local caching and NFS superblock sharing " Jeff Garzik
2006-07-29 6:05 ` Andrew Morton
2006-07-29 11:12 ` David Howells
2006-07-29 16:30 ` Trond Myklebust
2006-09-07 17:17 ` FS-Cache patches David Howells
2006-09-18 19:10 ` Christoph Hellwig
2006-09-19 9:34 ` David Howells
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20060727205252.8443.7412.stgit@warthog.cambridge.redhat.com \
--to=dhowells@redhat.com \
--cc=akpm@osdl.org \
--cc=linux-cachefs@redhat.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nfsv4@linux-nfs.org \
--cc=steved@redhat.com \
--cc=torvalds@osdl.org \
--cc=trond.myklebust@fys.uio.no \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome