aboutsummaryrefslogtreecommitdiffstats
path: root/net/core
diff options
context:
space:
mode:
authorArjan van de Ven <arjan@linux.intel.com>2007-02-12 03:55:35 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-12 12:48:46 -0500
commit9a32144e9d7b4e21341174b1a83b82a82353be86 (patch)
tree6f08560b341418fc9934f56f6162a95f5b5d8aec /net/core
parent00977a59b951207d38380c75f03a36829950265c (diff)
[PATCH] mark struct file_operations const 7
Many struct file_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 'net/core')
-rw-r--r--net/core/dev.c4
-rw-r--r--net/core/dev_mcast.c2
-rw-r--r--net/core/neighbour.c4
-rw-r--r--net/core/pktgen.c6
-rw-r--r--net/core/sock.c2
-rw-r--r--net/core/wireless.c2
6 files changed, 10 insertions, 10 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index 85d58d799329..cf71614dae93 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -2200,7 +2200,7 @@ static int dev_seq_open(struct inode *inode, struct file *file)
2200 return seq_open(file, &dev_seq_ops); 2200 return seq_open(file, &dev_seq_ops);
2201} 2201}
2202 2202
2203static struct file_operations dev_seq_fops = { 2203static const struct file_operations dev_seq_fops = {
2204 .owner = THIS_MODULE, 2204 .owner = THIS_MODULE,
2205 .open = dev_seq_open, 2205 .open = dev_seq_open,
2206 .read = seq_read, 2206 .read = seq_read,
@@ -2220,7 +2220,7 @@ static int softnet_seq_open(struct inode *inode, struct file *file)
2220 return seq_open(file, &softnet_seq_ops); 2220 return seq_open(file, &softnet_seq_ops);
2221} 2221}
2222 2222
2223static struct file_operations softnet_seq_fops = { 2223static const struct file_operations softnet_seq_fops = {
2224 .owner = THIS_MODULE, 2224 .owner = THIS_MODULE,
2225 .open = softnet_seq_open, 2225 .open = softnet_seq_open,
2226 .read = seq_read, 2226 .read = seq_read,
diff --git a/net/core/dev_mcast.c b/net/core/dev_mcast.c
index bfcbdf73a293..c4e754e86e96 100644
--- a/net/core/dev_mcast.c
+++ b/net/core/dev_mcast.c
@@ -277,7 +277,7 @@ static int dev_mc_seq_open(struct inode *inode, struct file *file)
277 return seq_open(file, &dev_mc_seq_ops); 277 return seq_open(file, &dev_mc_seq_ops);
278} 278}
279 279
280static struct file_operations dev_mc_seq_fops = { 280static const struct file_operations dev_mc_seq_fops = {
281 .owner = THIS_MODULE, 281 .owner = THIS_MODULE,
282 .open = dev_mc_seq_open, 282 .open = dev_mc_seq_open,
283 .read = seq_read, 283 .read = seq_read,
diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index c08d69650566..512eed91785d 100644
--- a/net/core/neighbour.c
+++ b/net/core/neighbour.c
@@ -63,7 +63,7 @@ void neigh_changeaddr(struct neigh_table *tbl, struct net_device *dev);
63 63
64static struct neigh_table *neigh_tables; 64static struct neigh_table *neigh_tables;
65#ifdef CONFIG_PROC_FS 65#ifdef CONFIG_PROC_FS
66static struct file_operations neigh_stat_seq_fops; 66static const struct file_operations neigh_stat_seq_fops;
67#endif 67#endif
68 68
69/* 69/*
@@ -2403,7 +2403,7 @@ static int neigh_stat_seq_open(struct inode *inode, struct file *file)
2403 return ret; 2403 return ret;
2404}; 2404};
2405 2405
2406static struct file_operations neigh_stat_seq_fops = { 2406static const struct file_operations neigh_stat_seq_fops = {
2407 .owner = THIS_MODULE, 2407 .owner = THIS_MODULE,
2408 .open = neigh_stat_seq_open, 2408 .open = neigh_stat_seq_open,
2409 .read = seq_read, 2409 .read = seq_read,
diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index c2818e07a4bd..74a9a32b906d 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -579,7 +579,7 @@ static int pgctrl_open(struct inode *inode, struct file *file)
579 return single_open(file, pgctrl_show, PDE(inode)->data); 579 return single_open(file, pgctrl_show, PDE(inode)->data);
580} 580}
581 581
582static struct file_operations pktgen_fops = { 582static const struct file_operations pktgen_fops = {
583 .owner = THIS_MODULE, 583 .owner = THIS_MODULE,
584 .open = pgctrl_open, 584 .open = pgctrl_open,
585 .read = seq_read, 585 .read = seq_read,
@@ -1672,7 +1672,7 @@ static int pktgen_if_open(struct inode *inode, struct file *file)
1672 return single_open(file, pktgen_if_show, PDE(inode)->data); 1672 return single_open(file, pktgen_if_show, PDE(inode)->data);
1673} 1673}
1674 1674
1675static struct file_operations pktgen_if_fops = { 1675static const struct file_operations pktgen_if_fops = {
1676 .owner = THIS_MODULE, 1676 .owner = THIS_MODULE,
1677 .open = pktgen_if_open, 1677 .open = pktgen_if_open,
1678 .read = seq_read, 1678 .read = seq_read,
@@ -1815,7 +1815,7 @@ static int pktgen_thread_open(struct inode *inode, struct file *file)
1815 return single_open(file, pktgen_thread_show, PDE(inode)->data); 1815 return single_open(file, pktgen_thread_show, PDE(inode)->data);
1816} 1816}
1817 1817
1818static struct file_operations pktgen_thread_fops = { 1818static const struct file_operations pktgen_thread_fops = {
1819 .owner = THIS_MODULE, 1819 .owner = THIS_MODULE,
1820 .open = pktgen_thread_open, 1820 .open = pktgen_thread_open,
1821 .read = seq_read, 1821 .read = seq_read,
diff --git a/net/core/sock.c b/net/core/sock.c
index 1e35d9973f57..e9986acdd0ab 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -1911,7 +1911,7 @@ static int proto_seq_open(struct inode *inode, struct file *file)
1911 return seq_open(file, &proto_seq_ops); 1911 return seq_open(file, &proto_seq_ops);
1912} 1912}
1913 1913
1914static struct file_operations proto_seq_fops = { 1914static const struct file_operations proto_seq_fops = {
1915 .owner = THIS_MODULE, 1915 .owner = THIS_MODULE,
1916 .open = proto_seq_open, 1916 .open = proto_seq_open,
1917 .read = seq_read, 1917 .read = seq_read,
diff --git a/net/core/wireless.c b/net/core/wireless.c
index 64017d47b25b..9936ab11e6e0 100644
--- a/net/core/wireless.c
+++ b/net/core/wireless.c
@@ -674,7 +674,7 @@ static int wireless_seq_open(struct inode *inode, struct file *file)
674 return seq_open(file, &wireless_seq_ops); 674 return seq_open(file, &wireless_seq_ops);
675} 675}
676 676
677static struct file_operations wireless_seq_fops = { 677static const struct file_operations wireless_seq_fops = {
678 .owner = THIS_MODULE, 678 .owner = THIS_MODULE,
679 .open = wireless_seq_open, 679 .open = wireless_seq_open,
680 .read = seq_read, 680 .read = seq_read,