aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc/cache.c
diff options
context:
space:
mode:
authorArjan van de Ven <arjan@linux.intel.com>2007-02-12 03:55:36 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-12 12:48:46 -0500
commitda7071d7e32d15149cc513f096a3638097b66387 (patch)
treef56fb200090ad55b2e2a72c379b1eeea29795670 /net/sunrpc/cache.c
parent9a32144e9d7b4e21341174b1a83b82a82353be86 (diff)
[PATCH] mark struct file_operations const 8
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/sunrpc/cache.c')
-rw-r--r--net/sunrpc/cache.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/net/sunrpc/cache.c b/net/sunrpc/cache.c
index c80df455802d..8612044b9189 100644
--- a/net/sunrpc/cache.c
+++ b/net/sunrpc/cache.c
@@ -282,9 +282,9 @@ static DEFINE_SPINLOCK(cache_list_lock);
282static struct cache_detail *current_detail; 282static struct cache_detail *current_detail;
283static int current_index; 283static int current_index;
284 284
285static struct file_operations cache_file_operations; 285static const struct file_operations cache_file_operations;
286static struct file_operations content_file_operations; 286static const struct file_operations content_file_operations;
287static struct file_operations cache_flush_operations; 287static const struct file_operations cache_flush_operations;
288 288
289static void do_cache_clean(struct work_struct *work); 289static void do_cache_clean(struct work_struct *work);
290static DECLARE_DELAYED_WORK(cache_cleaner, do_cache_clean); 290static DECLARE_DELAYED_WORK(cache_cleaner, do_cache_clean);
@@ -887,7 +887,7 @@ cache_release(struct inode *inode, struct file *filp)
887 887
888 888
889 889
890static struct file_operations cache_file_operations = { 890static const struct file_operations cache_file_operations = {
891 .owner = THIS_MODULE, 891 .owner = THIS_MODULE,
892 .llseek = no_llseek, 892 .llseek = no_llseek,
893 .read = cache_read, 893 .read = cache_read,
@@ -1245,7 +1245,7 @@ static int content_release(struct inode *inode, struct file *file)
1245 return seq_release(inode, file); 1245 return seq_release(inode, file);
1246} 1246}
1247 1247
1248static struct file_operations content_file_operations = { 1248static const struct file_operations content_file_operations = {
1249 .open = content_open, 1249 .open = content_open,
1250 .read = seq_read, 1250 .read = seq_read,
1251 .llseek = seq_lseek, 1251 .llseek = seq_lseek,
@@ -1297,7 +1297,7 @@ static ssize_t write_flush(struct file * file, const char __user * buf,
1297 return count; 1297 return count;
1298} 1298}
1299 1299
1300static struct file_operations cache_flush_operations = { 1300static const struct file_operations cache_flush_operations = {
1301 .open = nonseekable_open, 1301 .open = nonseekable_open,
1302 .read = read_flush, 1302 .read = read_flush,
1303 .write = write_flush, 1303 .write = write_flush,