aboutsummaryrefslogtreecommitdiffstats
path: root/fs/proc/base.c
diff options
context:
space:
mode:
authorArjan van de Ven <arjan@linux.intel.com>2007-02-12 03:55:40 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-12 12:48:46 -0500
commitc5ef1c42c51b1b5b4a401a6517bdda30933ddbaf (patch)
treee1a9804a8af427f700aaba4b386cf8679b317e83 /fs/proc/base.c
parent92e1d5be91a0e3ffa5c4697eeb09b2aa22792122 (diff)
[PATCH] mark struct inode_operations const 3
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/proc/base.c')
-rw-r--r--fs/proc/base.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/fs/proc/base.c b/fs/proc/base.c
index 7b1ded63fa63..4f5745af8c19 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -93,7 +93,7 @@ struct pid_entry {
93 int len; 93 int len;
94 char *name; 94 char *name;
95 mode_t mode; 95 mode_t mode;
96 struct inode_operations *iop; 96 const struct inode_operations *iop;
97 const struct file_operations *fop; 97 const struct file_operations *fop;
98 union proc_op op; 98 union proc_op op;
99}; 99};
@@ -352,7 +352,7 @@ static int proc_setattr(struct dentry *dentry, struct iattr *attr)
352 return error; 352 return error;
353} 353}
354 354
355static struct inode_operations proc_def_inode_operations = { 355static const struct inode_operations proc_def_inode_operations = {
356 .setattr = proc_setattr, 356 .setattr = proc_setattr,
357}; 357};
358 358
@@ -980,7 +980,7 @@ out:
980 return error; 980 return error;
981} 981}
982 982
983static struct inode_operations proc_pid_link_inode_operations = { 983static const struct inode_operations proc_pid_link_inode_operations = {
984 .readlink = proc_pid_readlink, 984 .readlink = proc_pid_readlink,
985 .follow_link = proc_pid_follow_link, 985 .follow_link = proc_pid_follow_link,
986 .setattr = proc_setattr, 986 .setattr = proc_setattr,
@@ -1416,7 +1416,7 @@ static const struct file_operations proc_fd_operations = {
1416/* 1416/*
1417 * proc directories can do almost nothing.. 1417 * proc directories can do almost nothing..
1418 */ 1418 */
1419static struct inode_operations proc_fd_inode_operations = { 1419static const struct inode_operations proc_fd_inode_operations = {
1420 .lookup = proc_lookupfd, 1420 .lookup = proc_lookupfd,
1421 .setattr = proc_setattr, 1421 .setattr = proc_setattr,
1422}; 1422};
@@ -1656,7 +1656,7 @@ static struct dentry *proc_attr_dir_lookup(struct inode *dir,
1656 attr_dir_stuff, ARRAY_SIZE(attr_dir_stuff)); 1656 attr_dir_stuff, ARRAY_SIZE(attr_dir_stuff));
1657} 1657}
1658 1658
1659static struct inode_operations proc_attr_dir_inode_operations = { 1659static const struct inode_operations proc_attr_dir_inode_operations = {
1660 .lookup = proc_attr_dir_lookup, 1660 .lookup = proc_attr_dir_lookup,
1661 .getattr = pid_getattr, 1661 .getattr = pid_getattr,
1662 .setattr = proc_setattr, 1662 .setattr = proc_setattr,
@@ -1682,7 +1682,7 @@ static void *proc_self_follow_link(struct dentry *dentry, struct nameidata *nd)
1682 return ERR_PTR(vfs_follow_link(nd,tmp)); 1682 return ERR_PTR(vfs_follow_link(nd,tmp));
1683} 1683}
1684 1684
1685static struct inode_operations proc_self_inode_operations = { 1685static const struct inode_operations proc_self_inode_operations = {
1686 .readlink = proc_self_readlink, 1686 .readlink = proc_self_readlink,
1687 .follow_link = proc_self_follow_link, 1687 .follow_link = proc_self_follow_link,
1688}; 1688};
@@ -1835,7 +1835,7 @@ static int proc_pid_io_accounting(struct task_struct *task, char *buffer)
1835 * Thread groups 1835 * Thread groups
1836 */ 1836 */
1837static const struct file_operations proc_task_operations; 1837static const struct file_operations proc_task_operations;
1838static struct inode_operations proc_task_inode_operations; 1838static const struct inode_operations proc_task_inode_operations;
1839 1839
1840static struct pid_entry tgid_base_stuff[] = { 1840static struct pid_entry tgid_base_stuff[] = {
1841 DIR("task", S_IRUGO|S_IXUGO, task), 1841 DIR("task", S_IRUGO|S_IXUGO, task),
@@ -1904,7 +1904,7 @@ static struct dentry *proc_tgid_base_lookup(struct inode *dir, struct dentry *de
1904 tgid_base_stuff, ARRAY_SIZE(tgid_base_stuff)); 1904 tgid_base_stuff, ARRAY_SIZE(tgid_base_stuff));
1905} 1905}
1906 1906
1907static struct inode_operations proc_tgid_base_inode_operations = { 1907static const struct inode_operations proc_tgid_base_inode_operations = {
1908 .lookup = proc_tgid_base_lookup, 1908 .lookup = proc_tgid_base_lookup,
1909 .getattr = pid_getattr, 1909 .getattr = pid_getattr,
1910 .setattr = proc_setattr, 1910 .setattr = proc_setattr,
@@ -2182,7 +2182,7 @@ static const struct file_operations proc_tid_base_operations = {
2182 .readdir = proc_tid_base_readdir, 2182 .readdir = proc_tid_base_readdir,
2183}; 2183};
2184 2184
2185static struct inode_operations proc_tid_base_inode_operations = { 2185static const struct inode_operations proc_tid_base_inode_operations = {
2186 .lookup = proc_tid_base_lookup, 2186 .lookup = proc_tid_base_lookup,
2187 .getattr = pid_getattr, 2187 .getattr = pid_getattr,
2188 .setattr = proc_setattr, 2188 .setattr = proc_setattr,
@@ -2408,7 +2408,7 @@ static int proc_task_getattr(struct vfsmount *mnt, struct dentry *dentry, struct
2408 return 0; 2408 return 0;
2409} 2409}
2410 2410
2411static struct inode_operations proc_task_inode_operations = { 2411static const struct inode_operations proc_task_inode_operations = {
2412 .lookup = proc_task_lookup, 2412 .lookup = proc_task_lookup,
2413 .getattr = proc_task_getattr, 2413 .getattr = proc_task_getattr,
2414 .setattr = proc_setattr, 2414 .setattr = proc_setattr,