diff options
author | Arjan van de Ven <arjan@linux.intel.com> | 2007-02-12 00:55:35 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-12 09:48:46 -0800 |
commit | 9a32144e9d7b4e21341174b1a83b82a82353be86 (patch) | |
tree | 6f08560b341418fc9934f56f6162a95f5b5d8aec /net/ipv4 | |
parent | 00977a59b951207d38380c75f03a36829950265c (diff) | |
download | linux-9a32144e9d7b4e21341174b1a83b82a82353be86.tar.gz linux-9a32144e9d7b4e21341174b1a83b82a82353be86.tar.bz2 linux-9a32144e9d7b4e21341174b1a83b82a82353be86.zip |
[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/ipv4')
-rw-r--r-- | net/ipv4/arp.c | 2 | ||||
-rw-r--r-- | net/ipv4/fib_hash.c | 2 | ||||
-rw-r--r-- | net/ipv4/fib_trie.c | 6 | ||||
-rw-r--r-- | net/ipv4/igmp.c | 4 | ||||
-rw-r--r-- | net/ipv4/ipconfig.c | 2 | ||||
-rw-r--r-- | net/ipv4/ipmr.c | 4 | ||||
-rw-r--r-- | net/ipv4/ipvs/ip_vs_app.c | 2 | ||||
-rw-r--r-- | net/ipv4/ipvs/ip_vs_conn.c | 2 | ||||
-rw-r--r-- | net/ipv4/ipvs/ip_vs_ctl.c | 4 | ||||
-rw-r--r-- | net/ipv4/netfilter/ip_conntrack_standalone.c | 6 | ||||
-rw-r--r-- | net/ipv4/netfilter/ipt_CLUSTERIP.c | 4 | ||||
-rw-r--r-- | net/ipv4/netfilter/ipt_recent.c | 4 | ||||
-rw-r--r-- | net/ipv4/netfilter/nf_conntrack_l3proto_ipv4_compat.c | 6 | ||||
-rw-r--r-- | net/ipv4/proc.c | 6 | ||||
-rw-r--r-- | net/ipv4/raw.c | 2 | ||||
-rw-r--r-- | net/ipv4/route.c | 4 | ||||
-rw-r--r-- | net/ipv4/tcp_probe.c | 2 |
17 files changed, 31 insertions, 31 deletions
diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c index a58afde4f72f..0ffd2d2920c3 100644 --- a/net/ipv4/arp.c +++ b/net/ipv4/arp.c @@ -1390,7 +1390,7 @@ out_kfree: goto out; } -static struct file_operations arp_seq_fops = { +static const struct file_operations arp_seq_fops = { .owner = THIS_MODULE, .open = arp_seq_open, .read = seq_read, diff --git a/net/ipv4/fib_hash.c b/net/ipv4/fib_hash.c index dea04d725b04..b21bb28d1fd0 100644 --- a/net/ipv4/fib_hash.c +++ b/net/ipv4/fib_hash.c @@ -1057,7 +1057,7 @@ out_kfree: goto out; } -static struct file_operations fib_seq_fops = { +static const struct file_operations fib_seq_fops = { .owner = THIS_MODULE, .open = fib_seq_open, .read = seq_read, diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c index 004a437bd7b5..c33dca073801 100644 --- a/net/ipv4/fib_trie.c +++ b/net/ipv4/fib_trie.c @@ -2173,7 +2173,7 @@ static int fib_triestat_seq_open(struct inode *inode, struct file *file) return single_open(file, fib_triestat_seq_show, NULL); } -static struct file_operations fib_triestat_fops = { +static const struct file_operations fib_triestat_fops = { .owner = THIS_MODULE, .open = fib_triestat_seq_open, .read = seq_read, @@ -2364,7 +2364,7 @@ out_kfree: goto out; } -static struct file_operations fib_trie_fops = { +static const struct file_operations fib_trie_fops = { .owner = THIS_MODULE, .open = fib_trie_seq_open, .read = seq_read, @@ -2485,7 +2485,7 @@ out_kfree: goto out; } -static struct file_operations fib_route_fops = { +static const struct file_operations fib_route_fops = { .owner = THIS_MODULE, .open = fib_route_seq_open, .read = seq_read, diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c index b8e1625d34cf..063721302ebf 100644 --- a/net/ipv4/igmp.c +++ b/net/ipv4/igmp.c @@ -2403,7 +2403,7 @@ out_kfree: goto out; } -static struct file_operations igmp_mc_seq_fops = { +static const struct file_operations igmp_mc_seq_fops = { .owner = THIS_MODULE, .open = igmp_mc_seq_open, .read = seq_read, @@ -2577,7 +2577,7 @@ out_kfree: goto out; } -static struct file_operations igmp_mcf_seq_fops = { +static const struct file_operations igmp_mcf_seq_fops = { .owner = THIS_MODULE, .open = igmp_mcf_seq_open, .read = seq_read, diff --git a/net/ipv4/ipconfig.c b/net/ipv4/ipconfig.c index ba882bec317a..cf49de1a4983 100644 --- a/net/ipv4/ipconfig.c +++ b/net/ipv4/ipconfig.c @@ -1200,7 +1200,7 @@ static int pnp_seq_open(struct inode *indoe, struct file *file) return single_open(file, pnp_seq_show, NULL); } -static struct file_operations pnp_seq_fops = { +static const struct file_operations pnp_seq_fops = { .owner = THIS_MODULE, .open = pnp_seq_open, .read = seq_read, diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c index 604f5b585104..e6d11abd7841 100644 --- a/net/ipv4/ipmr.c +++ b/net/ipv4/ipmr.c @@ -1712,7 +1712,7 @@ out_kfree: } -static struct file_operations ipmr_vif_fops = { +static const struct file_operations ipmr_vif_fops = { .owner = THIS_MODULE, .open = ipmr_vif_open, .read = seq_read, @@ -1874,7 +1874,7 @@ out_kfree: } -static struct file_operations ipmr_mfc_fops = { +static const struct file_operations ipmr_mfc_fops = { .owner = THIS_MODULE, .open = ipmr_mfc_open, .read = seq_read, diff --git a/net/ipv4/ipvs/ip_vs_app.c b/net/ipv4/ipvs/ip_vs_app.c index 6c40899aa161..22e104c6a493 100644 --- a/net/ipv4/ipvs/ip_vs_app.c +++ b/net/ipv4/ipvs/ip_vs_app.c @@ -561,7 +561,7 @@ static int ip_vs_app_open(struct inode *inode, struct file *file) return seq_open(file, &ip_vs_app_seq_ops); } -static struct file_operations ip_vs_app_fops = { +static const struct file_operations ip_vs_app_fops = { .owner = THIS_MODULE, .open = ip_vs_app_open, .read = seq_read, diff --git a/net/ipv4/ipvs/ip_vs_conn.c b/net/ipv4/ipvs/ip_vs_conn.c index 0b5e03476ce4..7018f97c75dc 100644 --- a/net/ipv4/ipvs/ip_vs_conn.c +++ b/net/ipv4/ipvs/ip_vs_conn.c @@ -757,7 +757,7 @@ static int ip_vs_conn_open(struct inode *inode, struct file *file) return seq_open(file, &ip_vs_conn_seq_ops); } -static struct file_operations ip_vs_conn_fops = { +static const struct file_operations ip_vs_conn_fops = { .owner = THIS_MODULE, .open = ip_vs_conn_open, .read = seq_read, diff --git a/net/ipv4/ipvs/ip_vs_ctl.c b/net/ipv4/ipvs/ip_vs_ctl.c index 9b933381ebbe..8b08d9cdcbc8 100644 --- a/net/ipv4/ipvs/ip_vs_ctl.c +++ b/net/ipv4/ipvs/ip_vs_ctl.c @@ -1812,7 +1812,7 @@ out_kfree: goto out; } -static struct file_operations ip_vs_info_fops = { +static const struct file_operations ip_vs_info_fops = { .owner = THIS_MODULE, .open = ip_vs_info_open, .read = seq_read, @@ -1859,7 +1859,7 @@ static int ip_vs_stats_seq_open(struct inode *inode, struct file *file) return single_open(file, ip_vs_stats_show, NULL); } -static struct file_operations ip_vs_stats_fops = { +static const struct file_operations ip_vs_stats_fops = { .owner = THIS_MODULE, .open = ip_vs_stats_seq_open, .read = seq_read, diff --git a/net/ipv4/netfilter/ip_conntrack_standalone.c b/net/ipv4/netfilter/ip_conntrack_standalone.c index 5903588fddce..300ccbbbdac9 100644 --- a/net/ipv4/netfilter/ip_conntrack_standalone.c +++ b/net/ipv4/netfilter/ip_conntrack_standalone.c @@ -222,7 +222,7 @@ out_free: return ret; } -static struct file_operations ct_file_ops = { +static const struct file_operations ct_file_ops = { .owner = THIS_MODULE, .open = ct_open, .read = seq_read, @@ -298,7 +298,7 @@ static int exp_open(struct inode *inode, struct file *file) return seq_open(file, &exp_seq_ops); } -static struct file_operations exp_file_ops = { +static const struct file_operations exp_file_ops = { .owner = THIS_MODULE, .open = exp_open, .read = seq_read, @@ -386,7 +386,7 @@ static int ct_cpu_seq_open(struct inode *inode, struct file *file) return seq_open(file, &ct_cpu_seq_ops); } -static struct file_operations ct_cpu_seq_fops = { +static const struct file_operations ct_cpu_seq_fops = { .owner = THIS_MODULE, .open = ct_cpu_seq_open, .read = seq_read, diff --git a/net/ipv4/netfilter/ipt_CLUSTERIP.c b/net/ipv4/netfilter/ipt_CLUSTERIP.c index 4fe28f264475..e965b333c997 100644 --- a/net/ipv4/netfilter/ipt_CLUSTERIP.c +++ b/net/ipv4/netfilter/ipt_CLUSTERIP.c @@ -70,7 +70,7 @@ static LIST_HEAD(clusterip_configs); static DEFINE_RWLOCK(clusterip_lock); #ifdef CONFIG_PROC_FS -static struct file_operations clusterip_proc_fops; +static const struct file_operations clusterip_proc_fops; static struct proc_dir_entry *clusterip_procdir; #endif @@ -715,7 +715,7 @@ static ssize_t clusterip_proc_write(struct file *file, const char __user *input, return size; } -static struct file_operations clusterip_proc_fops = { +static const struct file_operations clusterip_proc_fops = { .owner = THIS_MODULE, .open = clusterip_proc_open, .read = seq_read, diff --git a/net/ipv4/netfilter/ipt_recent.c b/net/ipv4/netfilter/ipt_recent.c index 6b97b6796173..aecb9c48e152 100644 --- a/net/ipv4/netfilter/ipt_recent.c +++ b/net/ipv4/netfilter/ipt_recent.c @@ -79,7 +79,7 @@ static DEFINE_MUTEX(recent_mutex); #ifdef CONFIG_PROC_FS static struct proc_dir_entry *proc_dir; -static struct file_operations recent_fops; +static const struct file_operations recent_fops; #endif static u_int32_t hash_rnd; @@ -454,7 +454,7 @@ static ssize_t recent_proc_write(struct file *file, const char __user *input, return size; } -static struct file_operations recent_fops = { +static const struct file_operations recent_fops = { .open = recent_seq_open, .read = seq_read, .write = recent_proc_write, diff --git a/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4_compat.c b/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4_compat.c index 14a93a738418..89f933e81035 100644 --- a/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4_compat.c +++ b/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4_compat.c @@ -197,7 +197,7 @@ out_free: return ret; } -static struct file_operations ct_file_ops = { +static const struct file_operations ct_file_ops = { .owner = THIS_MODULE, .open = ct_open, .read = seq_read, @@ -278,7 +278,7 @@ static int exp_open(struct inode *inode, struct file *file) return seq_open(file, &exp_seq_ops); } -static struct file_operations ip_exp_file_ops = { +static const struct file_operations ip_exp_file_ops = { .owner = THIS_MODULE, .open = exp_open, .read = seq_read, @@ -366,7 +366,7 @@ static int ct_cpu_seq_open(struct inode *inode, struct file *file) return seq_open(file, &ct_cpu_seq_ops); } -static struct file_operations ct_cpu_seq_fops = { +static const struct file_operations ct_cpu_seq_fops = { .owner = THIS_MODULE, .open = ct_cpu_seq_open, .read = seq_read, diff --git a/net/ipv4/proc.c b/net/ipv4/proc.c index ccb199e9dd8b..ae68a691e8cd 100644 --- a/net/ipv4/proc.c +++ b/net/ipv4/proc.c @@ -79,7 +79,7 @@ static int sockstat_seq_open(struct inode *inode, struct file *file) return single_open(file, sockstat_seq_show, NULL); } -static struct file_operations sockstat_seq_fops = { +static const struct file_operations sockstat_seq_fops = { .owner = THIS_MODULE, .open = sockstat_seq_open, .read = seq_read, @@ -326,7 +326,7 @@ static int snmp_seq_open(struct inode *inode, struct file *file) return single_open(file, snmp_seq_show, NULL); } -static struct file_operations snmp_seq_fops = { +static const struct file_operations snmp_seq_fops = { .owner = THIS_MODULE, .open = snmp_seq_open, .read = seq_read, @@ -360,7 +360,7 @@ static int netstat_seq_open(struct inode *inode, struct file *file) return single_open(file, netstat_seq_show, NULL); } -static struct file_operations netstat_seq_fops = { +static const struct file_operations netstat_seq_fops = { .owner = THIS_MODULE, .open = netstat_seq_open, .read = seq_read, diff --git a/net/ipv4/raw.c b/net/ipv4/raw.c index 931084bfb572..87e9c1618100 100644 --- a/net/ipv4/raw.c +++ b/net/ipv4/raw.c @@ -916,7 +916,7 @@ out_kfree: goto out; } -static struct file_operations raw_seq_fops = { +static const struct file_operations raw_seq_fops = { .owner = THIS_MODULE, .open = raw_seq_open, .read = seq_read, diff --git a/net/ipv4/route.c b/net/ipv4/route.c index 5b3834b38a2d..9b5e56481d53 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c @@ -393,7 +393,7 @@ out_kfree: goto out; } -static struct file_operations rt_cache_seq_fops = { +static const struct file_operations rt_cache_seq_fops = { .owner = THIS_MODULE, .open = rt_cache_seq_open, .read = seq_read, @@ -484,7 +484,7 @@ static int rt_cpu_seq_open(struct inode *inode, struct file *file) return seq_open(file, &rt_cpu_seq_ops); } -static struct file_operations rt_cpu_seq_fops = { +static const struct file_operations rt_cpu_seq_fops = { .owner = THIS_MODULE, .open = rt_cpu_seq_open, .read = seq_read, diff --git a/net/ipv4/tcp_probe.c b/net/ipv4/tcp_probe.c index 41c157848181..61f406f27294 100644 --- a/net/ipv4/tcp_probe.c +++ b/net/ipv4/tcp_probe.c @@ -143,7 +143,7 @@ out_free: return error ? error : cnt; } -static struct file_operations tcpprobe_fops = { +static const struct file_operations tcpprobe_fops = { .owner = THIS_MODULE, .open = tcpprobe_open, .read = tcpprobe_read, |