aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block
diff options
context:
space:
mode:
authorArjan van de Ven <arjan@linux.intel.com>2007-02-12 03:55:32 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-12 12:48:45 -0500
commit2b8693c0617e972fc0b2fd1ebf8de97e15b656c3 (patch)
tree3eb7dfbc8d5e4031e4992bdd566e211f5ada71f3 /drivers/block
parent5dfe4c964a0dd7bb3a1d64a4166835a153146207 (diff)
[PATCH] mark struct file_operations const 3
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 'drivers/block')
-rw-r--r--drivers/block/DAC960.c2
-rw-r--r--drivers/block/acsi_slm.c2
-rw-r--r--drivers/block/aoe/aoechr.c2
-rw-r--r--drivers/block/paride/pg.c2
-rw-r--r--drivers/block/paride/pt.c2
-rw-r--r--drivers/block/pktcdvd.c6
6 files changed, 8 insertions, 8 deletions
diff --git a/drivers/block/DAC960.c b/drivers/block/DAC960.c
index 7b2fa3d8f61c..92bf868ca056 100644
--- a/drivers/block/DAC960.c
+++ b/drivers/block/DAC960.c
@@ -7024,7 +7024,7 @@ static int DAC960_gam_ioctl(struct inode *inode, struct file *file,
7024 return -EINVAL; 7024 return -EINVAL;
7025} 7025}
7026 7026
7027static struct file_operations DAC960_gam_fops = { 7027static const struct file_operations DAC960_gam_fops = {
7028 .owner = THIS_MODULE, 7028 .owner = THIS_MODULE,
7029 .ioctl = DAC960_gam_ioctl 7029 .ioctl = DAC960_gam_ioctl
7030}; 7030};
diff --git a/drivers/block/acsi_slm.c b/drivers/block/acsi_slm.c
index e04be94d195c..e2e043290963 100644
--- a/drivers/block/acsi_slm.c
+++ b/drivers/block/acsi_slm.c
@@ -269,7 +269,7 @@ static int slm_get_pagesize( int device, int *w, int *h );
269 269
270static DEFINE_TIMER(slm_timer, slm_test_ready, 0, 0); 270static DEFINE_TIMER(slm_timer, slm_test_ready, 0, 0);
271 271
272static struct file_operations slm_fops = { 272static const struct file_operations slm_fops = {
273 .owner = THIS_MODULE, 273 .owner = THIS_MODULE,
274 .read = slm_read, 274 .read = slm_read,
275 .write = slm_write, 275 .write = slm_write,
diff --git a/drivers/block/aoe/aoechr.c b/drivers/block/aoe/aoechr.c
index e22b4c9520a9..39e563ea0878 100644
--- a/drivers/block/aoe/aoechr.c
+++ b/drivers/block/aoe/aoechr.c
@@ -233,7 +233,7 @@ loop:
233 } 233 }
234} 234}
235 235
236static struct file_operations aoe_fops = { 236static const struct file_operations aoe_fops = {
237 .write = aoechr_write, 237 .write = aoechr_write,
238 .read = aoechr_read, 238 .read = aoechr_read,
239 .open = aoechr_open, 239 .open = aoechr_open,
diff --git a/drivers/block/paride/pg.c b/drivers/block/paride/pg.c
index 9970aedbb5d9..d89e7d32a3b6 100644
--- a/drivers/block/paride/pg.c
+++ b/drivers/block/paride/pg.c
@@ -227,7 +227,7 @@ static struct class *pg_class;
227 227
228/* kernel glue structures */ 228/* kernel glue structures */
229 229
230static struct file_operations pg_fops = { 230static const struct file_operations pg_fops = {
231 .owner = THIS_MODULE, 231 .owner = THIS_MODULE,
232 .read = pg_read, 232 .read = pg_read,
233 .write = pg_write, 233 .write = pg_write,
diff --git a/drivers/block/paride/pt.c b/drivers/block/paride/pt.c
index c902b25e4869..9f4e67ee1eb0 100644
--- a/drivers/block/paride/pt.c
+++ b/drivers/block/paride/pt.c
@@ -232,7 +232,7 @@ static char pt_scratch[512]; /* scratch block buffer */
232 232
233/* kernel glue structures */ 233/* kernel glue structures */
234 234
235static struct file_operations pt_fops = { 235static const struct file_operations pt_fops = {
236 .owner = THIS_MODULE, 236 .owner = THIS_MODULE,
237 .read = pt_read, 237 .read = pt_read,
238 .write = pt_write, 238 .write = pt_write,
diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c
index c0e89490e3d5..93fb6ed4ed52 100644
--- a/drivers/block/pktcdvd.c
+++ b/drivers/block/pktcdvd.c
@@ -435,7 +435,7 @@ static int pkt_debugfs_fops_open(struct inode *inode, struct file *file)
435 return single_open(file, pkt_debugfs_seq_show, inode->i_private); 435 return single_open(file, pkt_debugfs_seq_show, inode->i_private);
436} 436}
437 437
438static struct file_operations debug_fops = { 438static const struct file_operations debug_fops = {
439 .open = pkt_debugfs_fops_open, 439 .open = pkt_debugfs_fops_open,
440 .read = seq_read, 440 .read = seq_read,
441 .llseek = seq_lseek, 441 .llseek = seq_lseek,
@@ -2725,7 +2725,7 @@ static int pkt_seq_open(struct inode *inode, struct file *file)
2725 return single_open(file, pkt_seq_show, PDE(inode)->data); 2725 return single_open(file, pkt_seq_show, PDE(inode)->data);
2726} 2726}
2727 2727
2728static struct file_operations pkt_proc_fops = { 2728static const struct file_operations pkt_proc_fops = {
2729 .open = pkt_seq_open, 2729 .open = pkt_seq_open,
2730 .read = seq_read, 2730 .read = seq_read,
2731 .llseek = seq_lseek, 2731 .llseek = seq_lseek,
@@ -3052,7 +3052,7 @@ static int pkt_ctl_ioctl(struct inode *inode, struct file *file, unsigned int cm
3052} 3052}
3053 3053
3054 3054
3055static struct file_operations pkt_ctl_fops = { 3055static const struct file_operations pkt_ctl_fops = {
3056 .ioctl = pkt_ctl_ioctl, 3056 .ioctl = pkt_ctl_ioctl,
3057 .owner = THIS_MODULE, 3057 .owner = THIS_MODULE,
3058}; 3058};