]> git.openpandora.org Git - pandora-kernel.git/commitdiff
[PATCH] mark struct file_operations const 7
authorArjan van de Ven <arjan@linux.intel.com>
Mon, 12 Feb 2007 08:55:35 +0000 (00:55 -0800)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Mon, 12 Feb 2007 17:48:46 +0000 (09:48 -0800)
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>
53 files changed:
ipc/mqueue.c
ipc/shm.c
ipc/util.c
kernel/cpuset.c
net/802/tr.c
net/8021q/vlanproc.c
net/appletalk/aarp.c
net/appletalk/atalk_proc.c
net/atm/br2684.c
net/atm/clip.c
net/atm/lec.c
net/atm/mpoa_proc.c
net/atm/proc.c
net/ax25/af_ax25.c
net/ax25/ax25_route.c
net/ax25/ax25_uid.c
net/core/dev.c
net/core/dev_mcast.c
net/core/neighbour.c
net/core/pktgen.c
net/core/sock.c
net/core/wireless.c
net/dccp/probe.c
net/decnet/af_decnet.c
net/decnet/dn_dev.c
net/decnet/dn_neigh.c
net/decnet/dn_route.c
net/ipv4/arp.c
net/ipv4/fib_hash.c
net/ipv4/fib_trie.c
net/ipv4/igmp.c
net/ipv4/ipconfig.c
net/ipv4/ipmr.c
net/ipv4/ipvs/ip_vs_app.c
net/ipv4/ipvs/ip_vs_conn.c
net/ipv4/ipvs/ip_vs_ctl.c
net/ipv4/netfilter/ip_conntrack_standalone.c
net/ipv4/netfilter/ipt_CLUSTERIP.c
net/ipv4/netfilter/ipt_recent.c
net/ipv4/netfilter/nf_conntrack_l3proto_ipv4_compat.c
net/ipv4/proc.c
net/ipv4/raw.c
net/ipv4/route.c
net/ipv4/tcp_probe.c
net/ipv6/addrconf.c
net/ipv6/anycast.c
net/ipv6/ip6_flowlabel.c
net/ipv6/mcast.c
net/ipv6/proc.c
net/ipv6/raw.c
net/ipv6/route.c
net/ipx/ipx_proc.c
net/irda/discovery.c

index 02717f71d8d0ca325684d26d8bb79fe87c586ae1..fafdef357e92c07a2b59c871af8fb8d4df9cf1cf 100644 (file)
@@ -85,7 +85,7 @@ struct mqueue_inode_info {
 };
 
 static struct inode_operations mqueue_dir_inode_operations;
-static struct file_operations mqueue_file_operations;
+static const struct file_operations mqueue_file_operations;
 static struct super_operations mqueue_super_ops;
 static void remove_notification(struct mqueue_inode_info *info);
 
@@ -1166,7 +1166,7 @@ static struct inode_operations mqueue_dir_inode_operations = {
        .unlink = mqueue_unlink,
 };
 
