aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs
diff options
context:
space:
mode:
authorArjan van de Ven <arjan@linux.intel.com>2007-02-12 03:55:39 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-12 12:48:46 -0500
commit92e1d5be91a0e3ffa5c4697eeb09b2aa22792122 (patch)
tree4eb22a9f6c38e9f4cc2a5100cd6659b0af08b7ae /fs/nfs
parent754661f143e70d66eae6c48532ca245aa05dec0e (diff)
[PATCH] mark struct inode_operations const 2
Many struct inode_operations in the kernel can be "const". Marking them const moves these to the .rodata section, which avoids false sharing with potential dirty data. In addition it'll catch accidental writes at compile time to these shared resources. Signed-off-by: Arjan van de Ven <arjan@linux.intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/nfs')
-rw-r--r--fs/nfs/dir.c6
-rw-r--r--fs/nfs/file.c4
-rw-r--r--fs/nfs/namespace.c4
-rw-r--r--fs/nfs/nfs4_fs.h2
-rw-r--r--fs/nfs/nfs4proc.c2
-rw-r--r--fs/nfs/symlink.c2
6 files changed, 10 insertions, 10 deletions
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
index d9ba8cb0ee75..f03a770bacb0 100644
--- a/fs/nfs/dir.c
+++ b/fs/nfs/dir.c
@@ -65,7 +65,7 @@ const struct file_operations nfs_dir_operations = {
65 .fsync = nfs_fsync_dir, 65 .fsync = nfs_fsync_dir,
66}; 66};
67 67
68struct inode_operations nfs_dir_inode_operations = { 68const struct inode_operations nfs_dir_inode_operations = {
69 .create = nfs_create, 69 .create = nfs_create,
70 .lookup = nfs_lookup, 70 .lookup = nfs_lookup,
71 .link = nfs_link, 71 .link = nfs_link,
@@ -81,7 +81,7 @@ struct inode_operations nfs_dir_inode_operations = {
81}; 81};
82 82
83#ifdef CONFIG_NFS_V3 83#ifdef CONFIG_NFS_V3
84struct inode_operations nfs3_dir_inode_operations = { 84const struct inode_operations nfs3_dir_inode_operations = {
85 .create = nfs_create, 85 .create = nfs_create,
86 .lookup = nfs_lookup, 86 .lookup = nfs_lookup,
87 .link = nfs_link, 87 .link = nfs_link,
@@ -104,7 +104,7 @@ struct inode_operations nfs3_dir_inode_operations = {
104#ifdef CONFIG_NFS_V4 104#ifdef CONFIG_NFS_V4
105 105
106static struct dentry *nfs_atomic_lookup(struct inode *, struct dentry *, struct nameidata *); 106static struct dentry *nfs_atomic_lookup(struct inode *, struct dentry *, struct nameidata *);
107struct inode_operations nfs4_dir_inode_operations = { 107const struct inode_operations nfs4_dir_inode_operations = {
108 .create = nfs_create, 108 .create = nfs_create,
109 .lookup = nfs_atomic_lookup, 109 .lookup = nfs_atomic_lookup,
110 .link = nfs_link, 110 .link = nfs_link,
diff --git a/fs/nfs/file.c b/fs/nfs/file.c
index 9e4a2b70995a..8e66b5a2d490 100644
--- a/fs/nfs/file.c
+++ b/fs/nfs/file.c
@@ -68,14 +68,14 @@ const struct file_operations nfs_file_operations = {
68 .check_flags = nfs_check_flags, 68 .check_flags = nfs_check_flags,
69}; 69};
70 70
71struct inode_operations nfs_file_inode_operations = { 71const struct inode_operations nfs_file_inode_operations = {
72 .permission = nfs_permission, 72 .permission = nfs_permission,
73 .getattr = nfs_getattr, 73 .getattr = nfs_getattr,
74 .setattr = nfs_setattr, 74 .setattr = nfs_setattr,
75}; 75};
76 76
77#ifdef CONFIG_NFS_V3 77#ifdef CONFIG_NFS_V3
78struct inode_operations nfs3_file_inode_operations = { 78const struct inode_operations nfs3_file_inode_operations = {
79 .permission = nfs_permission, 79 .permission = nfs_permission,
80 .getattr = nfs_getattr, 80 .getattr = nfs_getattr,
81 .setattr = nfs_setattr, 81 .setattr = nfs_setattr,
diff --git a/fs/nfs/namespace.c b/fs/nfs/namespace.c
index 371b804e7cc8..7f86e65182e4 100644
--- a/fs/nfs/namespace.c
+++ b/fs/nfs/namespace.c
@@ -155,12 +155,12 @@ out_follow:
155 goto out; 155 goto out;
156} 156}
157 157
158struct inode_operations nfs_mountpoint_inode_operations = { 158const struct inode_operations nfs_mountpoint_inode_operations = {
159 .follow_link = nfs_follow_mountpoint, 159 .follow_link = nfs_follow_mountpoint,
160 .getattr = nfs_getattr, 160 .getattr = nfs_getattr,
161}; 161};
162 162
163struct inode_operations nfs_referral_inode_operations = { 163const struct inode_operations nfs_referral_inode_operations = {
164 .follow_link = nfs_follow_mountpoint, 164 .follow_link = nfs_follow_mountpoint,
165}; 165};
166 166
diff --git a/fs/nfs/nfs4_fs.h b/fs/nfs/nfs4_fs.h
index c26cd978c7cc..e2341766c4f0 100644
--- a/fs/nfs/nfs4_fs.h
+++ b/fs/nfs/nfs4_fs.h
@@ -151,7 +151,7 @@ struct nfs4_state_recovery_ops {
151}; 151};
152 152
153extern struct dentry_operations nfs4_dentry_operations; 153extern struct dentry_operations nfs4_dentry_operations;
154extern struct inode_operations nfs4_dir_inode_operations; 154extern const struct inode_operations nfs4_dir_inode_operations;
155 155
156/* inode.c */ 156/* inode.c */
157extern ssize_t nfs4_getxattr(struct dentry *, const char *, void *, size_t); 157extern ssize_t nfs4_getxattr(struct dentry *, const char *, void *, size_t);
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index b3fd29baadc3..1daee65b517e 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -3625,7 +3625,7 @@ struct nfs4_state_recovery_ops nfs4_network_partition_recovery_ops = {
3625 .recover_lock = nfs4_lock_expired, 3625 .recover_lock = nfs4_lock_expired,
3626}; 3626};
3627 3627
3628static struct inode_operations nfs4_file_inode_operations = { 3628static const struct inode_operations nfs4_file_inode_operations = {
3629 .permission = nfs_permission, 3629 .permission = nfs_permission,
3630 .getattr = nfs_getattr, 3630 .getattr = nfs_getattr,
3631 .setattr = nfs_setattr, 3631 .setattr = nfs_setattr,
diff --git a/fs/nfs/symlink.c b/fs/nfs/symlink.c
index 525c136c7d8c..f4a0548b9ce8 100644
--- a/fs/nfs/symlink.c
+++ b/fs/nfs/symlink.c
@@ -78,7 +78,7 @@ read_failed:
78/* 78/*
79 * symlinks can't do much... 79 * symlinks can't do much...
80 */ 80 */
81struct inode_operations nfs_symlink_inode_operations = { 81const struct inode_operations nfs_symlink_inode_operations = {
82 .readlink = generic_readlink, 82 .readlink = generic_readlink,
83 .follow_link = nfs_follow_link, 83 .follow_link = nfs_follow_link,
84 .put_link = page_put_link, 84 .put_link = page_put_link,