summaryrefslogtreecommitdiffstats
path: root/net/ipv4
diff options
context:
space:
mode:
authorArjan van de Ven <arjan@linux.intel.com>2007-02-12 00:55:35 -0800
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-12 09:48:46 -0800
commit9a32144e9d7b4e21341174b1a83b82a82353be86 (patch)
tree6f08560b341418fc9934f56f6162a95f5b5d8aec /net/ipv4
parent00977a59b951207d38380c75f03a36829950265c (diff)
downloadop-kernel-dev-9a32144e9d7b4e21341174b1a83b82a82353be86.zip
op-kernel-dev-9a32144e9d7b4e21341174b1a83b82a82353be86.tar.gz
[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.c2
-rw-r--r--net/ipv4/fib_hash.c2
-rw-r--r--net/ipv4/fib_trie.c6
-rw-r--r--net/ipv4/igmp.c4
-rw-r--r--net/ipv4/ipconfig.c2
-rw-r--r--net/ipv4/ipmr.c4
-rw-r--r--net/ipv4/ipvs/ip_vs_app.c2
-rw-r--r--net/ipv4/ipvs/ip_vs_conn.c2
-rw-r--r--net/ipv4/ipvs/ip_vs_ctl.c4
-rw-r--r--net/ipv4/netfilter/ip_conntrack_standalone.c6
-rw-r--r--net/ipv4/netfilter/ipt_CLUSTERIP.c4
-rw-r--r--net/ipv4/netfilter/ipt_recent.c4
-rw-r--r--net/ipv4/netfilter/nf_conntrack_l3proto_ipv4_compat.c6
-rw-r--r--net/ipv4/proc.c6
-rw-r--r--net/ipv4/raw.c2
-rw-r--r--net/ipv4/route.c4
-rw-r--r--net/ipv4/tcp_probe.c2
17 files changed, 31 insertions, 31 deletions
diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c
index a58afde..0ffd2d2 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 dea04d7..b21bb28 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 004a437..c33dca0 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 b8e1625..0637213 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 ba882be..cf49de1 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 604f5b5..e6d11ab 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 6c40899..22e104c 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 0b5e034..7018f97 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 9b93338..8b08d9c 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 5903588..300ccbb 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 4fe28f2..e965b33 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 6b97b67..aecb9c4 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 14a93a7..89f933e 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 ccb199e..ae68a69 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 931084b..87e9c16 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 5b3834b3..9b5e564 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 41c1578..61f406f2 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,
OpenPOWER on IntegriCloud