-static struct file_operations mqueue_file_operations = {
+static const struct file_operations mqueue_file_operations = {
        .flush = mqueue_flush_file,
        .poll = mqueue_poll_file,
        .read = mqueue_read_file,
index f8e10a25ad7d9ece3f9e409eb3859ba282faed73..5bb617f6306e8df814398505393b15e2b0c3c0ee 100644 (file)
--- a/ipc/shm.c
+++ b/ipc/shm.c
@@ -42,7 +42,7 @@
 
 #include "util.h"
 
-static struct file_operations shm_file_operations;
+static const struct file_operations shm_file_operations;
 static struct vm_operations_struct shm_vm_ops;
 
 static struct ipc_ids init_shm_ids;
@@ -249,7 +249,7 @@ static int shm_release(struct inode *ino, struct file *file)
        return 0;
 }
 
-static struct file_operations shm_file_operations = {
+static const struct file_operations shm_file_operations = {
        .mmap           = shm_mmap,
        .release        = shm_release,
 #ifndef CONFIG_MMU
index 115e9aac13668762db8d45213778deafa5173f89..08a647965b9e9c360ce0e182b53e294d347d2578 100644 (file)
@@ -205,7 +205,7 @@ void __ipc_init ipc_init_ids(struct ipc_ids* ids, int size)
 }
 
 #ifdef CONFIG_PROC_FS
-static struct file_operations sysvipc_proc_fops;
+static const struct file_operations sysvipc_proc_fops;
 /**
  *     ipc_init_proc_interface -  Create a proc interface for sysipc types using a seq_file interface.
  *     @path: Path in procfs
@@ -879,7 +879,7 @@ static int sysvipc_proc_release(struct inode *inode, struct file *file)
        return seq_release_private(inode, file);
 }
 
-static struct file_operations sysvipc_proc_fops = {
+static const struct file_operations sysvipc_proc_fops = {
        .open    = sysvipc_proc_open,
        .read    = seq_read,
        .llseek  = seq_lseek,
index 6b05dc69c9597f900f46c02ff6acaff4e9768458..232aed2b10f9a403346cc6e4a425c4ed8613a4d1 100644 (file)
@@ -2656,7 +2656,7 @@ static int cpuset_open(struct inode *inode, struct file *file)
        return single_open(file, proc_cpuset_show, pid);
 }
 
-struct file_operations proc_cpuset_operations = {
+const struct file_operations proc_cpuset_operations = {
        .open           = cpuset_open,
        .read           = seq_read,
        .llseek         = seq_lseek,
index 31509f613401a3a788cdce2677ef97f0facba94a..96bd14452c55826fb1875e1b59dbd3ac691e2b58 100644 (file)
@@ -576,7 +576,7 @@ static int rif_seq_open(struct inode *inode, struct file *file)
        return seq_open(file, &rif_seq_ops);
 }
 
-static struct file_operations rif_seq_fops = {
+static const struct file_operations rif_seq_fops = {
        .owner   = THIS_MODULE,
        .open    = rif_seq_open,
        .read    = seq_read,
index 1b72c9854d6f7fcffd601cac7696c6a9661e5a37..5e24f72602a1b1a927938f8fe9b2e47cc6d32a98 100644 (file)
@@ -81,7 +81,7 @@ static int vlan_seq_open(struct inode *inode, struct file *file)
        return seq_open(file, &vlan_seq_ops);
 }
 
-static struct file_operations vlan_fops = {
+static const struct file_operations vlan_fops = {
        .owner   = THIS_MODULE,
        .open    = vlan_seq_open,
        .read    = seq_read,
@@ -98,7 +98,7 @@ static int vlandev_seq_open(struct inode *inode, struct file *file)
        return single_open(file, vlandev_seq_show, PDE(inode)->data);
 }
 
-static struct file_operations vlandev_fops = {
+static const struct file_operations vlandev_fops = {
        .owner = THIS_MODULE,
        .open    = vlandev_seq_open,
        .read    = seq_read,
index 27e845d260a9f65b9e1a787294e735eb8c56020a..d89d62f3702fd2551f97e28dbcd7f897702bf333 100644 (file)
@@ -1048,7 +1048,7 @@ out_kfree:
        goto out;
 }
 
-struct file_operations atalk_seq_arp_fops = {
+const struct file_operations atalk_seq_arp_fops = {
        .owner          = THIS_MODULE,
        .open           = aarp_seq_open,
        .read           = seq_read,
index bc3015f277ba6a80284c50b159355608105c8385..57ff8122b5c59b8da1e0d0a44abce1f38ef710b9 100644 (file)
@@ -240,7 +240,7 @@ static int atalk_seq_socket_open(struct inode *inode, struct file *file)
        return seq_open(file, &atalk_seq_socket_ops);
 }
 
-static struct file_operations atalk_seq_interface_fops = {
+static const struct file_operations atalk_seq_interface_fops = {
        .owner          = THIS_MODULE,
        .open           = atalk_seq_interface_open,
        .read           = seq_read,
@@ -248,7 +248,7 @@ static struct file_operations atalk_seq_interface_fops = {
        .release        = seq_release,
 };
 
-static struct file_operations atalk_seq_route_fops = {
+static const struct file_operations atalk_seq_route_fops = {
        .owner          = THIS_MODULE,
        .open           = atalk_seq_route_open,
        .read           = seq_read,
@@ -256,7 +256,7 @@ static struct file_operations atalk_seq_route_fops = {
        .release        = seq_release,
 };
 
-static struct file_operations atalk_seq_socket_fops = {
+static const struct file_operations atalk_seq_socket_fops = {
        .owner          = THIS_MODULE,
        .open           = atalk_seq_socket_open,
        .read           = seq_read,
index f949b5c74ec19217e548ad2c762e7655acb19f65..ec4ebd3299e34acc154527ae3f4588964586a3ee 100644 (file)
@@ -784,7 +784,7 @@ static int br2684_proc_open(struct inode *inode, struct file *file)
        return seq_open(file, &br2684_seq_ops);
 }
 
-static struct file_operations br2684_proc_ops = {
+static const struct file_operations br2684_proc_ops = {
        .owner   = THIS_MODULE,
        .open    = br2684_proc_open,
        .read    = seq_read,
index 5f8a1d222720c61ecf8b04ae077834e638a04f8d..ebb5d0ce8b6fd6f61fbe705c3b5162a6b6bca425 100644 (file)
@@ -971,7 +971,7 @@ out_kfree:
        goto out;
 }
 
-static struct file_operations arp_seq_fops = {
+static const struct file_operations arp_seq_fops = {
        .open           = arp_seq_open,
        .read           = seq_read,
        .llseek         = seq_lseek,
index 57dc2ab1b65dd6c7d1b0dcb26f4c2c763359267c..986945527691204684958cbc7c06ee8dff886ee1 100644 (file)
@@ -1212,7 +1212,7 @@ static int lec_seq_release(struct inode *inode, struct file *file)
        return seq_release_private(inode, file);
 }
 
-static struct file_operations lec_seq_fops = {
+static const struct file_operations lec_seq_fops = {
        .owner = THIS_MODULE,
        .open = lec_seq_open,
        .read = seq_read,
index 43315af10309c9b25b97c1e37032d49e9629758a..4b05cbec7a581c8d44a14dfe3dbcfe593e961c40 100644 (file)
@@ -39,7 +39,7 @@ static int parse_qos(const char *buff);
 /*
  *   Define allowed FILE OPERATIONS
  */
-static struct file_operations mpc_file_operations = {
+static const struct file_operations mpc_file_operations = {
        .owner =        THIS_MODULE,
        .open =         proc_mpc_open,
        .read =         seq_read,
index 190f49ce2cadd84db06cbc84b5ee61ce79d35828..9e61e512f6670d77f0f7f0e2a55d1f79cb60ff5d 100644 (file)
@@ -33,7 +33,7 @@
 static ssize_t proc_dev_atm_read(struct file *file,char __user *buf,size_t count,
     loff_t *pos);
 
-static struct file_operations proc_atm_dev_ops = {
+static const struct file_operations proc_atm_dev_ops = {
        .owner =        THIS_MODULE,
        .read =         proc_dev_atm_read,
 };
@@ -272,7 +272,7 @@ static int atm_dev_seq_open(struct inode *inode, struct file *file)
        return seq_open(file, &atm_dev_seq_ops);
 }
 
-static struct file_operations devices_seq_fops = {
+static const struct file_operations devices_seq_fops = {
        .open           = atm_dev_seq_open,
        .read           = seq_read,
        .llseek         = seq_lseek,
@@ -307,7 +307,7 @@ static int pvc_seq_open(struct inode *inode, struct file *file)
        return __vcc_seq_open(inode, file, PF_ATMPVC, &pvc_seq_ops);
 }
 
-static struct file_operations pvc_seq_fops = {
+static const struct file_operations pvc_seq_fops = {
        .open           = pvc_seq_open,
        .read           = seq_read,
        .llseek         = seq_lseek,
@@ -341,7 +341,7 @@ static int vcc_seq_open(struct inode *inode, struct file *file)
        return __vcc_seq_open(inode, file, 0, &vcc_seq_ops);
 }
 
-static struct file_operations vcc_seq_fops = {
+static const struct file_operations vcc_seq_fops = {
        .open           = vcc_seq_open,
        .read           = seq_read,
        .llseek         = seq_lseek,
@@ -376,7 +376,7 @@ static int svc_seq_open(struct inode *inode, struct file *file)
        return __vcc_seq_open(inode, file, PF_ATMSVC, &svc_seq_ops);
 }
 
-static struct file_operations svc_seq_fops = {
+static const struct file_operations svc_seq_fops = {
        .open           = svc_seq_open,
        .read           = seq_read,
        .llseek         = seq_lseek,
@@ -457,7 +457,7 @@ void atm_proc_dev_deregister(struct atm_dev *dev)
 
 static struct atm_proc_entry {
        char *name;
-       struct file_operations *proc_fops;
+       const struct file_operations *proc_fops;
        struct proc_dir_entry *dirent;
 } atm_proc_ents[] = {
        { .name = "devices",    .proc_fops = &devices_seq_fops },
index 9a0b677d1e7fdafd94f8aecc61741b104be461f8..1c07c6a50eb82eff90cfa88a209a979ce63307e8 100644 (file)
@@ -1938,7 +1938,7 @@ static int ax25_info_open(struct inode *inode, struct file *file)
        return seq_open(file, &ax25_info_seqops);
 }
 
-static struct file_operations ax25_info_fops = {
+static const struct file_operations ax25_info_fops = {
        .owner = THIS_MODULE,
        .open = ax25_info_open,
        .read = seq_read,
index 7078861a738510b549d7d160c1c060886e0a32cf..d65b8e22868d9a4c5e1f7a47ddbbfa3cc21080d9 100644 (file)
@@ -332,7 +332,7 @@ static int ax25_rt_info_open(struct inode *inode, struct file *file)
        return seq_open(file, &ax25_rt_seqops);
 }
 
-struct file_operations ax25_route_fops = {
+const struct file_operations ax25_route_fops = {
        .owner = THIS_MODULE,
        .open = ax25_rt_info_open,
        .read = seq_read,
index 7f4c294b36f111a2bb866129a0d66dcf2397deed..59a41b1e61f53bd2c1894dc243bc0f0bffa56857 100644 (file)
@@ -198,7 +198,7 @@ static int ax25_uid_info_open(struct inode *inode, struct file *file)
        return seq_open(file, &ax25_uid_seqops);
 }
 
-struct file_operations ax25_uid_fops = {
+const struct file_operations ax25_uid_fops = {
        .owner = THIS_MODULE,
        .open = ax25_uid_info_open,
        .read = seq_read,
index 85d58d799329716faa3af946195ac852937dd1d9..cf71614dae93bf29d5211b86dc487c9e9a82faff 100644 (file)
@@ -2200,7 +2200,7 @@ static int dev_seq_open(struct inode *inode, struct file *file)
        return seq_open(file, &dev_seq_ops);
 }
 
-static struct file_operations dev_seq_fops = {
+static const struct file_operations dev_seq_fops = {
        .owner   = THIS_MODULE,
        .open    = dev_seq_open,
        .read    = seq_read,
@@ -2220,7 +2220,7 @@ static int softnet_seq_open(struct inode *inode, struct file *file)
        return seq_open(file, &softnet_seq_ops);
 }
 
-static struct file_operations softnet_seq_fops = {
+static const struct file_operations softnet_seq_fops = {
        .owner   = THIS_MODULE,
        .open    = softnet_seq_open,
        .read    = seq_read,
index bfcbdf73a2930efd98cc92e66fae46746cb47483..c4e754e86e9634f1a55c76a4d8a500343e70936c 100644 (file)
@@ -277,7 +277,7 @@ static int dev_mc_seq_open(struct inode *inode, struct file *file)
        return seq_open(file, &dev_mc_seq_ops);
 }
 
-static struct file_operations dev_mc_seq_fops = {
+static const struct file_operations dev_mc_seq_fops = {
        .owner   = THIS_MODULE,
        .open    = dev_mc_seq_open,
        .read    = seq_read,
index c08d69650566ed613b4ff706e6fab9014ab8a7b3..512eed91785dc5dbab2de12a4603473dddc6b791 100644 (file)
@@ -63,7 +63,7 @@ void neigh_changeaddr(struct neigh_table *tbl, struct net_device *dev);
 
 static struct neigh_table *neigh_tables;
 #ifdef CONFIG_PROC_FS
-static struct file_operations neigh_stat_seq_fops;
+static const struct file_operations neigh_stat_seq_fops;
 #endif
 
 /*
@@ -2403,7 +2403,7 @@ static int neigh_stat_seq_open(struct inode *inode, struct file *file)
        return ret;
 };
 
-static struct file_operations neigh_stat_seq_fops = {
+static const struct file_operations neigh_stat_seq_fops = {
        .owner   = THIS_MODULE,
        .open    = neigh_stat_seq_open,
        .read    = seq_read,
index c2818e07a4bd7b18c1fedfe7c194927bd780bb0a..74a9a32b906d49990f3c2d4e2ccc99a8cf9a0810 100644 (file)
@@ -579,7 +579,7 @@ static int pgctrl_open(struct inode *inode, struct file *file)
        return single_open(file, pgctrl_show, PDE(inode)->data);
 }
 
-static struct file_operations pktgen_fops = {
+static const struct file_operations pktgen_fops = {
        .owner   = THIS_MODULE,
        .open    = pgctrl_open,
        .read    = seq_read,
@@ -1672,7 +1672,7 @@ static int pktgen_if_open(struct inode *inode, struct file *file)
        return single_open(file, pktgen_if_show, PDE(inode)->data);
 }
 
-static struct file_operations pktgen_if_fops = {
+static const struct file_operations pktgen_if_fops = {
        .owner   = THIS_MODULE,
        .open    = pktgen_if_open,
        .read    = seq_read,
@@ -1815,7 +1815,7 @@ static int pktgen_thread_open(struct inode *inode, struct file *file)
        return single_open(file, pktgen_thread_show, PDE(inode)->data);
 }
 
-static struct file_operations pktgen_thread_fops = {
+static const struct file_operations pktgen_thread_fops = {
        .owner   = THIS_MODULE,
        .open    = pktgen_thread_open,
        .read    = seq_read,
index 1e35d9973f570c1835a1ecef395b69804dcc3f2f..e9986acdd0ab0920f5283801484619926907542f 100644 (file)
@@ -1911,7 +1911,7 @@ static int proto_seq_open(struct inode *inode, struct file *file)
        return seq_open(file, &proto_seq_ops);
 }
 
-static struct file_operations proto_seq_fops = {
+static const struct file_operations proto_seq_fops = {
        .owner          = THIS_MODULE,
        .open           = proto_seq_open,
        .read           = seq_read,
index 64017d47b25b8808d8f47977bf36012b44c1d4d1..9936ab11e6e01e1158eb0b2c2e9ec1e148c0843a 100644 (file)
@@ -674,7 +674,7 @@ static int wireless_seq_open(struct inode *inode, struct file *file)
        return seq_open(file, &wireless_seq_ops);
 }
 
-static struct file_operations wireless_seq_fops = {
+static const struct file_operations wireless_seq_fops = {
        .owner   = THIS_MODULE,
        .open    = wireless_seq_open,
        .read    = seq_read,
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc net/ipv4/arp.c
Simple merge
Simple merge
Simple merge
diff --cc net/ipv4/igmp.c
Simple merge
Simple merge
diff --cc net/ipv4/ipmr.c
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc net/ipv4/proc.c
Simple merge
diff --cc net/ipv4/raw.c
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc net/ipv6/proc.c
Simple merge
diff --cc net/ipv6/raw.c
Simple merge
Simple merge
Simple merge
Simple merge