diff options
author | Arjan van de Ven <arjan@infradead.org> | 2006-03-28 04:56:42 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-28 12:16:06 -0500 |
commit | 4b6f5d20b04dcbc3d888555522b90ba6d36c4106 (patch) | |
tree | 420f271eaef7d3def7d4433b151c3cb6d7a54770 /fs | |
parent | 99ac48f54a91d02140c497edc31dc57d4bc5c85d (diff) |
[PATCH] Make most file operations structs in fs/ const
This is a conversion to make the various file_operations structs in fs/
const. Basically a regexp job, with a few manual fixups
The goal is both to increase correctness (harder to accidentally write to
shared datastructures) and reducing the false sharing of cachelines with
things that get dirty in .data (while .rodata is nicely read only and thus
cache clean)
Signed-off-by: Arjan van de Ven <arjan@infradead.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs')
122 files changed, 188 insertions, 188 deletions
diff --git a/fs/9p/v9fs_vfs.h b/fs/9p/v9fs_vfs.h index 43c9f7de0314..f867b8d3e973 100644 --- a/fs/9p/v9fs_vfs.h +++ b/fs/9p/v9fs_vfs.h | |||
@@ -39,8 +39,8 @@ | |||
39 | 39 | ||
40 | extern struct file_system_type v9fs_fs_type; | 40 | extern struct file_system_type v9fs_fs_type; |
41 | extern struct address_space_operations v9fs_addr_operations; | 41 | extern struct address_space_operations v9fs_addr_operations; |
42 | extern struct file_operations v9fs_file_operations; | 42 | extern const struct file_operations v9fs_file_operations; |
43 | extern struct file_operations v9fs_dir_operations; | 43 | extern const struct file_operations v9fs_dir_operations; |
44 | extern struct dentry_operations v9fs_dentry_operations; | 44 | extern struct dentry_operations v9fs_dentry_operations; |
45 | 45 | ||
46 | struct inode *v9fs_get_inode(struct super_block *sb, int mode); | 46 | struct inode *v9fs_get_inode(struct super_block *sb, int mode); |
diff --git a/fs/9p/vfs_dir.c b/fs/9p/vfs_dir.c index 766f11f1215c..e32d5971039b 100644 --- a/fs/9p/vfs_dir.c +++ b/fs/9p/vfs_dir.c | |||
@@ -204,7 +204,7 @@ int v9fs_dir_release(struct inode *inode, struct file *filp) | |||
204 | return 0; | 204 | return 0; |
205 | } | 205 | } |
206 | 206 | ||
207 | struct file_operations v9fs_dir_operations = { | 207 | const struct file_operations v9fs_dir_operations = { |
208 | .read = generic_read_dir, | 208 | .read = generic_read_dir, |
209 | .readdir = v9fs_dir_readdir, | 209 | .readdir = v9fs_dir_readdir, |
210 | .open = v9fs_file_open, | 210 | .open = v9fs_file_open, |
diff --git a/fs/9p/vfs_file.c b/fs/9p/vfs_file.c index 59e744163407..083dcfcd158e 100644 --- a/fs/9p/vfs_file.c +++ b/fs/9p/vfs_file.c | |||
@@ -266,7 +266,7 @@ v9fs_file_write(struct file *filp, const char __user * data, | |||
266 | return total; | 266 | return total; |
267 | } | 267 | } |
268 | 268 | ||
269 | struct file_operations v9fs_file_operations = { | 269 | const struct file_operations v9fs_file_operations = { |
270 | .llseek = generic_file_llseek, | 270 | .llseek = generic_file_llseek, |
271 | .read = v9fs_file_read, | 271 | .read = v9fs_file_read, |
272 | .write = v9fs_file_write, | 272 | .write = v9fs_file_write, |
diff --git a/fs/adfs/adfs.h b/fs/adfs/adfs.h index f6cd01352cc8..29217ff36d44 100644 --- a/fs/adfs/adfs.h +++ b/fs/adfs/adfs.h | |||
@@ -85,7 +85,7 @@ void __adfs_error(struct super_block *sb, const char *function, | |||
85 | 85 | ||
86 | /* dir_*.c */ | 86 | /* dir_*.c */ |
87 | extern struct inode_operations adfs_dir_inode_operations; | 87 | extern struct inode_operations adfs_dir_inode_operations; |
88 | extern struct file_operations adfs_dir_operations; | 88 | extern const struct file_operations adfs_dir_operations; |
89 | extern struct dentry_operations adfs_dentry_operations; | 89 | extern struct dentry_operations adfs_dentry_operations; |
90 | extern struct adfs_dir_ops adfs_f_dir_ops; | 90 | extern struct adfs_dir_ops adfs_f_dir_ops; |
91 | extern struct adfs_dir_ops adfs_fplus_dir_ops; | 91 | extern struct adfs_dir_ops adfs_fplus_dir_ops; |
@@ -94,7 +94,7 @@ extern int adfs_dir_update(struct super_block *sb, struct object_info *obj); | |||
94 | 94 | ||
95 | /* file.c */ | 95 | /* file.c */ |
96 | extern struct inode_operations adfs_file_inode_operations; | 96 | extern struct inode_operations adfs_file_inode_operations; |
97 | extern struct file_operations adfs_file_operations; | 97 | extern const struct file_operations adfs_file_operations; |
98 | 98 | ||
99 | static inline __u32 signed_asl(__u32 val, signed int shift) | 99 | static inline __u32 signed_asl(__u32 val, signed int shift) |
100 | { | 100 | { |
diff --git a/fs/adfs/dir.c b/fs/adfs/dir.c index 0b4c3a028076..7b075fc397da 100644 --- a/fs/adfs/dir.c +++ b/fs/adfs/dir.c | |||
@@ -196,7 +196,7 @@ out: | |||
196 | return ret; | 196 | return ret; |
197 | } | 197 | } |
198 | 198 | ||
199 | struct file_operations adfs_dir_operations = { | 199 | const struct file_operations adfs_dir_operations = { |
200 | .read = generic_read_dir, | 200 | .read = generic_read_dir, |
201 | .readdir = adfs_readdir, | 201 | .readdir = adfs_readdir, |
202 | .fsync = file_fsync, | 202 | .fsync = file_fsync, |
diff --git a/fs/adfs/file.c b/fs/adfs/file.c index 6af10885f9d6..1014b9f2117b 100644 --- a/fs/adfs/file.c +++ b/fs/adfs/file.c | |||
@@ -25,7 +25,7 @@ | |||
25 | 25 | ||
26 | #include "adfs.h" | 26 | #include "adfs.h" |
27 | 27 | ||
28 | struct file_operations adfs_file_operations = { | 28 | const struct file_operations adfs_file_operations = { |
29 | .llseek = generic_file_llseek, | 29 | .llseek = generic_file_llseek, |
30 | .read = generic_file_read, | 30 | .read = generic_file_read, |
31 | .mmap = generic_file_mmap, | 31 | .mmap = generic_file_mmap, |
diff --git a/fs/affs/affs.h b/fs/affs/affs.h index 0c6799f2137a..a43a876742b8 100644 --- a/fs/affs/affs.h +++ b/fs/affs/affs.h | |||
@@ -192,9 +192,9 @@ extern void affs_dir_truncate(struct inode *); | |||
192 | extern struct inode_operations affs_file_inode_operations; | 192 | extern struct inode_operations affs_file_inode_operations; |
193 | extern struct inode_operations affs_dir_inode_operations; | 193 | extern struct inode_operations affs_dir_inode_operations; |
194 | extern struct inode_operations affs_symlink_inode_operations; | 194 | extern struct inode_operations affs_symlink_inode_operations; |
195 | extern struct file_operations affs_file_operations; | 195 | extern const struct file_operations affs_file_operations; |
196 | extern struct file_operations affs_file_operations_ofs; | 196 | extern const struct file_operations affs_file_operations_ofs; |
197 | extern struct file_operations affs_dir_operations; | 197 | extern const struct file_operations affs_dir_operations; |
198 | extern struct address_space_operations affs_symlink_aops; | 198 | extern struct address_space_operations affs_symlink_aops; |
199 | extern struct address_space_operations affs_aops; | 199 | extern struct address_space_operations affs_aops; |
200 | extern struct address_space_operations affs_aops_ofs; | 200 | extern struct address_space_operations affs_aops_ofs; |
diff --git a/fs/affs/dir.c b/fs/affs/dir.c index 548efd0ee98c..5d9649fa1814 100644 --- a/fs/affs/dir.c +++ b/fs/affs/dir.c | |||
@@ -17,7 +17,7 @@ | |||
17 | 17 | ||
18 | static int affs_readdir(struct file *, void *, filldir_t); | 18 | static int affs_readdir(struct file *, void *, filldir_t); |
19 | 19 | ||
20 | struct file_operations affs_dir_operations = { | 20 | const struct file_operations affs_dir_operations = { |
21 | .read = generic_read_dir, | 21 | .read = generic_read_dir, |
22 | .readdir = affs_readdir, | 22 | .readdir = affs_readdir, |
23 | .fsync = file_fsync, | 23 | .fsync = file_fsync, |
diff --git a/fs/affs/file.c b/fs/affs/file.c index f72fb776ecdf..7076262af39b 100644 --- a/fs/affs/file.c +++ b/fs/affs/file.c | |||
@@ -25,7 +25,7 @@ static struct buffer_head *affs_get_extblock_slow(struct inode *inode, u32 ext); | |||
25 | static int affs_file_open(struct inode *inode, struct file *filp); | 25 | static int affs_file_open(struct inode *inode, struct file *filp); |
26 | static int affs_file_release(struct inode *inode, struct file *filp); | 26 | static int affs_file_release(struct inode *inode, struct file *filp); |
27 | 27 | ||
28 | struct file_operations affs_file_operations = { | 28 | const struct file_operations affs_file_operations = { |
29 | .llseek = generic_file_llseek, | 29 | .llseek = generic_file_llseek, |
30 | .read = generic_file_read, | 30 | .read = generic_file_read, |
31 | .write = generic_file_write, | 31 | .write = generic_file_write, |
diff --git a/fs/afs/dir.c b/fs/afs/dir.c index 5c61c24dab2a..a6dff6a4f204 100644 --- a/fs/afs/dir.c +++ b/fs/afs/dir.c | |||
@@ -32,7 +32,7 @@ static int afs_d_delete(struct dentry *dentry); | |||
32 | static int afs_dir_lookup_filldir(void *_cookie, const char *name, int nlen, | 32 | static int afs_dir_lookup_filldir(void *_cookie, const char *name, int nlen, |
33 | loff_t fpos, ino_t ino, unsigned dtype); | 33 | loff_t fpos, ino_t ino, unsigned dtype); |
34 | 34 | ||
35 | struct file_operations afs_dir_file_operations = { | 35 | const struct file_operations afs_dir_file_operations = { |
36 | .open = afs_dir_open, | 36 | .open = afs_dir_open, |
37 | .readdir = afs_dir_readdir, | 37 | .readdir = afs_dir_readdir, |
38 | }; | 38 | }; |
diff --git a/fs/afs/internal.h b/fs/afs/internal.h index ab8f87c66319..72febdf9a35a 100644 --- a/fs/afs/internal.h +++ b/fs/afs/internal.h | |||
@@ -64,7 +64,7 @@ extern struct cachefs_index_def afs_cache_cell_index_def; | |||
64 | * dir.c | 64 | * dir.c |
65 | */ | 65 | */ |
66 | extern struct inode_operations afs_dir_inode_operations; | 66 | extern struct inode_operations afs_dir_inode_operations; |
67 | extern struct file_operations afs_dir_file_operations; | 67 | extern const struct file_operations afs_dir_file_operations; |
68 | 68 | ||
69 | /* | 69 | /* |
70 | * file.c | 70 | * file.c |
@@ -105,7 +105,7 @@ extern struct cachefs_netfs afs_cache_netfs; | |||
105 | * mntpt.c | 105 | * mntpt.c |
106 | */ | 106 | */ |
107 | extern struct inode_operations afs_mntpt_inode_operations; | 107 | extern struct inode_operations afs_mntpt_inode_operations; |
108 | extern struct file_operations afs_mntpt_file_operations; | 108 | extern const struct file_operations afs_mntpt_file_operations; |
109 | extern struct afs_timer afs_mntpt_expiry_timer; | 109 | extern struct afs_timer afs_mntpt_expiry_timer; |
110 | extern struct afs_timer_ops afs_mntpt_expiry_timer_ops; | 110 | extern struct afs_timer_ops afs_mntpt_expiry_timer_ops; |
111 | extern unsigned long afs_mntpt_expiry_timeout; | 111 | extern unsigned long afs_mntpt_expiry_timeout; |
diff --git a/fs/afs/mntpt.c b/fs/afs/mntpt.c index 31ee06590de5..4e6eeb59b83c 100644 --- a/fs/afs/mntpt.c +++ b/fs/afs/mntpt.c | |||
@@ -32,7 +32,7 @@ static struct dentry *afs_mntpt_lookup(struct inode *dir, | |||
32 | static int afs_mntpt_open(struct inode *inode, struct file *file); | 32 | static int afs_mntpt_open(struct inode *inode, struct file *file); |
33 | static void *afs_mntpt_follow_link(struct dentry *dentry, struct nameidata *nd); | 33 | static void *afs_mntpt_follow_link(struct dentry *dentry, struct nameidata *nd); |
34 | 34 | ||
35 | struct file_operations afs_mntpt_file_operations = { | 35 | const struct file_operations afs_mntpt_file_operations = { |
36 | .open = afs_mntpt_open, | 36 | .open = afs_mntpt_open, |
37 | }; | 37 | }; |
38 | 38 | ||
diff --git a/fs/afs/proc.c b/fs/afs/proc.c index 9c81b8f7eef0..101d21b6c037 100644 --- a/fs/afs/proc.c +++ b/fs/afs/proc.c | |||
@@ -37,7 +37,7 @@ static struct seq_operations afs_proc_cells_ops = { | |||
37 | .show = afs_proc_cells_show, | 37 | .show = afs_proc_cells_show, |
38 | }; | 38 | }; |
39 | 39 | ||
40 | static struct file_operations afs_proc_cells_fops = { | 40 | static const struct file_operations afs_proc_cells_fops = { |
41 | .open = afs_proc_cells_open, | 41 | .open = afs_proc_cells_open, |
42 | .read = seq_read, | 42 | .read = seq_read, |
43 | .write = afs_proc_cells_write, | 43 | .write = afs_proc_cells_write, |
@@ -53,7 +53,7 @@ static ssize_t afs_proc_rootcell_write(struct file *file, | |||
53 | const char __user *buf, | 53 | const char __user *buf, |
54 | size_t size, loff_t *_pos); | 54 | size_t size, loff_t *_pos); |
55 | 55 | ||
56 | static struct file_operations afs_proc_rootcell_fops = { | 56 | static const struct file_operations afs_proc_rootcell_fops = { |
57 | .open = afs_proc_rootcell_open, | 57 | .open = afs_proc_rootcell_open, |
58 | .read = afs_proc_rootcell_read, | 58 | .read = afs_proc_rootcell_read, |
59 | .write = afs_proc_rootcell_write, | 59 | .write = afs_proc_rootcell_write, |
@@ -77,7 +77,7 @@ static struct seq_operations afs_proc_cell_volumes_ops = { | |||
77 | .show = afs_proc_cell_volumes_show, | 77 | .show = afs_proc_cell_volumes_show, |
78 | }; | 78 | }; |
79 | 79 | ||
80 | static struct file_operations afs_proc_cell_volumes_fops = { | 80 | static const struct file_operations afs_proc_cell_volumes_fops = { |
81 | .open = afs_proc_cell_volumes_open, | 81 | .open = afs_proc_cell_volumes_open, |
82 | .read = seq_read, | 82 | .read = seq_read, |
83 | .llseek = seq_lseek, | 83 | .llseek = seq_lseek, |
@@ -101,7 +101,7 @@ static struct seq_operations afs_proc_cell_vlservers_ops = { | |||
101 | .show = afs_proc_cell_vlservers_show, | 101 | .show = afs_proc_cell_vlservers_show, |
102 | }; | 102 | }; |
103 | 103 | ||
104 | static struct file_operations afs_proc_cell_vlservers_fops = { | 104 | static const struct file_operations afs_proc_cell_vlservers_fops = { |
105 | .open = afs_proc_cell_vlservers_open, | 105 | .open = afs_proc_cell_vlservers_open, |
106 | .read = seq_read, | 106 | .read = seq_read, |
107 | .llseek = seq_lseek, | 107 | .llseek = seq_lseek, |
@@ -124,7 +124,7 @@ static struct seq_operations afs_proc_cell_servers_ops = { | |||
124 | .show = afs_proc_cell_servers_show, | 124 | .show = afs_proc_cell_servers_show, |
125 | }; | 125 | }; |
126 | 126 | ||
127 | static struct file_operations afs_proc_cell_servers_fops = { | 127 | static const struct file_operations afs_proc_cell_servers_fops = { |
128 | .open = afs_proc_cell_servers_open, | 128 | .open = afs_proc_cell_servers_open, |
129 | .read = seq_read, | 129 | .read = seq_read, |
130 | .llseek = seq_lseek, | 130 | .llseek = seq_lseek, |
diff --git a/fs/autofs/autofs_i.h b/fs/autofs/autofs_i.h index 990c28da5aec..a62327f1bdff 100644 --- a/fs/autofs/autofs_i.h +++ b/fs/autofs/autofs_i.h | |||
@@ -146,7 +146,7 @@ struct autofs_dir_ent *autofs_expire(struct super_block *,struct autofs_sb_info | |||
146 | 146 | ||
147 | extern struct inode_operations autofs_root_inode_operations; | 147 | extern struct inode_operations autofs_root_inode_operations; |
148 | extern struct inode_operations autofs_symlink_inode_operations; | 148 | extern struct inode_operations autofs_symlink_inode_operations; |
149 | extern struct file_operations autofs_root_operations; | 149 | extern const struct file_operations autofs_root_operations; |
150 | 150 | ||
151 | /* Initializing function */ | 151 | /* Initializing function */ |
152 | 152 | ||
diff --git a/fs/autofs/root.c b/fs/autofs/root.c index 870e2cf33016..9cac08d6a873 100644 --- a/fs/autofs/root.c +++ b/fs/autofs/root.c | |||
@@ -26,7 +26,7 @@ static int autofs_root_rmdir(struct inode *,struct dentry *); | |||
26 | static int autofs_root_mkdir(struct inode *,struct dentry *,int); | 26 | static int autofs_root_mkdir(struct inode *,struct dentry *,int); |
27 | static int autofs_root_ioctl(struct inode *, struct file *,unsigned int,unsigned long); | 27 | static int autofs_root_ioctl(struct inode *, struct file *,unsigned int,unsigned long); |
28 | 28 | ||
29 | struct file_operations autofs_root_operations = { | 29 | const struct file_operations autofs_root_operations = { |
30 | .read = generic_read_dir, | 30 | .read = generic_read_dir, |
31 | .readdir = autofs_root_readdir, | 31 | .readdir = autofs_root_readdir, |
32 | .ioctl = autofs_root_ioctl, | 32 | .ioctl = autofs_root_ioctl, |
diff --git a/fs/autofs4/autofs_i.h b/fs/autofs4/autofs_i.h index c70204a61268..57c4903614e5 100644 --- a/fs/autofs4/autofs_i.h +++ b/fs/autofs4/autofs_i.h | |||
@@ -176,8 +176,8 @@ extern struct inode_operations autofs4_dir_inode_operations; | |||
176 | extern struct inode_operations autofs4_root_inode_operations; | 176 | extern struct inode_operations autofs4_root_inode_operations; |
177 | extern struct inode_operations autofs4_indirect_root_inode_operations; | 177 | extern struct inode_operations autofs4_indirect_root_inode_operations; |
178 | extern struct inode_operations autofs4_direct_root_inode_operations; | 178 | extern struct inode_operations autofs4_direct_root_inode_operations; |
179 | extern struct file_operations autofs4_dir_operations; | 179 | extern const struct file_operations autofs4_dir_operations; |
180 | extern struct file_operations autofs4_root_operations; | 180 | extern const struct file_operations autofs4_root_operations; |
181 | 181 | ||
182 | /* Initializing function */ | 182 | /* Initializing function */ |
183 | 183 | ||
diff --git a/fs/autofs4/root.c b/fs/autofs4/root.c index c8fe43a475e2..84e030c8ddd0 100644 --- a/fs/autofs4/root.c +++ b/fs/autofs4/root.c | |||
@@ -32,7 +32,7 @@ static int autofs4_root_readdir(struct file * filp, void * dirent, filldir_t fil | |||
32 | static struct dentry *autofs4_lookup(struct inode *,struct dentry *, struct nameidata *); | 32 | static struct dentry *autofs4_lookup(struct inode *,struct dentry *, struct nameidata *); |
33 | static void *autofs4_follow_link(struct dentry *, struct nameidata *); | 33 | static void *autofs4_follow_link(struct dentry *, struct nameidata *); |
34 | 34 | ||
35 | struct file_operations autofs4_root_operations = { | 35 | const struct file_operations autofs4_root_operations = { |
36 | .open = dcache_dir_open, | 36 | .open = dcache_dir_open, |
37 | .release = dcache_dir_close, | 37 | .release = dcache_dir_close, |
38 | .read = generic_read_dir, | 38 | .read = generic_read_dir, |
@@ -40,7 +40,7 @@ struct file_operations autofs4_root_operations = { | |||
40 | .ioctl = autofs4_root_ioctl, | 40 | .ioctl = autofs4_root_ioctl, |
41 | }; | 41 | }; |
42 | 42 | ||
43 | struct file_operations autofs4_dir_operations = { | 43 | const struct file_operations autofs4_dir_operations = { |
44 | .open = autofs4_dir_open, | 44 | .open = autofs4_dir_open, |
45 | .release = autofs4_dir_close, | 45 | .release = autofs4_dir_close, |
46 | .read = generic_read_dir, | 46 | .read = generic_read_dir, |
diff --git a/fs/bad_inode.c b/fs/bad_inode.c index e172180a1d8c..80599ae33966 100644 --- a/fs/bad_inode.c +++ b/fs/bad_inode.c | |||
@@ -22,7 +22,7 @@ static int return_EIO(void) | |||
22 | 22 | ||
23 | #define EIO_ERROR ((void *) (return_EIO)) | 23 | #define EIO_ERROR ((void *) (return_EIO)) |
24 | 24 | ||
25 | static struct file_operations bad_file_ops = | 25 | static const struct file_operations bad_file_ops = |
26 | { | 26 | { |
27 | .llseek = EIO_ERROR, | 27 | .llseek = EIO_ERROR, |
28 | .aio_read = EIO_ERROR, | 28 | .aio_read = EIO_ERROR, |
diff --git a/fs/befs/linuxvfs.c b/fs/befs/linuxvfs.c index 044a59587829..68ebd10f345d 100644 --- a/fs/befs/linuxvfs.c +++ b/fs/befs/linuxvfs.c | |||
@@ -64,7 +64,7 @@ static const struct super_operations befs_sops = { | |||
64 | /* slab cache for befs_inode_info objects */ | 64 | /* slab cache for befs_inode_info objects */ |
65 | static kmem_cache_t *befs_inode_cachep; | 65 | static kmem_cache_t *befs_inode_cachep; |
66 | 66 | ||
67 | static struct file_operations befs_dir_operations = { | 67 | static const struct file_operations befs_dir_operations = { |
68 | .read = generic_read_dir, | 68 | .read = generic_read_dir, |
69 | .readdir = befs_readdir, | 69 | .readdir = befs_readdir, |
70 | }; | 70 | }; |
diff --git a/fs/bfs/bfs.h b/fs/bfs/bfs.h index 1fbc53f14aba..9d791004b21c 100644 --- a/fs/bfs/bfs.h +++ b/fs/bfs/bfs.h | |||
@@ -49,11 +49,11 @@ static inline struct bfs_inode_info *BFS_I(struct inode *inode) | |||
49 | 49 | ||
50 | /* file.c */ | 50 | /* file.c */ |
51 | extern struct inode_operations bfs_file_inops; | 51 | extern struct inode_operations bfs_file_inops; |
52 | extern struct file_operations bfs_file_operations; | 52 | extern const struct file_operations bfs_file_operations; |
53 | extern struct address_space_operations bfs_aops; | 53 | extern struct address_space_operations bfs_aops; |
54 | 54 | ||
55 | /* dir.c */ | 55 | /* dir.c */ |
56 | extern struct inode_operations bfs_dir_inops; | 56 | extern struct inode_operations bfs_dir_inops; |
57 | extern struct file_operations bfs_dir_operations; | 57 | extern const struct file_operations bfs_dir_operations; |
58 | 58 | ||
59 | #endif /* _FS_BFS_BFS_H */ | 59 | #endif /* _FS_BFS_BFS_H */ |
diff --git a/fs/bfs/dir.c b/fs/bfs/dir.c index 5af928fa0449..26fad9621738 100644 --- a/fs/bfs/dir.c +++ b/fs/bfs/dir.c | |||
@@ -70,7 +70,7 @@ static int bfs_readdir(struct file * f, void * dirent, filldir_t filldir) | |||
70 | return 0; | 70 | return 0; |
71 | } | 71 | } |
72 | 72 | ||
73 | struct file_operations bfs_dir_operations = { | 73 | const struct file_operations bfs_dir_operations = { |
74 | .read = generic_read_dir, | 74 | .read = generic_read_dir, |
75 | .readdir = bfs_readdir, | 75 | .readdir = bfs_readdir, |
76 | .fsync = file_fsync, | 76 | .fsync = file_fsync, |
diff --git a/fs/bfs/file.c b/fs/bfs/file.c index 807723b65daf..d83cd74a2e4e 100644 --- a/fs/bfs/file.c +++ b/fs/bfs/file.c | |||
@@ -17,7 +17,7 @@ | |||
17 | #define dprintf(x...) | 17 | #define dprintf(x...) |
18 | #endif | 18 | #endif |
19 | 19 | ||
20 | struct file_operations bfs_file_operations = { | 20 | const struct file_operations bfs_file_operations = { |
21 | .llseek = generic_file_llseek, | 21 | .llseek = generic_file_llseek, |
22 | .read = generic_file_read, | 22 | .read = generic_file_read, |
23 | .write = generic_file_write, | 23 | .write = generic_file_write, |
diff --git a/fs/binfmt_misc.c b/fs/binfmt_misc.c index 6a7b730c206b..d73d75591a39 100644 --- a/fs/binfmt_misc.c +++ b/fs/binfmt_misc.c | |||
@@ -600,7 +600,7 @@ static ssize_t bm_entry_write(struct file *file, const char __user *buffer, | |||
600 | return count; | 600 | return count; |
601 | } | 601 | } |
602 | 602 | ||
603 | static struct file_operations bm_entry_operations = { | 603 | static const struct file_operations bm_entry_operations = { |
604 | .read = bm_entry_read, | 604 | .read = bm_entry_read, |
605 | .write = bm_entry_write, | 605 | .write = bm_entry_write, |
606 | }; | 606 | }; |
@@ -668,7 +668,7 @@ out: | |||
668 | return count; | 668 | return count; |
669 | } | 669 | } |
670 | 670 | ||
671 | static struct file_operations bm_register_operations = { | 671 | static const struct file_operations bm_register_operations = { |
672 | .write = bm_register_write, | 672 | .write = bm_register_write, |
673 | }; | 673 | }; |
674 | 674 | ||
@@ -715,7 +715,7 @@ static ssize_t bm_status_write(struct file * file, const char __user * buffer, | |||
715 | return count; | 715 | return count; |
716 | } | 716 | } |
717 | 717 | ||
718 | static struct file_operations bm_status_operations = { | 718 | static const struct file_operations bm_status_operations = { |
719 | .read = bm_status_read, | 719 | .read = bm_status_read, |
720 | .write = bm_status_write, | 720 | .write = bm_status_write, |
721 | }; | 721 | }; |
diff --git a/fs/block_dev.c b/fs/block_dev.c index 17c76182f389..af88c43043d5 100644 --- a/fs/block_dev.c +++ b/fs/block_dev.c | |||
@@ -1087,7 +1087,7 @@ struct address_space_operations def_blk_aops = { | |||
1087 | .direct_IO = blkdev_direct_IO, | 1087 | .direct_IO = blkdev_direct_IO, |
1088 | }; | 1088 | }; |
1089 | 1089 | ||
1090 | struct file_operations def_blk_fops = { | 1090 | const struct file_operations def_blk_fops = { |
1091 | .open = blkdev_open, | 1091 | .open = blkdev_open, |
1092 | .release = blkdev_close, | 1092 | .release = blkdev_close, |
1093 | .llseek = block_llseek, | 1093 | .llseek = block_llseek, |
diff --git a/fs/char_dev.c b/fs/char_dev.c index b53dffa46bac..4e1b849f912f 100644 --- a/fs/char_dev.c +++ b/fs/char_dev.c | |||
@@ -406,7 +406,7 @@ static void cdev_purge(struct cdev *cdev) | |||
406 | * is contain the open that then fills in the correct operations | 406 | * is contain the open that then fills in the correct operations |
407 | * depending on the special file... | 407 | * depending on the special file... |
408 | */ | 408 | */ |
409 | struct file_operations def_chr_fops = { | 409 | const struct file_operations def_chr_fops = { |
410 | .open = chrdev_open, | 410 | .open = chrdev_open, |
411 | }; | 411 | }; |
412 | 412 | ||
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c index 6b99b51d6694..4bbc544857bc 100644 --- a/fs/cifs/cifsfs.c +++ b/fs/cifs/cifsfs.c | |||
@@ -583,7 +583,7 @@ struct inode_operations cifs_symlink_inode_ops = { | |||
583 | #endif | 583 | #endif |
584 | }; | 584 | }; |
585 | 585 | ||
586 | struct file_operations cifs_file_ops = { | 586 | const struct file_operations cifs_file_ops = { |
587 | .read = do_sync_read, | 587 | .read = do_sync_read, |
588 | .write = do_sync_write, | 588 | .write = do_sync_write, |
589 | .readv = generic_file_readv, | 589 | .readv = generic_file_readv, |
@@ -607,7 +607,7 @@ struct file_operations cifs_file_ops = { | |||
607 | #endif /* CONFIG_CIFS_EXPERIMENTAL */ | 607 | #endif /* CONFIG_CIFS_EXPERIMENTAL */ |
608 | }; | 608 | }; |
609 | 609 | ||
610 | struct file_operations cifs_file_direct_ops = { | 610 | const struct file_operations cifs_file_direct_ops = { |
611 | /* no mmap, no aio, no readv - | 611 | /* no mmap, no aio, no readv - |
612 | BB reevaluate whether they can be done with directio, no cache */ | 612 | BB reevaluate whether they can be done with directio, no cache */ |
613 | .read = cifs_user_read, | 613 | .read = cifs_user_read, |
@@ -626,7 +626,7 @@ struct file_operations cifs_file_direct_ops = { | |||
626 | .dir_notify = cifs_dir_notify, | 626 | .dir_notify = cifs_dir_notify, |
627 | #endif /* CONFIG_CIFS_EXPERIMENTAL */ | 627 | #endif /* CONFIG_CIFS_EXPERIMENTAL */ |
628 | }; | 628 | }; |
629 | struct file_operations cifs_file_nobrl_ops = { | 629 | const struct file_operations cifs_file_nobrl_ops = { |
630 | .read = do_sync_read, | 630 | .read = do_sync_read, |
631 | .write = do_sync_write, | 631 | .write = do_sync_write, |
632 | .readv = generic_file_readv, | 632 | .readv = generic_file_readv, |
@@ -649,7 +649,7 @@ struct file_operations cifs_file_nobrl_ops = { | |||
649 | #endif /* CONFIG_CIFS_EXPERIMENTAL */ | 649 | #endif /* CONFIG_CIFS_EXPERIMENTAL */ |
650 | }; | 650 | }; |
651 | 651 | ||
652 | struct file_operations cifs_file_direct_nobrl_ops = { | 652 | const struct file_operations cifs_file_direct_nobrl_ops = { |
653 | /* no mmap, no aio, no readv - | 653 | /* no mmap, no aio, no readv - |
654 | BB reevaluate whether they can be done with directio, no cache */ | 654 | BB reevaluate whether they can be done with directio, no cache */ |
655 | .read = cifs_user_read, | 655 | .read = cifs_user_read, |
@@ -668,7 +668,7 @@ struct file_operations cifs_file_direct_nobrl_ops = { | |||
668 | #endif /* CONFIG_CIFS_EXPERIMENTAL */ | 668 | #endif /* CONFIG_CIFS_EXPERIMENTAL */ |
669 | }; | 669 | }; |
670 | 670 | ||
671 | struct file_operations cifs_dir_ops = { | 671 | const struct file_operations cifs_dir_ops = { |
672 | .readdir = cifs_readdir, | 672 | .readdir = cifs_readdir, |
673 | .release = cifs_closedir, | 673 | .release = cifs_closedir, |
674 | .read = generic_read_dir, | 674 | .read = generic_read_dir, |
diff --git a/fs/cifs/cifsfs.h b/fs/cifs/cifsfs.h index 821a8eb22559..74f405ae4da3 100644 --- a/fs/cifs/cifsfs.h +++ b/fs/cifs/cifsfs.h | |||
@@ -61,10 +61,10 @@ extern struct inode_operations cifs_file_inode_ops; | |||
61 | extern struct inode_operations cifs_symlink_inode_ops; | 61 | extern struct inode_operations cifs_symlink_inode_ops; |
62 | 62 | ||
63 | /* Functions related to files and directories */ | 63 | /* Functions related to files and directories */ |
64 | extern struct file_operations cifs_file_ops; | 64 | extern const struct file_operations cifs_file_ops; |
65 | extern struct file_operations cifs_file_direct_ops; /* if directio mount */ | 65 | extern const struct file_operations cifs_file_direct_ops; /* if directio mount */ |
66 | extern struct file_operations cifs_file_nobrl_ops; | 66 | extern const struct file_operations cifs_file_nobrl_ops; |
67 | extern struct file_operations cifs_file_direct_nobrl_ops; /* if directio mount */ | 67 | extern const struct file_operations cifs_file_direct_nobrl_ops; /* if directio mount */ |
68 | extern int cifs_open(struct inode *inode, struct file *file); | 68 | extern int cifs_open(struct inode *inode, struct file *file); |
69 | extern int cifs_close(struct inode *inode, struct file *file); | 69 | extern int cifs_close(struct inode *inode, struct file *file); |
70 | extern int cifs_closedir(struct inode *inode, struct file *file); | 70 | extern int cifs_closedir(struct inode *inode, struct file *file); |
@@ -76,7 +76,7 @@ extern int cifs_lock(struct file *, int, struct file_lock *); | |||
76 | extern int cifs_fsync(struct file *, struct dentry *, int); | 76 | extern int cifs_fsync(struct file *, struct dentry *, int); |
77 | extern int cifs_flush(struct file *); | 77 | extern int cifs_flush(struct file *); |
78 | extern int cifs_file_mmap(struct file * , struct vm_area_struct *); | 78 | extern int cifs_file_mmap(struct file * , struct vm_area_struct *); |
79 | extern struct file_operations cifs_dir_ops; | 79 | extern const struct file_operations cifs_dir_ops; |
80 | extern int cifs_dir_open(struct inode *inode, struct file *file); | 80 | extern int cifs_dir_open(struct inode *inode, struct file *file); |
81 | extern int cifs_readdir(struct file *file, void *direntry, filldir_t filldir); | 81 | extern int cifs_readdir(struct file *file, void *direntry, filldir_t filldir); |
82 | extern int cifs_dir_notify(struct file *, unsigned long arg); | 82 | extern int cifs_dir_notify(struct file *, unsigned long arg); |
diff --git a/fs/coda/dir.c b/fs/coda/dir.c index 54f76de8a686..71f2ea632e53 100644 --- a/fs/coda/dir.c +++ b/fs/coda/dir.c | |||
@@ -82,7 +82,7 @@ struct inode_operations coda_dir_inode_operations = | |||
82 | .setattr = coda_setattr, | 82 | .setattr = coda_setattr, |
83 | }; | 83 | }; |
84 | 84 | ||
85 | struct file_operations coda_dir_operations = { | 85 | const struct file_operations coda_dir_operations = { |
86 | .llseek = generic_file_llseek, | 86 | .llseek = generic_file_llseek, |
87 | .read = generic_read_dir, | 87 | .read = generic_read_dir, |
88 | .readdir = coda_readdir, | 88 | .readdir = coda_readdir, |
diff --git a/fs/coda/file.c b/fs/coda/file.c index 146a991d6eb5..7c2642431fa5 100644 --- a/fs/coda/file.c +++ b/fs/coda/file.c | |||
@@ -288,7 +288,7 @@ int coda_fsync(struct file *coda_file, struct dentry *coda_dentry, int datasync) | |||
288 | return err; | 288 | return err; |
289 | } | 289 | } |
290 | 290 | ||
291 | struct file_operations coda_file_operations = { | 291 | const struct file_operations coda_file_operations = { |
292 | .llseek = generic_file_llseek, | 292 | .llseek = generic_file_llseek, |
293 | .read = coda_file_read, | 293 | .read = coda_file_read, |
294 | .write = coda_file_write, | 294 | .write = coda_file_write, |
diff --git a/fs/coda/pioctl.c b/fs/coda/pioctl.c index 127714936c66..214822be87bd 100644 --- a/fs/coda/pioctl.c +++ b/fs/coda/pioctl.c | |||
@@ -36,7 +36,7 @@ struct inode_operations coda_ioctl_inode_operations = | |||
36 | .setattr = coda_setattr, | 36 | .setattr = coda_setattr, |
37 | }; | 37 | }; |
38 | 38 | ||
39 | struct file_operations coda_ioctl_operations = { | 39 | const struct file_operations coda_ioctl_operations = { |
40 | .owner = THIS_MODULE, | 40 | .owner = THIS_MODULE, |
41 | .ioctl = coda_pioctl, | 41 | .ioctl = coda_pioctl, |
42 | }; | 42 | }; |
diff --git a/fs/coda/psdev.c b/fs/coda/psdev.c index 98c74fe2e139..6c6771db36da 100644 --- a/fs/coda/psdev.c +++ b/fs/coda/psdev.c | |||
@@ -342,7 +342,7 @@ static int coda_psdev_release(struct inode * inode, struct file * file) | |||
342 | } | 342 | } |
343 | 343 | ||
344 | 344 | ||
345 | static struct file_operations coda_psdev_fops = { | 345 | static const struct file_operations coda_psdev_fops = { |
346 | .owner = THIS_MODULE, | 346 | .owner = THIS_MODULE, |
347 | .read = coda_psdev_read, | 347 | .read = coda_psdev_read, |
348 | .write = coda_psdev_write, | 348 | .write = coda_psdev_write, |
diff --git a/fs/configfs/configfs_internal.h b/fs/configfs/configfs_internal.h index f70e46951b37..3f4ff7a242b9 100644 --- a/fs/configfs/configfs_internal.h +++ b/fs/configfs/configfs_internal.h | |||
@@ -72,9 +72,9 @@ extern void configfs_release_fs(void); | |||
72 | 72 | ||
73 | extern struct rw_semaphore configfs_rename_sem; | 73 | extern struct rw_semaphore configfs_rename_sem; |
74 | extern struct super_block * configfs_sb; | 74 | extern struct super_block * configfs_sb; |
75 | extern struct file_operations configfs_dir_operations; | 75 | extern const struct file_operations configfs_dir_operations; |
76 | extern struct file_operations configfs_file_operations; | 76 | extern const struct file_operations configfs_file_operations; |
77 | extern struct file_operations bin_fops; | 77 | extern const struct file_operations bin_fops; |
78 | extern struct inode_operations configfs_dir_inode_operations; | 78 | extern struct inode_operations configfs_dir_inode_operations; |
79 | extern struct inode_operations configfs_symlink_inode_operations; | 79 | extern struct inode_operations configfs_symlink_inode_operations; |
80 | 80 | ||
diff --git a/fs/configfs/dir.c b/fs/configfs/dir.c index ca60e3abef45..8ed9b06a9828 100644 --- a/fs/configfs/dir.c +++ b/fs/configfs/dir.c | |||
@@ -1027,7 +1027,7 @@ static loff_t configfs_dir_lseek(struct file * file, loff_t offset, int origin) | |||
1027 | return offset; | 1027 | return offset; |
1028 | } | 1028 | } |
1029 | 1029 | ||
1030 | struct file_operations configfs_dir_operations = { | 1030 | const struct file_operations configfs_dir_operations = { |
1031 | .open = configfs_dir_open, | 1031 | .open = configfs_dir_open, |
1032 | .release = configfs_dir_close, | 1032 | .release = configfs_dir_close, |
1033 | .llseek = configfs_dir_lseek, | 1033 | .llseek = configfs_dir_lseek, |
diff --git a/fs/configfs/file.c b/fs/configfs/file.c index 3921920d8716..f499803743e0 100644 --- a/fs/configfs/file.c +++ b/fs/configfs/file.c | |||
@@ -322,7 +322,7 @@ static int configfs_release(struct inode * inode, struct file * filp) | |||
322 | return 0; | 322 | return 0; |
323 | } | 323 | } |
324 | 324 | ||
325 | struct file_operations configfs_file_operations = { | 325 | const struct file_operations configfs_file_operations = { |
326 | .read = configfs_read_file, | 326 | .read = configfs_read_file, |
327 | .write = configfs_write_file, | 327 | .write = configfs_write_file, |
328 | .llseek = generic_file_llseek, | 328 | .llseek = generic_file_llseek, |
diff --git a/fs/cramfs/inode.c b/fs/cramfs/inode.c index acc1b2c10a86..9efcc3a164e8 100644 --- a/fs/cramfs/inode.c +++ b/fs/cramfs/inode.c | |||
@@ -29,7 +29,7 @@ | |||
29 | 29 | ||
30 | static struct super_operations cramfs_ops; | 30 | static struct super_operations cramfs_ops; |
31 | static struct inode_operations cramfs_dir_inode_operations; | 31 | static struct inode_operations cramfs_dir_inode_operations; |
32 | static struct file_operations cramfs_directory_operations; | 32 | static const struct file_operations cramfs_directory_operations; |
33 | static struct address_space_operations cramfs_aops; | 33 | static struct address_space_operations cramfs_aops; |
34 | 34 | ||
35 | static DEFINE_MUTEX(read_mutex); | 35 | static DEFINE_MUTEX(read_mutex); |
@@ -512,7 +512,7 @@ static struct address_space_operations cramfs_aops = { | |||
512 | /* | 512 | /* |
513 | * A directory can only readdir | 513 | * A directory can only readdir |
514 | */ | 514 | */ |
515 | static struct file_operations cramfs_directory_operations = { | 515 | static const struct file_operations cramfs_directory_operations = { |
516 | .llseek = generic_file_llseek, | 516 | .llseek = generic_file_llseek, |
517 | .read = generic_read_dir, | 517 | .read = generic_read_dir, |
518 | .readdir = cramfs_readdir, | 518 | .readdir = cramfs_readdir, |
diff --git a/fs/debugfs/file.c b/fs/debugfs/file.c index 40c4fc973fad..66a505422e5c 100644 --- a/fs/debugfs/file.c +++ b/fs/debugfs/file.c | |||
@@ -39,7 +39,7 @@ static int default_open(struct inode *inode, struct file *file) | |||
39 | return 0; | 39 | return 0; |
40 | } | 40 | } |
41 | 41 | ||
42 | struct file_operations debugfs_file_operations = { | 42 | const struct file_operations debugfs_file_operations = { |
43 | .read = default_read_file, | 43 | .read = default_read_file, |
44 | .write = default_write_file, | 44 | .write = default_write_file, |
45 | .open = default_open, | 45 | .open = default_open, |
@@ -213,7 +213,7 @@ static ssize_t write_file_bool(struct file *file, const char __user *user_buf, | |||
213 | return count; | 213 | return count; |
214 | } | 214 | } |
215 | 215 | ||
216 | static struct file_operations fops_bool = { | 216 | static const struct file_operations fops_bool = { |
217 | .read = read_file_bool, | 217 | .read = read_file_bool, |
218 | .write = write_file_bool, | 218 | .write = write_file_bool, |
219 | .open = default_open, | 219 | .open = default_open, |
diff --git a/fs/devfs/base.c b/fs/devfs/base.c index b621521e09d4..52f5059c4f31 100644 --- a/fs/devfs/base.c +++ b/fs/devfs/base.c | |||
@@ -856,14 +856,14 @@ static int devfsd_close(struct inode *inode, struct file *file); | |||
856 | #ifdef CONFIG_DEVFS_DEBUG | 856 | #ifdef CONFIG_DEVFS_DEBUG |
857 | static ssize_t stat_read(struct file *file, char __user *buf, size_t len, | 857 | static ssize_t stat_read(struct file *file, char __user *buf, size_t len, |
858 | loff_t * ppos); | 858 | loff_t * ppos); |
859 | static struct file_operations stat_fops = { | 859 | static const struct file_operations stat_fops = { |
860 | .open = nonseekable_open, | 860 | .open = nonseekable_open, |
861 | .read = stat_read, | 861 | .read = stat_read, |
862 | }; | 862 | }; |
863 | #endif | 863 | #endif |
864 | 864 | ||
865 | /* Devfs daemon file operations */ | 865 | /* Devfs daemon file operations */ |
866 | static struct file_operations devfsd_fops = { | 866 | static const struct file_operations devfsd_fops = { |
867 | .open = nonseekable_open, | 867 | .open = nonseekable_open, |
868 | .read = devfsd_read, | 868 | .read = devfsd_read, |
869 | .ioctl = devfsd_ioctl, | 869 | .ioctl = devfsd_ioctl, |
@@ -1842,8 +1842,8 @@ static int try_modload(struct devfs_entry *parent, struct fs_info *fs_info, | |||
1842 | 1842 | ||
1843 | static struct inode_operations devfs_iops; | 1843 | static struct inode_operations devfs_iops; |
1844 | static struct inode_operations devfs_dir_iops; | 1844 | static struct inode_operations devfs_dir_iops; |
1845 | static struct file_operations devfs_fops; | 1845 | static const struct file_operations devfs_fops; |
1846 | static struct file_operations devfs_dir_fops; | 1846 | static const struct file_operations devfs_dir_fops; |
1847 | static struct inode_operations devfs_symlink_iops; | 1847 | static struct inode_operations devfs_symlink_iops; |
1848 | 1848 | ||
1849 | static int devfs_notify_change(struct dentry *dentry, struct iattr *iattr) | 1849 | static int devfs_notify_change(struct dentry *dentry, struct iattr *iattr) |
@@ -2061,11 +2061,11 @@ static int devfs_open(struct inode *inode, struct file *file) | |||
2061 | return err; | 2061 | return err; |
2062 | } /* End Function devfs_open */ | 2062 | } /* End Function devfs_open */ |
2063 | 2063 | ||
2064 | static struct file_operations devfs_fops = { | 2064 | static const struct file_operations devfs_fops = { |
2065 | .open = devfs_open, | 2065 | .open = devfs_open, |
2066 | }; | 2066 | }; |
2067 | 2067 | ||
2068 | static struct file_operations devfs_dir_fops = { | 2068 | static const struct file_operations devfs_dir_fops = { |
2069 | .read = generic_read_dir, | 2069 | .read = generic_read_dir, |
2070 | .readdir = devfs_readdir, | 2070 | .readdir = devfs_readdir, |
2071 | }; | 2071 | }; |
diff --git a/fs/efs/dir.c b/fs/efs/dir.c index 777c614ff360..17f5b2d3c16a 100644 --- a/fs/efs/dir.c +++ b/fs/efs/dir.c | |||
@@ -10,7 +10,7 @@ | |||
10 | 10 | ||
11 | static int efs_readdir(struct file *, void *, filldir_t); | 11 | static int efs_readdir(struct file *, void *, filldir_t); |
12 | 12 | ||
13 | struct file_operations efs_dir_operations = { | 13 | const struct file_operations efs_dir_operations = { |
14 | .read = generic_read_dir, | 14 | .read = generic_read_dir, |
15 | .readdir = efs_readdir, | 15 | .readdir = efs_readdir, |
16 | }; | 16 | }; |
diff --git a/fs/eventpoll.c b/fs/eventpoll.c index e067a06c6464..242fe1a66ce5 100644 --- a/fs/eventpoll.c +++ b/fs/eventpoll.c | |||
@@ -290,7 +290,7 @@ static kmem_cache_t *pwq_cache __read_mostly; | |||
290 | static struct vfsmount *eventpoll_mnt __read_mostly; | 290 | static struct vfsmount *eventpoll_mnt __read_mostly; |
291 | 291 | ||
292 | /* File callbacks that implement the eventpoll file behaviour */ | 292 | /* File callbacks that implement the eventpoll file behaviour */ |
293 | static struct file_operations eventpoll_fops = { | 293 | static const struct file_operations eventpoll_fops = { |
294 | .release = ep_eventpoll_close, | 294 | .release = ep_eventpoll_close, |
295 | .poll = ep_eventpoll_poll | 295 | .poll = ep_eventpoll_poll |
296 | }; | 296 | }; |
diff --git a/fs/ext2/dir.c b/fs/ext2/dir.c index 0165388c425c..d672aa9f4061 100644 --- a/fs/ext2/dir.c +++ b/fs/ext2/dir.c | |||
@@ -658,7 +658,7 @@ not_empty: | |||
658 | return 0; | 658 | return 0; |
659 | } | 659 | } |
660 | 660 | ||
661 | struct file_operations ext2_dir_operations = { | 661 | const struct file_operations ext2_dir_operations = { |
662 | .llseek = generic_file_llseek, | 662 | .llseek = generic_file_llseek, |
663 | .read = generic_read_dir, | 663 | .read = generic_read_dir, |
664 | .readdir = ext2_readdir, | 664 | .readdir = ext2_readdir, |
diff --git a/fs/ext2/ext2.h b/fs/ext2/ext2.h index 11035ac7986f..9f74a62be555 100644 --- a/fs/ext2/ext2.h +++ b/fs/ext2/ext2.h | |||
@@ -154,12 +154,12 @@ extern void ext2_write_super (struct super_block *); | |||
154 | */ | 154 | */ |
155 | 155 | ||
156 | /* dir.c */ | 156 | /* dir.c */ |
157 | extern struct file_operations ext2_dir_operations; | 157 | extern const struct file_operations ext2_dir_operations; |
158 | 158 | ||
159 | /* file.c */ | 159 | /* file.c */ |
160 | extern struct inode_operations ext2_file_inode_operations; | 160 | extern struct inode_operations ext2_file_inode_operations; |
161 | extern struct file_operations ext2_file_operations; | 161 | extern const struct file_operations ext2_file_operations; |
162 | extern struct file_operations ext2_xip_file_operations; | 162 | extern const struct file_operations ext2_xip_file_operations; |
163 | 163 | ||
164 | /* inode.c */ | 164 | /* inode.c */ |
165 | extern struct address_space_operations ext2_aops; | 165 | extern struct address_space_operations ext2_aops; |
diff --git a/fs/ext2/file.c b/fs/ext2/file.c index a484412fc782..509cceca04db 100644 --- a/fs/ext2/file.c +++ b/fs/ext2/file.c | |||
@@ -39,7 +39,7 @@ static int ext2_release_file (struct inode * inode, struct file * filp) | |||
39 | * We have mostly NULL's here: the current defaults are ok for | 39 | * We have mostly NULL's here: the current defaults are ok for |
40 | * the ext2 filesystem. | 40 | * the ext2 filesystem. |
41 | */ | 41 | */ |
42 | struct file_operations ext2_file_operations = { | 42 | const struct file_operations ext2_file_operations = { |
43 | .llseek = generic_file_llseek, | 43 | .llseek = generic_file_llseek, |
44 | .read = generic_file_read, | 44 | .read = generic_file_read, |
45 | .write = generic_file_write, | 45 | .write = generic_file_write, |
@@ -56,7 +56,7 @@ struct file_operations ext2_file_operations = { | |||
56 | }; | 56 | }; |
57 | 57 | ||
58 | #ifdef CONFIG_EXT2_FS_XIP | 58 | #ifdef CONFIG_EXT2_FS_XIP |
59 | struct file_operations ext2_xip_file_operations = { | 59 | const struct file_operations ext2_xip_file_operations = { |
60 | .llseek = generic_file_llseek, | 60 | .llseek = generic_file_llseek, |
61 | .read = xip_file_read, | 61 | .read = xip_file_read, |
62 | .write = xip_file_write, | 62 | .write = xip_file_write, |
diff --git a/fs/ext3/dir.c b/fs/ext3/dir.c index 38bd3f6ec147..f37528ed222e 100644 --- a/fs/ext3/dir.c +++ b/fs/ext3/dir.c | |||
@@ -39,7 +39,7 @@ static int ext3_dx_readdir(struct file * filp, | |||
39 | static int ext3_release_dir (struct inode * inode, | 39 | static int ext3_release_dir (struct inode * inode, |
40 | struct file * filp); | 40 | struct file * filp); |
41 | 41 | ||
42 | struct file_operations ext3_dir_operations = { | 42 | const struct file_operations ext3_dir_operations = { |
43 | .llseek = generic_file_llseek, | 43 | .llseek = generic_file_llseek, |
44 | .read = generic_read_dir, | 44 | .read = generic_read_dir, |
45 | .readdir = ext3_readdir, /* we take BKL. needed?*/ | 45 | .readdir = ext3_readdir, /* we take BKL. needed?*/ |
diff --git a/fs/ext3/file.c b/fs/ext3/file.c index 59098ea56711..783a796220bb 100644 --- a/fs/ext3/file.c +++ b/fs/ext3/file.c | |||
@@ -105,7 +105,7 @@ force_commit: | |||
105 | return ret; | 105 | return ret; |
106 | } | 106 | } |
107 | 107 | ||
108 | struct file_operations ext3_file_operations = { | 108 | const struct file_operations ext3_file_operations = { |
109 | .llseek = generic_file_llseek, | 109 | .llseek = generic_file_llseek, |
110 | .read = do_sync_read, | 110 | .read = do_sync_read, |
111 | .write = do_sync_write, | 111 | .write = do_sync_write, |
diff --git a/fs/fat/dir.c b/fs/fat/dir.c index 4095bc149eb1..698b85bb1dd4 100644 --- a/fs/fat/dir.c +++ b/fs/fat/dir.c | |||
@@ -741,7 +741,7 @@ static int fat_dir_ioctl(struct inode * inode, struct file * filp, | |||
741 | return ret; | 741 | return ret; |
742 | } | 742 | } |
743 | 743 | ||
744 | struct file_operations fat_dir_operations = { | 744 | const struct file_operations fat_dir_operations = { |
745 | .read = generic_read_dir, | 745 | .read = generic_read_dir, |
746 | .readdir = fat_readdir, | 746 | .readdir = fat_readdir, |
747 | .ioctl = fat_dir_ioctl, | 747 | .ioctl = fat_dir_ioctl, |
diff --git a/fs/fat/file.c b/fs/fat/file.c index 88aa1ae13f9f..1ee25232e6af 100644 --- a/fs/fat/file.c +++ b/fs/fat/file.c | |||
@@ -112,7 +112,7 @@ int fat_generic_ioctl(struct inode *inode, struct file *filp, | |||
112 | } | 112 | } |
113 | } | 113 | } |
114 | 114 | ||
115 | struct file_operations fat_file_operations = { | 115 | const struct file_operations fat_file_operations = { |
116 | .llseek = generic_file_llseek, | 116 | .llseek = generic_file_llseek, |
117 | .read = do_sync_read, | 117 | .read = do_sync_read, |
118 | .write = do_sync_write, | 118 | .write = do_sync_write, |
@@ -145,6 +145,6 @@ err_nocleanup: | |||
145 | * is contain the open that then fills in the correct operations | 145 | * is contain the open that then fills in the correct operations |
146 | * depending on the access mode of the file... | 146 | * depending on the access mode of the file... |
147 | */ | 147 | */ |
148 | struct file_operations def_fifo_fops = { | 148 | const struct file_operations def_fifo_fops = { |
149 | .open = fifo_open, /* will set read or write pipe_fops */ | 149 | .open = fifo_open, /* will set read or write pipe_fops */ |
150 | }; | 150 | }; |
diff --git a/fs/freevxfs/vxfs_extern.h b/fs/freevxfs/vxfs_extern.h index 927acf70c591..1cf1fe8466a2 100644 --- a/fs/freevxfs/vxfs_extern.h +++ b/fs/freevxfs/vxfs_extern.h | |||
@@ -63,7 +63,7 @@ extern void vxfs_clear_inode(struct inode *); | |||
63 | 63 | ||
64 | /* vxfs_lookup.c */ | 64 | /* vxfs_lookup.c */ |
65 | extern struct inode_operations vxfs_dir_inode_ops; | 65 | extern struct inode_operations vxfs_dir_inode_ops; |
66 | extern struct file_operations vxfs_dir_operations; | 66 | extern const struct file_operations vxfs_dir_operations; |
67 | 67 | ||
68 | /* vxfs_olt.c */ | 68 | /* vxfs_olt.c */ |
69 | extern int vxfs_read_olt(struct super_block *, u_long); | 69 | extern int vxfs_read_olt(struct super_block *, u_long); |
diff --git a/fs/freevxfs/vxfs_lookup.c b/fs/freevxfs/vxfs_lookup.c index 554eb455722c..29cce456c7ce 100644 --- a/fs/freevxfs/vxfs_lookup.c +++ b/fs/freevxfs/vxfs_lookup.c | |||
@@ -56,7 +56,7 @@ struct inode_operations vxfs_dir_inode_ops = { | |||
56 | .lookup = vxfs_lookup, | 56 | .lookup = vxfs_lookup, |
57 | }; | 57 | }; |
58 | 58 | ||
59 | struct file_operations vxfs_dir_operations = { | 59 | const struct file_operations vxfs_dir_operations = { |
60 | .readdir = vxfs_readdir, | 60 | .readdir = vxfs_readdir, |
61 | }; | 61 | }; |
62 | 62 | ||
diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c index 0c9a2ee54c91..23d1f52eb1b8 100644 --- a/fs/fuse/dev.c +++ b/fs/fuse/dev.c | |||
@@ -922,7 +922,7 @@ static int fuse_dev_release(struct inode *inode, struct file *file) | |||
922 | return 0; | 922 | return 0; |
923 | } | 923 | } |
924 | 924 | ||
925 | struct file_operations fuse_dev_operations = { | 925 | const struct file_operations fuse_dev_operations = { |
926 | .owner = THIS_MODULE, | 926 | .owner = THIS_MODULE, |
927 | .llseek = no_llseek, | 927 | .llseek = no_llseek, |
928 | .read = fuse_dev_read, | 928 | .read = fuse_dev_read, |
diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c index c72a8a97935c..256355b80256 100644 --- a/fs/fuse/dir.c +++ b/fs/fuse/dir.c | |||
@@ -1170,7 +1170,7 @@ static struct inode_operations fuse_dir_inode_operations = { | |||
1170 | .removexattr = fuse_removexattr, | 1170 | .removexattr = fuse_removexattr, |
1171 | }; | 1171 | }; |
1172 | 1172 | ||
1173 | static struct file_operations fuse_dir_operations = { | 1173 | static const struct file_operations fuse_dir_operations = { |
1174 | .llseek = generic_file_llseek, | 1174 | .llseek = generic_file_llseek, |
1175 | .read = generic_read_dir, | 1175 | .read = generic_read_dir, |
1176 | .readdir = fuse_readdir, | 1176 | .readdir = fuse_readdir, |
diff --git a/fs/fuse/file.c b/fs/fuse/file.c index 6f05379b0a0d..975f2697e866 100644 --- a/fs/fuse/file.c +++ b/fs/fuse/file.c | |||
@@ -12,7 +12,7 @@ | |||
12 | #include <linux/slab.h> | 12 | #include <linux/slab.h> |
13 | #include <linux/kernel.h> | 13 | #include <linux/kernel.h> |
14 | 14 | ||
15 | static struct file_operations fuse_direct_io_file_operations; | 15 | static const struct file_operations fuse_direct_io_file_operations; |
16 | 16 | ||
17 | static int fuse_send_open(struct inode *inode, struct file *file, int isdir, | 17 | static int fuse_send_open(struct inode *inode, struct file *file, int isdir, |
18 | struct fuse_open_out *outargp) | 18 | struct fuse_open_out *outargp) |
@@ -611,7 +611,7 @@ static int fuse_set_page_dirty(struct page *page) | |||
611 | return 0; | 611 | return 0; |
612 | } | 612 | } |
613 | 613 | ||
614 | static struct file_operations fuse_file_operations = { | 614 | static const struct file_operations fuse_file_operations = { |
615 | .llseek = generic_file_llseek, | 615 | .llseek = generic_file_llseek, |
616 | .read = generic_file_read, | 616 | .read = generic_file_read, |
617 | .write = generic_file_write, | 617 | .write = generic_file_write, |
@@ -623,7 +623,7 @@ static struct file_operations fuse_file_operations = { | |||
623 | .sendfile = generic_file_sendfile, | 623 | .sendfile = generic_file_sendfile, |
624 | }; | 624 | }; |
625 | 625 | ||
626 | static struct file_operations fuse_direct_io_file_operations = { | 626 | static const struct file_operations fuse_direct_io_file_operations = { |
627 | .llseek = generic_file_llseek, | 627 | .llseek = generic_file_llseek, |
628 | .read = fuse_direct_read, | 628 | .read = fuse_direct_read, |
629 | .write = fuse_direct_write, | 629 | .write = fuse_direct_write, |
diff --git a/fs/fuse/fuse_i.h b/fs/fuse/fuse_i.h index 4a83adfec968..a16a04fcf41e 100644 --- a/fs/fuse/fuse_i.h +++ b/fs/fuse/fuse_i.h | |||
@@ -346,7 +346,7 @@ static inline u64 get_node_id(struct inode *inode) | |||
346 | } | 346 | } |
347 | 347 | ||
348 | /** Device operations */ | 348 | /** Device operations */ |
349 | extern struct file_operations fuse_dev_operations; | 349 | extern const struct file_operations fuse_dev_operations; |
350 | 350 | ||
351 | /** | 351 | /** |
352 | * This is the single global spinlock which protects FUSE's structures | 352 | * This is the single global spinlock which protects FUSE's structures |
diff --git a/fs/hfs/dir.c b/fs/hfs/dir.c index 534e5a7480ef..7cd8cc03aea7 100644 --- a/fs/hfs/dir.c +++ b/fs/hfs/dir.c | |||
@@ -313,7 +313,7 @@ static int hfs_rename(struct inode *old_dir, struct dentry *old_dentry, | |||
313 | return res; | 313 | return res; |
314 | } | 314 | } |
315 | 315 | ||
316 | struct file_operations hfs_dir_operations = { | 316 | const struct file_operations hfs_dir_operations = { |
317 | .read = generic_read_dir, | 317 | .read = generic_read_dir, |
318 | .readdir = hfs_readdir, | 318 | .readdir = hfs_readdir, |
319 | .llseek = generic_file_llseek, | 319 | .llseek = generic_file_llseek, |
diff --git a/fs/hfs/hfs_fs.h b/fs/hfs/hfs_fs.h index 18ce47ab1b71..3ed8663a8db1 100644 --- a/fs/hfs/hfs_fs.h +++ b/fs/hfs/hfs_fs.h | |||
@@ -169,7 +169,7 @@ extern int hfs_cat_move(u32, struct inode *, struct qstr *, | |||
169 | extern void hfs_cat_build_key(struct super_block *, btree_key *, u32, struct qstr *); | 169 | extern void hfs_cat_build_key(struct super_block *, btree_key *, u32, struct qstr *); |
170 | 170 | ||
171 | /* dir.c */ | 171 | /* dir.c */ |
172 | extern struct file_operations hfs_dir_operations; | 172 | extern const struct file_operations hfs_dir_operations; |
173 | extern struct inode_operations hfs_dir_inode_operations; | 173 | extern struct inode_operations hfs_dir_inode_operations; |
174 | 174 | ||
175 | /* extent.c */ | 175 | /* extent.c */ |
diff --git a/fs/hfs/inode.c b/fs/hfs/inode.c index 2c564701724f..2d4ced22201b 100644 --- a/fs/hfs/inode.c +++ b/fs/hfs/inode.c | |||
@@ -17,7 +17,7 @@ | |||
17 | #include "hfs_fs.h" | 17 | #include "hfs_fs.h" |
18 | #include "btree.h" | 18 | #include "btree.h" |
19 | 19 | ||
20 | static struct file_operations hfs_file_operations; | 20 | static const struct file_operations hfs_file_operations; |
21 | static struct inode_operations hfs_file_inode_operations; | 21 | static struct inode_operations hfs_file_inode_operations; |
22 | 22 | ||
23 | /*================ Variable-like macros ================*/ | 23 | /*================ Variable-like macros ================*/ |
@@ -601,7 +601,7 @@ int hfs_inode_setattr(struct dentry *dentry, struct iattr * attr) | |||
601 | } | 601 | } |
602 | 602 | ||
603 | 603 | ||
604 | static struct file_operations hfs_file_operations = { | 604 | static const struct file_operations hfs_file_operations = { |
605 | .llseek = generic_file_llseek, | 605 | .llseek = generic_file_llseek, |
606 | .read = generic_file_read, | 606 | .read = generic_file_read, |
607 | .write = generic_file_write, | 607 | .write = generic_file_write, |
diff --git a/fs/hfsplus/dir.c b/fs/hfsplus/dir.c index 01a6fe3a395c..1f9ece0de326 100644 --- a/fs/hfsplus/dir.c +++ b/fs/hfsplus/dir.c | |||
@@ -483,7 +483,7 @@ struct inode_operations hfsplus_dir_inode_operations = { | |||
483 | .rename = hfsplus_rename, | 483 | .rename = hfsplus_rename, |
484 | }; | 484 | }; |
485 | 485 | ||
486 | struct file_operations hfsplus_dir_operations = { | 486 | const struct file_operations hfsplus_dir_operations = { |
487 | .read = generic_read_dir, | 487 | .read = generic_read_dir, |
488 | .readdir = hfsplus_readdir, | 488 | .readdir = hfsplus_readdir, |
489 | .ioctl = hfsplus_ioctl, | 489 | .ioctl = hfsplus_ioctl, |
diff --git a/fs/hfsplus/inode.c b/fs/hfsplus/inode.c index 9fbe4d2aeece..acf66dba3e01 100644 --- a/fs/hfsplus/inode.c +++ b/fs/hfsplus/inode.c | |||
@@ -280,7 +280,7 @@ static struct inode_operations hfsplus_file_inode_operations = { | |||
280 | .listxattr = hfsplus_listxattr, | 280 | .listxattr = hfsplus_listxattr, |
281 | }; | 281 | }; |
282 | 282 | ||
283 | static struct file_operations hfsplus_file_operations = { | 283 | static const struct file_operations hfsplus_file_operations = { |
284 | .llseek = generic_file_llseek, | 284 | .llseek = generic_file_llseek, |
285 | .read = generic_file_read, | 285 | .read = generic_file_read, |
286 | .write = generic_file_write, | 286 | .write = generic_file_write, |
diff --git a/fs/hostfs/hostfs_kern.c b/fs/hostfs/hostfs_kern.c index b3ad0bd0312f..bf0f8e16e433 100644 --- a/fs/hostfs/hostfs_kern.c +++ b/fs/hostfs/hostfs_kern.c | |||
@@ -384,7 +384,7 @@ int hostfs_fsync(struct file *file, struct dentry *dentry, int datasync) | |||
384 | return fsync_file(HOSTFS_I(dentry->d_inode)->fd, datasync); | 384 | return fsync_file(HOSTFS_I(dentry->d_inode)->fd, datasync); |
385 | } | 385 | } |
386 | 386 | ||
387 | static struct file_operations hostfs_file_fops = { | 387 | static const struct file_operations hostfs_file_fops = { |
388 | .llseek = generic_file_llseek, | 388 | .llseek = generic_file_llseek, |
389 | .read = generic_file_read, | 389 | .read = generic_file_read, |
390 | .sendfile = generic_file_sendfile, | 390 | .sendfile = generic_file_sendfile, |
@@ -399,7 +399,7 @@ static struct file_operations hostfs_file_fops = { | |||
399 | .fsync = hostfs_fsync, | 399 | .fsync = hostfs_fsync, |
400 | }; | 400 | }; |
401 | 401 | ||
402 | static struct file_operations hostfs_dir_fops = { | 402 | static const struct file_operations hostfs_dir_fops = { |
403 | .llseek = generic_file_llseek, | 403 | .llseek = generic_file_llseek, |
404 | .readdir = hostfs_readdir, | 404 | .readdir = hostfs_readdir, |
405 | .read = generic_read_dir, | 405 | .read = generic_read_dir, |
diff --git a/fs/hpfs/dir.c b/fs/hpfs/dir.c index 5591f9623aa2..ecc9180645ae 100644 --- a/fs/hpfs/dir.c +++ b/fs/hpfs/dir.c | |||
@@ -310,7 +310,7 @@ struct dentry *hpfs_lookup(struct inode *dir, struct dentry *dentry, struct name | |||
310 | return ERR_PTR(-ENOENT); | 310 | return ERR_PTR(-ENOENT); |
311 | } | 311 | } |
312 | 312 | ||
313 | struct file_operations hpfs_dir_ops = | 313 | const struct file_operations hpfs_dir_ops = |
314 | { | 314 | { |
315 | .llseek = hpfs_dir_lseek, | 315 | .llseek = hpfs_dir_lseek, |
316 | .read = generic_read_dir, | 316 | .read = generic_read_dir, |
diff --git a/fs/hpfs/file.c b/fs/hpfs/file.c index 7c995ac4081b..d3b9fffe45a1 100644 --- a/fs/hpfs/file.c +++ b/fs/hpfs/file.c | |||
@@ -119,7 +119,7 @@ static ssize_t hpfs_file_write(struct file *file, const char __user *buf, | |||
119 | return retval; | 119 | return retval; |
120 | } | 120 | } |
121 | 121 | ||
122 | struct file_operations hpfs_file_ops = | 122 | const struct file_operations hpfs_file_ops = |
123 | { | 123 | { |
124 | .llseek = generic_file_llseek, | 124 | .llseek = generic_file_llseek, |
125 | .read = generic_file_read, | 125 | .read = generic_file_read, |
diff --git a/fs/hpfs/hpfs_fn.h b/fs/hpfs/hpfs_fn.h index 4c6473ab3b34..29b7a3e55173 100644 --- a/fs/hpfs/hpfs_fn.h +++ b/fs/hpfs/hpfs_fn.h | |||
@@ -240,7 +240,7 @@ void hpfs_set_dentry_operations(struct dentry *); | |||
240 | /* dir.c */ | 240 | /* dir.c */ |
241 | 241 | ||
242 | struct dentry *hpfs_lookup(struct inode *, struct dentry *, struct nameidata *); | 242 | struct dentry *hpfs_lookup(struct inode *, struct dentry *, struct nameidata *); |
243 | extern struct file_operations hpfs_dir_ops; | 243 | extern const struct file_operations hpfs_dir_ops; |
244 | 244 | ||
245 | /* dnode.c */ | 245 | /* dnode.c */ |
246 | 246 | ||
@@ -266,7 +266,7 @@ void hpfs_set_ea(struct inode *, struct fnode *, char *, char *, int); | |||
266 | /* file.c */ | 266 | /* file.c */ |
267 | 267 | ||
268 | int hpfs_file_fsync(struct file *, struct dentry *, int); | 268 | int hpfs_file_fsync(struct file *, struct dentry *, int); |
269 | extern struct file_operations hpfs_file_ops; | 269 | extern const struct file_operations hpfs_file_ops; |
270 | extern struct inode_operations hpfs_file_iops; | 270 | extern struct inode_operations hpfs_file_iops; |
271 | extern struct address_space_operations hpfs_aops; | 271 | extern struct address_space_operations hpfs_aops; |
272 | 272 | ||
diff --git a/fs/hppfs/hppfs_kern.c b/fs/hppfs/hppfs_kern.c index a44dc5897399..2ba20cdb5baa 100644 --- a/fs/hppfs/hppfs_kern.c +++ b/fs/hppfs/hppfs_kern.c | |||
@@ -558,7 +558,7 @@ static loff_t hppfs_llseek(struct file *file, loff_t off, int where) | |||
558 | return(default_llseek(file, off, where)); | 558 | return(default_llseek(file, off, where)); |
559 | } | 559 | } |
560 | 560 | ||
561 | static struct file_operations hppfs_file_fops = { | 561 | static const struct file_operations hppfs_file_fops = { |
562 | .owner = NULL, | 562 | .owner = NULL, |
563 | .llseek = hppfs_llseek, | 563 | .llseek = hppfs_llseek, |
564 | .read = hppfs_read, | 564 | .read = hppfs_read, |
@@ -609,7 +609,7 @@ static int hppfs_fsync(struct file *file, struct dentry *dentry, int datasync) | |||
609 | return(0); | 609 | return(0); |
610 | } | 610 | } |
611 | 611 | ||
612 | static struct file_operations hppfs_dir_fops = { | 612 | static const struct file_operations hppfs_dir_fops = { |
613 | .owner = NULL, | 613 | .owner = NULL, |
614 | .readdir = hppfs_readdir, | 614 | .readdir = hppfs_readdir, |
615 | .open = hppfs_dir_open, | 615 | .open = hppfs_dir_open, |
diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c index 25fa8bba8cb5..3a5b4e923455 100644 --- a/fs/hugetlbfs/inode.c +++ b/fs/hugetlbfs/inode.c | |||
@@ -35,7 +35,7 @@ | |||
35 | 35 | ||
36 | static struct super_operations hugetlbfs_ops; | 36 | static struct super_operations hugetlbfs_ops; |
37 | static struct address_space_operations hugetlbfs_aops; | 37 | static struct address_space_operations hugetlbfs_aops; |
38 | struct file_operations hugetlbfs_file_operations; | 38 | const struct file_operations hugetlbfs_file_operations; |
39 | static struct inode_operations hugetlbfs_dir_inode_operations; | 39 | static struct inode_operations hugetlbfs_dir_inode_operations; |
40 | static struct inode_operations hugetlbfs_inode_operations; | 40 | static struct inode_operations hugetlbfs_inode_operations; |
41 | 41 | ||
@@ -566,7 +566,7 @@ static void init_once(void *foo, kmem_cache_t *cachep, unsigned long flags) | |||
566 | inode_init_once(&ei->vfs_inode); | 566 | inode_init_once(&ei->vfs_inode); |
567 | } | 567 | } |
568 | 568 | ||
569 | struct file_operations hugetlbfs_file_operations = { | 569 | const struct file_operations hugetlbfs_file_operations = { |
570 | .mmap = hugetlbfs_file_mmap, | 570 | .mmap = hugetlbfs_file_mmap, |
571 | .fsync = simple_sync_file, | 571 | .fsync = simple_sync_file, |
572 | .get_unmapped_area = hugetlb_get_unmapped_area, | 572 | .get_unmapped_area = hugetlb_get_unmapped_area, |
diff --git a/fs/inotify.c b/fs/inotify.c index f48a3dae0712..367c487c014b 100644 --- a/fs/inotify.c +++ b/fs/inotify.c | |||
@@ -920,7 +920,7 @@ static long inotify_ioctl(struct file *file, unsigned int cmd, | |||
920 | return ret; | 920 | return ret; |
921 | } | 921 | } |
922 | 922 | ||
923 | static struct file_operations inotify_fops = { | 923 | static const struct file_operations inotify_fops = { |
924 | .poll = inotify_poll, | 924 | .poll = inotify_poll, |
925 | .read = inotify_read, | 925 | .read = inotify_read, |
926 | .release = inotify_release, | 926 | .release = inotify_release, |
diff --git a/fs/isofs/dir.c b/fs/isofs/dir.c index 7901ac9f97ab..5440ea292c69 100644 --- a/fs/isofs/dir.c +++ b/fs/isofs/dir.c | |||
@@ -16,7 +16,7 @@ | |||
16 | 16 | ||
17 | static int isofs_readdir(struct file *, void *, filldir_t); | 17 | static int isofs_readdir(struct file *, void *, filldir_t); |
18 | 18 | ||
19 | struct file_operations isofs_dir_operations = | 19 | const struct file_operations isofs_dir_operations = |
20 | { | 20 | { |
21 | .read = generic_read_dir, | 21 | .read = generic_read_dir, |
22 | .readdir = isofs_readdir, | 22 | .readdir = isofs_readdir, |
diff --git a/fs/isofs/isofs.h b/fs/isofs/isofs.h index 439a19b1bf3e..b87ba066f5e7 100644 --- a/fs/isofs/isofs.h +++ b/fs/isofs/isofs.h | |||
@@ -175,6 +175,6 @@ isofs_normalize_block_and_offset(struct iso_directory_record* de, | |||
175 | } | 175 | } |
176 | 176 | ||
177 | extern struct inode_operations isofs_dir_inode_operations; | 177 | extern struct inode_operations isofs_dir_inode_operations; |
178 | extern struct file_operations isofs_dir_operations; | 178 | extern const struct file_operations isofs_dir_operations; |
179 | extern struct address_space_operations isofs_symlink_aops; | 179 | extern struct address_space_operations isofs_symlink_aops; |
180 | extern struct export_operations isofs_export_ops; | 180 | extern struct export_operations isofs_export_ops; |
diff --git a/fs/jffs/inode-v23.c b/fs/jffs/inode-v23.c index 5a4519e834da..020cc097c539 100644 --- a/fs/jffs/inode-v23.c +++ b/fs/jffs/inode-v23.c | |||
@@ -55,9 +55,9 @@ | |||
55 | static int jffs_remove(struct inode *dir, struct dentry *dentry, int type); | 55 | static int jffs_remove(struct inode *dir, struct dentry *dentry, int type); |
56 | 56 | ||
57 | static struct super_operations jffs_ops; | 57 | static struct super_operations jffs_ops; |
58 | static struct file_operations jffs_file_operations; | 58 | static const struct file_operations jffs_file_operations; |
59 | static struct inode_operations jffs_file_inode_operations; | 59 | static struct inode_operations jffs_file_inode_operations; |
60 | static struct file_operations jffs_dir_operations; | 60 | static const struct file_operations jffs_dir_operations; |
61 | static struct inode_operations jffs_dir_inode_operations; | 61 | static struct inode_operations jffs_dir_inode_operations; |
62 | static struct address_space_operations jffs_address_operations; | 62 | static struct address_space_operations jffs_address_operations; |
63 | 63 | ||
@@ -1629,7 +1629,7 @@ static int jffs_fsync(struct file *f, struct dentry *d, int datasync) | |||
1629 | } | 1629 | } |
1630 | 1630 | ||
1631 | 1631 | ||
1632 | static struct file_operations jffs_file_operations = | 1632 | static const struct file_operations jffs_file_operations = |
1633 | { | 1633 | { |
1634 | .open = generic_file_open, | 1634 | .open = generic_file_open, |
1635 | .llseek = generic_file_llseek, | 1635 | .llseek = generic_file_llseek, |
@@ -1649,7 +1649,7 @@ static struct inode_operations jffs_file_inode_operations = | |||
1649 | }; | 1649 | }; |
1650 | 1650 | ||
1651 | 1651 | ||
1652 | static struct file_operations jffs_dir_operations = | 1652 | static const struct file_operations jffs_dir_operations = |
1653 | { | 1653 | { |
1654 | .readdir = jffs_readdir, | 1654 | .readdir = jffs_readdir, |
1655 | }; | 1655 | }; |
diff --git a/fs/jffs2/dir.c b/fs/jffs2/dir.c index a7bf9cb2567f..8bc7a5018e40 100644 --- a/fs/jffs2/dir.c +++ b/fs/jffs2/dir.c | |||
@@ -37,7 +37,7 @@ static int jffs2_mknod (struct inode *,struct dentry *,int,dev_t); | |||
37 | static int jffs2_rename (struct inode *, struct dentry *, | 37 | static int jffs2_rename (struct inode *, struct dentry *, |
38 | struct inode *, struct dentry *); | 38 | struct inode *, struct dentry *); |
39 | 39 | ||
40 | struct file_operations jffs2_dir_operations = | 40 | const struct file_operations jffs2_dir_operations = |
41 | { | 41 | { |
42 | .read = generic_read_dir, | 42 | .read = generic_read_dir, |
43 | .readdir = jffs2_readdir, | 43 | .readdir = jffs2_readdir, |
diff --git a/fs/jffs2/file.c b/fs/jffs2/file.c index 935f273dc57b..9f4171213e58 100644 --- a/fs/jffs2/file.c +++ b/fs/jffs2/file.c | |||
@@ -38,7 +38,7 @@ int jffs2_fsync(struct file *filp, struct dentry *dentry, int datasync) | |||
38 | return 0; | 38 | return 0; |
39 | } | 39 | } |
40 | 40 | ||
41 | struct file_operations jffs2_file_operations = | 41 | const struct file_operations jffs2_file_operations = |
42 | { | 42 | { |
43 | .llseek = generic_file_llseek, | 43 | .llseek = generic_file_llseek, |
44 | .open = generic_file_open, | 44 | .open = generic_file_open, |
diff --git a/fs/jffs2/os-linux.h b/fs/jffs2/os-linux.h index 59e7a393200c..d307cf548625 100644 --- a/fs/jffs2/os-linux.h +++ b/fs/jffs2/os-linux.h | |||
@@ -159,11 +159,11 @@ void jffs2_stop_garbage_collect_thread(struct jffs2_sb_info *c); | |||
159 | void jffs2_garbage_collect_trigger(struct jffs2_sb_info *c); | 159 | void jffs2_garbage_collect_trigger(struct jffs2_sb_info *c); |
160 | 160 | ||
161 | /* dir.c */ | 161 | /* dir.c */ |
162 | extern struct file_operations jffs2_dir_operations; | 162 | extern const struct file_operations jffs2_dir_operations; |
163 | extern struct inode_operations jffs2_dir_inode_operations; | 163 | extern struct inode_operations jffs2_dir_inode_operations; |
164 | 164 | ||
165 | /* file.c */ | 165 | /* file.c */ |
166 | extern struct file_operations jffs2_file_operations; | 166 | extern const struct file_operations jffs2_file_operations; |
167 | extern struct inode_operations jffs2_file_inode_operations; | 167 | extern struct inode_operations jffs2_file_inode_operations; |
168 | extern struct address_space_operations jffs2_file_address_operations; | 168 | extern struct address_space_operations jffs2_file_address_operations; |
169 | int jffs2_fsync(struct file *, struct dentry *, int); | 169 | int jffs2_fsync(struct file *, struct dentry *, int); |
diff --git a/fs/jfs/file.c b/fs/jfs/file.c index e1ac6e497e2b..1c9745be5ada 100644 --- a/fs/jfs/file.c +++ b/fs/jfs/file.c | |||
@@ -100,7 +100,7 @@ struct inode_operations jfs_file_inode_operations = { | |||
100 | #endif | 100 | #endif |
101 | }; | 101 | }; |
102 | 102 | ||
103 | struct file_operations jfs_file_operations = { | 103 | const struct file_operations jfs_file_operations = { |
104 | .open = jfs_open, | 104 | .open = jfs_open, |
105 | .llseek = generic_file_llseek, | 105 | .llseek = generic_file_llseek, |
106 | .write = generic_file_write, | 106 | .write = generic_file_write, |
diff --git a/fs/jfs/jfs_inode.h b/fs/jfs/jfs_inode.h index 095d471b9f9a..c30072674464 100644 --- a/fs/jfs/jfs_inode.h +++ b/fs/jfs/jfs_inode.h | |||
@@ -35,9 +35,9 @@ extern void jfs_set_inode_flags(struct inode *); | |||
35 | 35 | ||
36 | extern struct address_space_operations jfs_aops; | 36 | extern struct address_space_operations jfs_aops; |
37 | extern struct inode_operations jfs_dir_inode_operations; | 37 | extern struct inode_operations jfs_dir_inode_operations; |
38 | extern struct file_operations jfs_dir_operations; | 38 | extern const struct file_operations jfs_dir_operations; |
39 | extern struct inode_operations jfs_file_inode_operations; | 39 | extern struct inode_operations jfs_file_inode_operations; |
40 | extern struct file_operations jfs_file_operations; | 40 | extern const struct file_operations jfs_file_operations; |
41 | extern struct inode_operations jfs_symlink_inode_operations; | 41 | extern struct inode_operations jfs_symlink_inode_operations; |
42 | extern struct dentry_operations jfs_ci_dentry_operations; | 42 | extern struct dentry_operations jfs_ci_dentry_operations; |
43 | #endif /* _H_JFS_INODE */ | 43 | #endif /* _H_JFS_INODE */ |
diff --git a/fs/jfs/namei.c b/fs/jfs/namei.c index 309cee575f7d..09ea03f62277 100644 --- a/fs/jfs/namei.c +++ b/fs/jfs/namei.c | |||
@@ -1519,7 +1519,7 @@ struct inode_operations jfs_dir_inode_operations = { | |||
1519 | #endif | 1519 | #endif |
1520 | }; | 1520 | }; |
1521 | 1521 | ||
1522 | struct file_operations jfs_dir_operations = { | 1522 | const struct file_operations jfs_dir_operations = { |
1523 | .read = generic_read_dir, | 1523 | .read = generic_read_dir, |
1524 | .readdir = jfs_readdir, | 1524 | .readdir = jfs_readdir, |
1525 | .fsync = jfs_fsync, | 1525 | .fsync = jfs_fsync, |
diff --git a/fs/libfs.c b/fs/libfs.c index 4fdeaceb892c..7145ba7a48d0 100644 --- a/fs/libfs.c +++ b/fs/libfs.c | |||
@@ -179,7 +179,7 @@ ssize_t generic_read_dir(struct file *filp, char __user *buf, size_t siz, loff_t | |||
179 | return -EISDIR; | 179 | return -EISDIR; |
180 | } | 180 | } |
181 | 181 | ||
182 | struct file_operations simple_dir_operations = { | 182 | const struct file_operations simple_dir_operations = { |
183 | .open = dcache_dir_open, | 183 | .open = dcache_dir_open, |
184 | .release = dcache_dir_close, | 184 | .release = dcache_dir_close, |
185 | .llseek = dcache_dir_lseek, | 185 | .llseek = dcache_dir_lseek, |
diff --git a/fs/minix/dir.c b/fs/minix/dir.c index 732502aabc05..69224d1fe043 100644 --- a/fs/minix/dir.c +++ b/fs/minix/dir.c | |||
@@ -14,7 +14,7 @@ typedef struct minix_dir_entry minix_dirent; | |||
14 | 14 | ||
15 | static int minix_readdir(struct file *, void *, filldir_t); | 15 | static int minix_readdir(struct file *, void *, filldir_t); |
16 | 16 | ||
17 | struct file_operations minix_dir_operations = { | 17 | const struct file_operations minix_dir_operations = { |
18 | .read = generic_read_dir, | 18 | .read = generic_read_dir, |
19 | .readdir = minix_readdir, | 19 | .readdir = minix_readdir, |
20 | .fsync = minix_sync_file, | 20 | .fsync = minix_sync_file, |
diff --git a/fs/minix/file.c b/fs/minix/file.c index f1d77acb3f01..420b32882a10 100644 --- a/fs/minix/file.c +++ b/fs/minix/file.c | |||
@@ -15,7 +15,7 @@ | |||
15 | */ | 15 | */ |
16 | int minix_sync_file(struct file *, struct dentry *, int); | 16 | int minix_sync_file(struct file *, struct dentry *, int); |
17 | 17 | ||
18 | struct file_operations minix_file_operations = { | 18 | const struct file_operations minix_file_operations = { |
19 | .llseek = generic_file_llseek, | 19 | .llseek = generic_file_llseek, |
20 | .read = generic_file_read, | 20 | .read = generic_file_read, |
21 | .write = generic_file_write, | 21 | .write = generic_file_write, |
diff --git a/fs/minix/minix.h b/fs/minix/minix.h index e42a8bb89001..c55b77cdcc8e 100644 --- a/fs/minix/minix.h +++ b/fs/minix/minix.h | |||
@@ -81,8 +81,8 @@ extern int minix_sync_file(struct file *, struct dentry *, int); | |||
81 | 81 | ||
82 | extern struct inode_operations minix_file_inode_operations; | 82 | extern struct inode_operations minix_file_inode_operations; |
83 | extern struct inode_operations minix_dir_inode_operations; | 83 | extern struct inode_operations minix_dir_inode_operations; |
84 | extern struct file_operations minix_file_operations; | 84 | extern const struct file_operations minix_file_operations; |
85 | extern struct file_operations minix_dir_operations; | 85 | extern const struct file_operations minix_dir_operations; |
86 | extern struct dentry_operations minix_dentry_operations; | 86 | extern struct dentry_operations minix_dentry_operations; |
87 | 87 | ||
88 | static inline struct minix_sb_info *minix_sb(struct super_block *sb) | 88 | static inline struct minix_sb_info *minix_sb(struct super_block *sb) |
diff --git a/fs/ncpfs/dir.c b/fs/ncpfs/dir.c index cfd76f431dc0..f0860c602d8b 100644 --- a/fs/ncpfs/dir.c +++ b/fs/ncpfs/dir.c | |||
@@ -49,7 +49,7 @@ extern int ncp_symlink(struct inode *, struct dentry *, const char *); | |||
49 | #define ncp_symlink NULL | 49 | #define ncp_symlink NULL |
50 | #endif | 50 | #endif |
51 | 51 | ||
52 | struct file_operations ncp_dir_operations = | 52 | const struct file_operations ncp_dir_operations = |
53 | { | 53 | { |
54 | .read = generic_read_dir, | 54 | .read = generic_read_dir, |
55 | .readdir = ncp_readdir, | 55 | .readdir = ncp_readdir, |
diff --git a/fs/ncpfs/file.c b/fs/ncpfs/file.c index ebdad8f6398f..e6b7c67cf057 100644 --- a/fs/ncpfs/file.c +++ b/fs/ncpfs/file.c | |||
@@ -283,7 +283,7 @@ static int ncp_release(struct inode *inode, struct file *file) { | |||
283 | return 0; | 283 | return 0; |
284 | } | 284 | } |
285 | 285 | ||
286 | struct file_operations ncp_file_operations = | 286 | const struct file_operations ncp_file_operations = |
287 | { | 287 | { |
288 | .llseek = remote_llseek, | 288 | .llseek = remote_llseek, |
289 | .read = ncp_file_read, | 289 | .read = ncp_file_read, |
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index 06c48b385c94..a23f34894167 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c | |||
@@ -54,7 +54,7 @@ static int nfs_rename(struct inode *, struct dentry *, | |||
54 | static int nfs_fsync_dir(struct file *, struct dentry *, int); | 54 | static int nfs_fsync_dir(struct file *, struct dentry *, int); |
55 | static loff_t nfs_llseek_dir(struct file *, loff_t, int); | 55 | static loff_t nfs_llseek_dir(struct file *, loff_t, int); |
56 | 56 | ||
57 | struct file_operations nfs_dir_operations = { | 57 | const struct file_operations nfs_dir_operations = { |
58 | .llseek = nfs_llseek_dir, | 58 | .llseek = nfs_llseek_dir, |
59 | .read = generic_read_dir, | 59 | .read = generic_read_dir, |
60 | .readdir = nfs_readdir, | 60 | .readdir = nfs_readdir, |
diff --git a/fs/nfs/file.c b/fs/nfs/file.c index dee49a0cb995..f1df2c8d9259 100644 --- a/fs/nfs/file.c +++ b/fs/nfs/file.c | |||
@@ -49,7 +49,7 @@ static int nfs_check_flags(int flags); | |||
49 | static int nfs_lock(struct file *filp, int cmd, struct file_lock *fl); | 49 | static int nfs_lock(struct file *filp, int cmd, struct file_lock *fl); |
50 | static int nfs_flock(struct file *filp, int cmd, struct file_lock *fl); | 50 | static int nfs_flock(struct file *filp, int cmd, struct file_lock *fl); |
51 | 51 | ||
52 | struct file_operations nfs_file_operations = { | 52 | const struct file_operations nfs_file_operations = { |
53 | .llseek = nfs_file_llseek, | 53 | .llseek = nfs_file_llseek, |
54 | .read = do_sync_read, | 54 | .read = do_sync_read, |
55 | .write = do_sync_write, | 55 | .write = do_sync_write, |
diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c index c8960aff0968..3ef017b3b5bd 100644 --- a/fs/nfsd/nfsctl.c +++ b/fs/nfsd/nfsctl.c | |||
@@ -134,7 +134,7 @@ static ssize_t nfsctl_transaction_read(struct file *file, char __user *buf, size | |||
134 | return simple_transaction_read(file, buf, size, pos); | 134 | return simple_transaction_read(file, buf, size, pos); |
135 | } | 135 | } |
136 | 136 | ||
137 | static struct file_operations transaction_ops = { | 137 | static const struct file_operations transaction_ops = { |
138 | .write = nfsctl_transaction_write, | 138 | .write = nfsctl_transaction_write, |
139 | .read = nfsctl_transaction_read, | 139 | .read = nfsctl_transaction_read, |
140 | .release = simple_transaction_release, | 140 | .release = simple_transaction_release, |
@@ -146,7 +146,7 @@ static int exports_open(struct inode *inode, struct file *file) | |||
146 | return seq_open(file, &nfs_exports_op); | 146 | return seq_open(file, &nfs_exports_op); |
147 | } | 147 | } |
148 | 148 | ||
149 | static struct file_operations exports_operations = { | 149 | static const struct file_operations exports_operations = { |
150 | .open = exports_open, | 150 | .open = exports_open, |
151 | .read = seq_read, | 151 | .read = seq_read, |
152 | .llseek = seq_lseek, | 152 | .llseek = seq_lseek, |
diff --git a/fs/nfsd/stats.c b/fs/nfsd/stats.c index 1cf955bcc526..57265d563804 100644 --- a/fs/nfsd/stats.c +++ b/fs/nfsd/stats.c | |||
@@ -80,7 +80,7 @@ static int nfsd_proc_open(struct inode *inode, struct file *file) | |||
80 | return single_open(file, nfsd_proc_show, NULL); | 80 | return single_open(file, nfsd_proc_show, NULL); |
81 | } | 81 | } |
82 | 82 | ||
83 | static struct file_operations nfsd_proc_fops = { | 83 | static const struct file_operations nfsd_proc_fops = { |
84 | .owner = THIS_MODULE, | 84 | .owner = THIS_MODULE, |
85 | .open = nfsd_proc_open, | 85 | .open = nfsd_proc_open, |
86 | .read = seq_read, | 86 | .read = seq_read, |
diff --git a/fs/ntfs/dir.c b/fs/ntfs/dir.c index 9d9ed3fe371d..d1e2c6f9f05e 100644 --- a/fs/ntfs/dir.c +++ b/fs/ntfs/dir.c | |||
@@ -1553,7 +1553,7 @@ static int ntfs_dir_fsync(struct file *filp, struct dentry *dentry, | |||
1553 | 1553 | ||
1554 | #endif /* NTFS_RW */ | 1554 | #endif /* NTFS_RW */ |
1555 | 1555 | ||
1556 | struct file_operations ntfs_dir_ops = { | 1556 | const struct file_operations ntfs_dir_ops = { |
1557 | .llseek = generic_file_llseek, /* Seek inside directory. */ | 1557 | .llseek = generic_file_llseek, /* Seek inside directory. */ |
1558 | .read = generic_read_dir, /* Return -EISDIR. */ | 1558 | .read = generic_read_dir, /* Return -EISDIR. */ |
1559 | .readdir = ntfs_readdir, /* Read directory contents. */ | 1559 | .readdir = ntfs_readdir, /* Read directory contents. */ |
diff --git a/fs/ntfs/file.c b/fs/ntfs/file.c index f5d057e4acc2..c63a83e8da98 100644 --- a/fs/ntfs/file.c +++ b/fs/ntfs/file.c | |||
@@ -2294,7 +2294,7 @@ static int ntfs_file_fsync(struct file *filp, struct dentry *dentry, | |||
2294 | 2294 | ||
2295 | #endif /* NTFS_RW */ | 2295 | #endif /* NTFS_RW */ |
2296 | 2296 | ||
2297 | struct file_operations ntfs_file_ops = { | 2297 | const struct file_operations ntfs_file_ops = { |
2298 | .llseek = generic_file_llseek, /* Seek inside file. */ | 2298 | .llseek = generic_file_llseek, /* Seek inside file. */ |
2299 | .read = generic_file_read, /* Read from file. */ | 2299 | .read = generic_file_read, /* Read from file. */ |
2300 | .aio_read = generic_file_aio_read, /* Async read from file. */ | 2300 | .aio_read = generic_file_aio_read, /* Async read from file. */ |
@@ -2337,6 +2337,6 @@ struct inode_operations ntfs_file_inode_ops = { | |||
2337 | #endif /* NTFS_RW */ | 2337 | #endif /* NTFS_RW */ |
2338 | }; | 2338 | }; |
2339 | 2339 | ||
2340 | struct file_operations ntfs_empty_file_ops = {}; | 2340 | const struct file_operations ntfs_empty_file_ops = {}; |
2341 | 2341 | ||
2342 | struct inode_operations ntfs_empty_inode_ops = {}; | 2342 | struct inode_operations ntfs_empty_inode_ops = {}; |
diff --git a/fs/ntfs/ntfs.h b/fs/ntfs/ntfs.h index 166142960b53..bf7b3d7c0930 100644 --- a/fs/ntfs/ntfs.h +++ b/fs/ntfs/ntfs.h | |||
@@ -60,13 +60,13 @@ extern struct kmem_cache *ntfs_index_ctx_cache; | |||
60 | extern struct address_space_operations ntfs_aops; | 60 | extern struct address_space_operations ntfs_aops; |
61 | extern struct address_space_operations ntfs_mst_aops; | 61 | extern struct address_space_operations ntfs_mst_aops; |
62 | 62 | ||
63 | extern struct file_operations ntfs_file_ops; | 63 | extern const struct file_operations ntfs_file_ops; |
64 | extern struct inode_operations ntfs_file_inode_ops; | 64 | extern struct inode_operations ntfs_file_inode_ops; |
65 | 65 | ||
66 | extern struct file_operations ntfs_dir_ops; | 66 | extern const struct file_operations ntfs_dir_ops; |
67 | extern struct inode_operations ntfs_dir_inode_ops; | 67 | extern struct inode_operations ntfs_dir_inode_ops; |
68 | 68 | ||
69 | extern struct file_operations ntfs_empty_file_ops; | 69 | extern const struct file_operations ntfs_empty_file_ops; |
70 | extern struct inode_operations ntfs_empty_inode_ops; | 70 | extern struct inode_operations ntfs_empty_inode_ops; |
71 | 71 | ||
72 | extern struct export_operations ntfs_export_ops; | 72 | extern struct export_operations ntfs_export_ops; |
diff --git a/fs/ocfs2/dlmglue.c b/fs/ocfs2/dlmglue.c index 84f153aca692..64cd52860c87 100644 --- a/fs/ocfs2/dlmglue.c +++ b/fs/ocfs2/dlmglue.c | |||
@@ -2017,7 +2017,7 @@ out: | |||
2017 | return ret; | 2017 | return ret; |
2018 | } | 2018 | } |
2019 | 2019 | ||
2020 | static struct file_operations ocfs2_dlm_debug_fops = { | 2020 | static const struct file_operations ocfs2_dlm_debug_fops = { |
2021 | .open = ocfs2_dlm_debug_open, | 2021 | .open = ocfs2_dlm_debug_open, |
2022 | .release = ocfs2_dlm_debug_release, | 2022 | .release = ocfs2_dlm_debug_release, |
2023 | .read = seq_read, | 2023 | .read = seq_read, |
diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c index 4b4cbadd5838..34e903a6a46b 100644 --- a/fs/ocfs2/file.c +++ b/fs/ocfs2/file.c | |||
@@ -1176,7 +1176,7 @@ struct inode_operations ocfs2_special_file_iops = { | |||
1176 | .getattr = ocfs2_getattr, | 1176 | .getattr = ocfs2_getattr, |
1177 | }; | 1177 | }; |
1178 | 1178 | ||
1179 | struct file_operations ocfs2_fops = { | 1179 | const struct file_operations ocfs2_fops = { |
1180 | .read = do_sync_read, | 1180 | .read = do_sync_read, |
1181 | .write = do_sync_write, | 1181 | .write = do_sync_write, |
1182 | .sendfile = generic_file_sendfile, | 1182 | .sendfile = generic_file_sendfile, |
@@ -1188,7 +1188,7 @@ struct file_operations ocfs2_fops = { | |||
1188 | .aio_write = ocfs2_file_aio_write, | 1188 | .aio_write = ocfs2_file_aio_write, |
1189 | }; | 1189 | }; |
1190 | 1190 | ||
1191 | struct file_operations ocfs2_dops = { | 1191 | const struct file_operations ocfs2_dops = { |
1192 | .read = generic_read_dir, | 1192 | .read = generic_read_dir, |
1193 | .readdir = ocfs2_readdir, | 1193 | .readdir = ocfs2_readdir, |
1194 | .fsync = ocfs2_sync_file, | 1194 | .fsync = ocfs2_sync_file, |
diff --git a/fs/ocfs2/file.h b/fs/ocfs2/file.h index a5ea33b24060..740c9e7ca599 100644 --- a/fs/ocfs2/file.h +++ b/fs/ocfs2/file.h | |||
@@ -26,8 +26,8 @@ | |||
26 | #ifndef OCFS2_FILE_H | 26 | #ifndef OCFS2_FILE_H |
27 | #define OCFS2_FILE_H | 27 | #define OCFS2_FILE_H |
28 | 28 | ||
29 | extern struct file_operations ocfs2_fops; | 29 | extern const struct file_operations ocfs2_fops; |
30 | extern struct file_operations ocfs2_dops; | 30 | extern const struct file_operations ocfs2_dops; |
31 | extern struct inode_operations ocfs2_file_iops; | 31 | extern struct inode_operations ocfs2_file_iops; |
32 | extern struct inode_operations ocfs2_special_file_iops; | 32 | extern struct inode_operations ocfs2_special_file_iops; |
33 | struct ocfs2_alloc_context; | 33 | struct ocfs2_alloc_context; |
diff --git a/fs/openpromfs/inode.c b/fs/openpromfs/inode.c index aeb0106890e4..0f14276a2e51 100644 --- a/fs/openpromfs/inode.c +++ b/fs/openpromfs/inode.c | |||
@@ -581,17 +581,17 @@ int property_release (struct inode *inode, struct file *filp) | |||
581 | return 0; | 581 | return 0; |
582 | } | 582 | } |
583 | 583 | ||
584 | static struct file_operations openpromfs_prop_ops = { | 584 | static const struct file_operations openpromfs_prop_ops = { |
585 | .read = property_read, | 585 | .read = property_read, |
586 | .write = property_write, | 586 | .write = property_write, |
587 | .release = property_release, | 587 | .release = property_release, |
588 | }; | 588 | }; |
589 | 589 | ||
590 | static struct file_operations openpromfs_nodenum_ops = { | 590 | static const struct file_operations openpromfs_nodenum_ops = { |
591 | .read = nodenum_read, | 591 | .read = nodenum_read, |
592 | }; | 592 | }; |
593 | 593 | ||
594 | static struct file_operations openprom_operations = { | 594 | static const struct file_operations openprom_operations = { |
595 | .read = generic_read_dir, | 595 | .read = generic_read_dir, |
596 | .readdir = openpromfs_readdir, | 596 | .readdir = openpromfs_readdir, |
597 | }; | 597 | }; |
@@ -568,7 +568,7 @@ pipe_rdwr_open(struct inode *inode, struct file *filp) | |||
568 | * The file_operations structs are not static because they | 568 | * The file_operations structs are not static because they |
569 | * are also used in linux/fs/fifo.c to do operations on FIFOs. | 569 | * are also used in linux/fs/fifo.c to do operations on FIFOs. |
570 | */ | 570 | */ |
571 | struct file_operations read_fifo_fops = { | 571 | const struct file_operations read_fifo_fops = { |
572 | .llseek = no_llseek, | 572 | .llseek = no_llseek, |
573 | .read = pipe_read, | 573 | .read = pipe_read, |
574 | .readv = pipe_readv, | 574 | .readv = pipe_readv, |
@@ -580,7 +580,7 @@ struct file_operations read_fifo_fops = { | |||
580 | .fasync = pipe_read_fasync, | 580 | .fasync = pipe_read_fasync, |
581 | }; | 581 | }; |
582 | 582 | ||
583 | struct file_operations write_fifo_fops = { | 583 | const struct file_operations write_fifo_fops = { |
584 | .llseek = no_llseek, | 584 | .llseek = no_llseek, |
585 | .read = bad_pipe_r, | 585 | .read = bad_pipe_r, |
586 | .write = pipe_write, | 586 | .write = pipe_write, |
@@ -592,7 +592,7 @@ struct file_operations write_fifo_fops = { | |||
592 | .fasync = pipe_write_fasync, | 592 | .fasync = pipe_write_fasync, |
593 | }; | 593 | }; |
594 | 594 | ||
595 | struct file_operations rdwr_fifo_fops = { | 595 | const struct file_operations rdwr_fifo_fops = { |
596 | .llseek = no_llseek, | 596 | .llseek = no_llseek, |
597 | .read = pipe_read, | 597 | .read = pipe_read, |
598 | .readv = pipe_readv, | 598 | .readv = pipe_readv, |
diff --git a/fs/proc/kcore.c b/fs/proc/kcore.c index adc2cd95169a..17f6e8fa1397 100644 --- a/fs/proc/kcore.c +++ b/fs/proc/kcore.c | |||
@@ -31,7 +31,7 @@ static int open_kcore(struct inode * inode, struct file * filp) | |||
31 | 31 | ||
32 | static ssize_t read_kcore(struct file *, char __user *, size_t, loff_t *); | 32 | static ssize_t read_kcore(struct file *, char __user *, size_t, loff_t *); |
33 | 33 | ||
34 | struct file_operations proc_kcore_operations = { | 34 | const struct file_operations proc_kcore_operations = { |
35 | .read = read_kcore, | 35 | .read = read_kcore, |
36 | .open = open_kcore, | 36 | .open = open_kcore, |
37 | }; | 37 | }; |
diff --git a/fs/proc/kmsg.c b/fs/proc/kmsg.c index 10d37bf25206..ff3b90b56e9d 100644 --- a/fs/proc/kmsg.c +++ b/fs/proc/kmsg.c | |||
@@ -47,7 +47,7 @@ static unsigned int kmsg_poll(struct file *file, poll_table *wait) | |||
47 | } | 47 | } |
48 | 48 | ||
49 | 49 | ||
50 | struct file_operations proc_kmsg_operations = { | 50 | const struct file_operations proc_kmsg_operations = { |
51 | .read = kmsg_read, | 51 | .read = kmsg_read, |
52 | .poll = kmsg_poll, | 52 | .poll = kmsg_poll, |
53 | .open = kmsg_open, | 53 | .open = kmsg_open, |
diff --git a/fs/proc/vmcore.c b/fs/proc/vmcore.c index 4063fb32f78c..7efa73d44c9a 100644 --- a/fs/proc/vmcore.c +++ b/fs/proc/vmcore.c | |||
@@ -172,7 +172,7 @@ static int open_vmcore(struct inode *inode, struct file *filp) | |||
172 | return 0; | 172 | return 0; |
173 | } | 173 | } |
174 | 174 | ||
175 | struct file_operations proc_vmcore_operations = { | 175 | const struct file_operations proc_vmcore_operations = { |
176 | .read = read_vmcore, | 176 | .read = read_vmcore, |
177 | .open = open_vmcore, | 177 | .open = open_vmcore, |
178 | }; | 178 | }; |
diff --git a/fs/qnx4/dir.c b/fs/qnx4/dir.c index 7a8f5595c26f..9031948fefd0 100644 --- a/fs/qnx4/dir.c +++ b/fs/qnx4/dir.c | |||
@@ -81,7 +81,7 @@ out: | |||
81 | return 0; | 81 | return 0; |
82 | } | 82 | } |
83 | 83 | ||
84 | struct file_operations qnx4_dir_operations = | 84 | const struct file_operations qnx4_dir_operations = |
85 | { | 85 | { |
86 | .read = generic_read_dir, | 86 | .read = generic_read_dir, |
87 | .readdir = qnx4_readdir, | 87 | .readdir = qnx4_readdir, |
diff --git a/fs/qnx4/file.c b/fs/qnx4/file.c index c33963fded9e..62af4b1348bd 100644 --- a/fs/qnx4/file.c +++ b/fs/qnx4/file.c | |||
@@ -19,7 +19,7 @@ | |||
19 | * We have mostly NULL's here: the current defaults are ok for | 19 | * We have mostly NULL's here: the current defaults are ok for |
20 | * the qnx4 filesystem. | 20 | * the qnx4 filesystem. |
21 | */ | 21 | */ |
22 | struct file_operations qnx4_file_operations = | 22 | const struct file_operations qnx4_file_operations = |
23 | { | 23 | { |
24 | .llseek = generic_file_llseek, | 24 | .llseek = generic_file_llseek, |
25 | .read = generic_file_read, | 25 | .read = generic_file_read, |
diff --git a/fs/ramfs/file-mmu.c b/fs/ramfs/file-mmu.c index 6ada2095b9ac..00a933eb820c 100644 --- a/fs/ramfs/file-mmu.c +++ b/fs/ramfs/file-mmu.c | |||
@@ -32,7 +32,7 @@ struct address_space_operations ramfs_aops = { | |||
32 | .commit_write = simple_commit_write | 32 | .commit_write = simple_commit_write |
33 | }; | 33 | }; |
34 | 34 | ||
35 | struct file_operations ramfs_file_operations = { | 35 | const struct file_operations ramfs_file_operations = { |
36 | .read = generic_file_read, | 36 | .read = generic_file_read, |
37 | .write = generic_file_write, | 37 | .write = generic_file_write, |
38 | .mmap = generic_file_mmap, | 38 | .mmap = generic_file_mmap, |
diff --git a/fs/ramfs/file-nommu.c b/fs/ramfs/file-nommu.c index b1ca234068f6..f443a84b98a5 100644 --- a/fs/ramfs/file-nommu.c +++ b/fs/ramfs/file-nommu.c | |||
@@ -33,7 +33,7 @@ struct address_space_operations ramfs_aops = { | |||
33 | .commit_write = simple_commit_write | 33 | .commit_write = simple_commit_write |
34 | }; | 34 | }; |
35 | 35 | ||
36 | struct file_operations ramfs_file_operations = { | 36 | const struct file_operations ramfs_file_operations = { |
37 | .mmap = ramfs_nommu_mmap, | 37 | .mmap = ramfs_nommu_mmap, |
38 | .get_unmapped_area = ramfs_nommu_get_unmapped_area, | 38 | .get_unmapped_area = ramfs_nommu_get_unmapped_area, |
39 | .read = generic_file_read, | 39 | .read = generic_file_read, |
diff --git a/fs/ramfs/internal.h b/fs/ramfs/internal.h index 272c8a7120b0..313237631b49 100644 --- a/fs/ramfs/internal.h +++ b/fs/ramfs/internal.h | |||
@@ -11,5 +11,5 @@ | |||
11 | 11 | ||
12 | 12 | ||
13 | extern struct address_space_operations ramfs_aops; | 13 | extern struct address_space_operations ramfs_aops; |
14 | extern struct file_operations ramfs_file_operations; | 14 | extern const struct file_operations ramfs_file_operations; |
15 | extern struct inode_operations ramfs_file_inode_operations; | 15 | extern struct inode_operations ramfs_file_inode_operations; |
diff --git a/fs/read_write.c b/fs/read_write.c index 34b1bf259efd..6256ca81a718 100644 --- a/fs/read_write.c +++ b/fs/read_write.c | |||
@@ -19,7 +19,7 @@ | |||
19 | #include <asm/uaccess.h> | 19 | #include <asm/uaccess.h> |
20 | #include <asm/unistd.h> | 20 | #include <asm/unistd.h> |
21 | 21 | ||
22 | struct file_operations generic_ro_fops = { | 22 | const struct file_operations generic_ro_fops = { |
23 | .llseek = generic_file_llseek, | 23 | .llseek = generic_file_llseek, |
24 | .read = generic_file_read, | 24 | .read = generic_file_read, |
25 | .mmap = generic_file_readonly_mmap, | 25 | .mmap = generic_file_readonly_mmap, |
diff --git a/fs/reiserfs/dir.c b/fs/reiserfs/dir.c index d71ac6579289..973c819f8033 100644 --- a/fs/reiserfs/dir.c +++ b/fs/reiserfs/dir.c | |||
@@ -18,7 +18,7 @@ static int reiserfs_readdir(struct file *, void *, filldir_t); | |||
18 | static int reiserfs_dir_fsync(struct file *filp, struct dentry *dentry, | 18 | static int reiserfs_dir_fsync(struct file *filp, struct dentry *dentry, |
19 | int datasync); | 19 | int datasync); |
20 | 20 | ||
21 | struct file_operations reiserfs_dir_operations = { | 21 | const struct file_operations reiserfs_dir_operations = { |
22 | .read = generic_read_dir, | 22 | .read = generic_read_dir, |
23 | .readdir = reiserfs_readdir, | 23 | .readdir = reiserfs_readdir, |
24 | .fsync = reiserfs_dir_fsync, | 24 | .fsync = reiserfs_dir_fsync, |
diff --git a/fs/reiserfs/file.c b/fs/reiserfs/file.c index d0c1e865963e..010094d14da6 100644 --- a/fs/reiserfs/file.c +++ b/fs/reiserfs/file.c | |||
@@ -1566,7 +1566,7 @@ static ssize_t reiserfs_aio_write(struct kiocb *iocb, const char __user * buf, | |||
1566 | return generic_file_aio_write(iocb, buf, count, pos); | 1566 | return generic_file_aio_write(iocb, buf, count, pos); |
1567 | } | 1567 | } |
1568 | 1568 | ||
1569 | struct file_operations reiserfs_file_operations = { | 1569 | const struct file_operations reiserfs_file_operations = { |
1570 | .read = generic_file_read, | 1570 | .read = generic_file_read, |
1571 | .write = reiserfs_file_write, | 1571 | .write = reiserfs_file_write, |
1572 | .ioctl = reiserfs_ioctl, | 1572 | .ioctl = reiserfs_ioctl, |
diff --git a/fs/reiserfs/procfs.c b/fs/reiserfs/procfs.c index ef6caed9336b..731688e1cfe3 100644 --- a/fs/reiserfs/procfs.c +++ b/fs/reiserfs/procfs.c | |||
@@ -470,7 +470,7 @@ static int r_open(struct inode *inode, struct file *file) | |||
470 | return ret; | 470 | return ret; |
471 | } | 471 | } |
472 | 472 | ||
473 | static struct file_operations r_file_operations = { | 473 | static const struct file_operations r_file_operations = { |
474 | .open = r_open, | 474 | .open = r_open, |
475 | .read = seq_read, | 475 | .read = seq_read, |
476 | .llseek = seq_lseek, | 476 | .llseek = seq_lseek, |
diff --git a/fs/romfs/inode.c b/fs/romfs/inode.c index c2fc424d7d5c..9b9eda7b335c 100644 --- a/fs/romfs/inode.c +++ b/fs/romfs/inode.c | |||
@@ -463,7 +463,7 @@ static struct address_space_operations romfs_aops = { | |||
463 | .readpage = romfs_readpage | 463 | .readpage = romfs_readpage |
464 | }; | 464 | }; |
465 | 465 | ||
466 | static struct file_operations romfs_dir_operations = { | 466 | static const struct file_operations romfs_dir_operations = { |
467 | .read = generic_read_dir, | 467 | .read = generic_read_dir, |
468 | .readdir = romfs_readdir, | 468 | .readdir = romfs_readdir, |
469 | }; | 469 | }; |
diff --git a/fs/smbfs/dir.c b/fs/smbfs/dir.c index 0424d06b147e..34c7a11d91f0 100644 --- a/fs/smbfs/dir.c +++ b/fs/smbfs/dir.c | |||
@@ -34,7 +34,7 @@ static int smb_rename(struct inode *, struct dentry *, | |||
34 | static int smb_make_node(struct inode *,struct dentry *,int,dev_t); | 34 | static int smb_make_node(struct inode *,struct dentry *,int,dev_t); |
35 | static int smb_link(struct dentry *, struct inode *, struct dentry *); | 35 | static int smb_link(struct dentry *, struct inode *, struct dentry *); |
36 | 36 | ||
37 | struct file_operations smb_dir_operations = | 37 | const struct file_operations smb_dir_operations = |
38 | { | 38 | { |
39 | .read = generic_read_dir, | 39 | .read = generic_read_dir, |
40 | .readdir = smb_readdir, | 40 | .readdir = smb_readdir, |
diff --git a/fs/smbfs/file.c b/fs/smbfs/file.c index 7042e62726a4..c56bd99a9701 100644 --- a/fs/smbfs/file.c +++ b/fs/smbfs/file.c | |||
@@ -401,7 +401,7 @@ smb_file_permission(struct inode *inode, int mask, struct nameidata *nd) | |||
401 | return error; | 401 | return error; |
402 | } | 402 | } |
403 | 403 | ||
404 | struct file_operations smb_file_operations = | 404 | const struct file_operations smb_file_operations = |
405 | { | 405 | { |
406 | .llseek = remote_llseek, | 406 | .llseek = remote_llseek, |
407 | .read = smb_file_read, | 407 | .read = smb_file_read, |
diff --git a/fs/smbfs/proto.h b/fs/smbfs/proto.h index e866ec8660d0..47664597e6b1 100644 --- a/fs/smbfs/proto.h +++ b/fs/smbfs/proto.h | |||
@@ -35,7 +35,7 @@ extern int smb_proc_symlink(struct smb_sb_info *server, struct dentry *d, const | |||
35 | extern int smb_proc_link(struct smb_sb_info *server, struct dentry *dentry, struct dentry *new_dentry); | 35 | extern int smb_proc_link(struct smb_sb_info *server, struct dentry *dentry, struct dentry *new_dentry); |
36 | extern void smb_install_null_ops(struct smb_ops *ops); | 36 | extern void smb_install_null_ops(struct smb_ops *ops); |
37 | /* dir.c */ | 37 | /* dir.c */ |
38 | extern struct file_operations smb_dir_operations; | 38 | extern const struct file_operations smb_dir_operations; |
39 | extern struct inode_operations smb_dir_inode_operations; | 39 | extern struct inode_operations smb_dir_inode_operations; |
40 | extern struct inode_operations smb_dir_inode_operations_unix; | 40 | extern struct inode_operations smb_dir_inode_operations_unix; |
41 | extern void smb_new_dentry(struct dentry *dentry); | 41 | extern void smb_new_dentry(struct dentry *dentry); |
@@ -64,7 +64,7 @@ extern int smb_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat | |||
64 | extern int smb_notify_change(struct dentry *dentry, struct iattr *attr); | 64 | extern int smb_notify_change(struct dentry *dentry, struct iattr *attr); |
65 | /* file.c */ | 65 | /* file.c */ |
66 | extern struct address_space_operations smb_file_aops; | 66 | extern struct address_space_operations smb_file_aops; |
67 | extern struct file_operations smb_file_operations; | 67 | extern const struct file_operations smb_file_operations; |
68 | extern struct inode_operations smb_file_inode_operations; | 68 | extern struct inode_operations smb_file_inode_operations; |
69 | /* ioctl.c */ | 69 | /* ioctl.c */ |
70 | extern int smb_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg); | 70 | extern int smb_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg); |
diff --git a/fs/sysfs/bin.c b/fs/sysfs/bin.c index 78899eeab974..c16a93c353c0 100644 --- a/fs/sysfs/bin.c +++ b/fs/sysfs/bin.c | |||
@@ -163,7 +163,7 @@ static int release(struct inode * inode, struct file * file) | |||
163 | return 0; | 163 | return 0; |
164 | } | 164 | } |
165 | 165 | ||
166 | struct file_operations bin_fops = { | 166 | const struct file_operations bin_fops = { |
167 | .read = read, | 167 | .read = read, |
168 | .write = write, | 168 | .write = write, |
169 | .mmap = mmap, | 169 | .mmap = mmap, |
diff --git a/fs/sysfs/dir.c b/fs/sysfs/dir.c index 9ee956864445..f26880a4785e 100644 --- a/fs/sysfs/dir.c +++ b/fs/sysfs/dir.c | |||
@@ -503,7 +503,7 @@ static loff_t sysfs_dir_lseek(struct file * file, loff_t offset, int origin) | |||
503 | return offset; | 503 | return offset; |
504 | } | 504 | } |
505 | 505 | ||
506 | struct file_operations sysfs_dir_operations = { | 506 | const struct file_operations sysfs_dir_operations = { |
507 | .open = sysfs_dir_open, | 507 | .open = sysfs_dir_open, |
508 | .release = sysfs_dir_close, | 508 | .release = sysfs_dir_close, |
509 | .llseek = sysfs_dir_lseek, | 509 | .llseek = sysfs_dir_lseek, |
diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c index 5e83e7246788..830f76fa098c 100644 --- a/fs/sysfs/file.c +++ b/fs/sysfs/file.c | |||
@@ -348,7 +348,7 @@ static int sysfs_release(struct inode * inode, struct file * filp) | |||
348 | return 0; | 348 | return 0; |
349 | } | 349 | } |
350 | 350 | ||
351 | struct file_operations sysfs_file_operations = { | 351 | const struct file_operations sysfs_file_operations = { |
352 | .read = sysfs_read_file, | 352 | .read = sysfs_read_file, |
353 | .write = sysfs_write_file, | 353 | .write = sysfs_write_file, |
354 | .llseek = generic_file_llseek, | 354 | .llseek = generic_file_llseek, |
diff --git a/fs/sysfs/sysfs.h b/fs/sysfs/sysfs.h index cf11d5b789d9..32958a7c50e9 100644 --- a/fs/sysfs/sysfs.h +++ b/fs/sysfs/sysfs.h | |||
@@ -21,9 +21,9 @@ extern int sysfs_setattr(struct dentry *dentry, struct iattr *iattr); | |||
21 | 21 | ||
22 | extern struct rw_semaphore sysfs_rename_sem; | 22 | extern struct rw_semaphore sysfs_rename_sem; |
23 | extern struct super_block * sysfs_sb; | 23 | extern struct super_block * sysfs_sb; |
24 | extern struct file_operations sysfs_dir_operations; | 24 | extern const struct file_operations sysfs_dir_operations; |
25 | extern struct file_operations sysfs_file_operations; | 25 | extern const struct file_operations sysfs_file_operations; |
26 | extern struct file_operations bin_fops; | 26 | extern const struct file_operations bin_fops; |
27 | extern struct inode_operations sysfs_dir_inode_operations; | 27 | extern struct inode_operations sysfs_dir_inode_operations; |
28 | extern struct inode_operations sysfs_symlink_inode_operations; | 28 | extern struct inode_operations sysfs_symlink_inode_operations; |
29 | 29 | ||
diff --git a/fs/sysv/dir.c b/fs/sysv/dir.c index cce8b05cba5a..8c66e9270dd6 100644 --- a/fs/sysv/dir.c +++ b/fs/sysv/dir.c | |||
@@ -20,7 +20,7 @@ | |||
20 | 20 | ||
21 | static int sysv_readdir(struct file *, void *, filldir_t); | 21 | static int sysv_readdir(struct file *, void *, filldir_t); |
22 | 22 | ||
23 | struct file_operations sysv_dir_operations = { | 23 | const struct file_operations sysv_dir_operations = { |
24 | .read = generic_read_dir, | 24 | .read = generic_read_dir, |
25 | .readdir = sysv_readdir, | 25 | .readdir = sysv_readdir, |
26 | .fsync = sysv_sync_file, | 26 | .fsync = sysv_sync_file, |
diff --git a/fs/sysv/file.c b/fs/sysv/file.c index da69abc06240..a59e303135fa 100644 --- a/fs/sysv/file.c +++ b/fs/sysv/file.c | |||
@@ -19,7 +19,7 @@ | |||
19 | * We have mostly NULLs here: the current defaults are OK for | 19 | * We have mostly NULLs here: the current defaults are OK for |
20 | * the coh filesystem. | 20 | * the coh filesystem. |
21 | */ | 21 | */ |
22 | struct file_operations sysv_file_operations = { | 22 | const struct file_operations sysv_file_operations = { |
23 | .llseek = generic_file_llseek, | 23 | .llseek = generic_file_llseek, |
24 | .read = generic_file_read, | 24 | .read = generic_file_read, |
25 | .write = generic_file_write, | 25 | .write = generic_file_write, |
diff --git a/fs/sysv/sysv.h b/fs/sysv/sysv.h index b7f9b4a42aab..393a480e4deb 100644 --- a/fs/sysv/sysv.h +++ b/fs/sysv/sysv.h | |||
@@ -159,8 +159,8 @@ extern ino_t sysv_inode_by_name(struct dentry *); | |||
159 | extern struct inode_operations sysv_file_inode_operations; | 159 | extern struct inode_operations sysv_file_inode_operations; |
160 | extern struct inode_operations sysv_dir_inode_operations; | 160 | extern struct inode_operations sysv_dir_inode_operations; |
161 | extern struct inode_operations sysv_fast_symlink_inode_operations; | 161 | extern struct inode_operations sysv_fast_symlink_inode_operations; |
162 | extern struct file_operations sysv_file_operations; | 162 | extern const struct file_operations sysv_file_operations; |
163 | extern struct file_operations sysv_dir_operations; | 163 | extern const struct file_operations sysv_dir_operations; |
164 | extern struct address_space_operations sysv_aops; | 164 | extern struct address_space_operations sysv_aops; |
165 | extern struct super_operations sysv_sops; | 165 | extern struct super_operations sysv_sops; |
166 | extern struct dentry_operations sysv_dentry_operations; | 166 | extern struct dentry_operations sysv_dentry_operations; |
diff --git a/fs/udf/dir.c b/fs/udf/dir.c index f5222527fe39..8c28efa3b8ff 100644 --- a/fs/udf/dir.c +++ b/fs/udf/dir.c | |||
@@ -42,7 +42,7 @@ static int do_udf_readdir(struct inode *, struct file *, filldir_t, void *); | |||
42 | 42 | ||
43 | /* readdir and lookup functions */ | 43 | /* readdir and lookup functions */ |
44 | 44 | ||
45 | struct file_operations udf_dir_operations = { | 45 | const struct file_operations udf_dir_operations = { |
46 | .read = generic_read_dir, | 46 | .read = generic_read_dir, |
47 | .readdir = udf_readdir, | 47 | .readdir = udf_readdir, |
48 | .ioctl = udf_ioctl, | 48 | .ioctl = udf_ioctl, |
diff --git a/fs/udf/file.c b/fs/udf/file.c index a6f2acc1f15c..e34b00e303f1 100644 --- a/fs/udf/file.c +++ b/fs/udf/file.c | |||
@@ -248,7 +248,7 @@ static int udf_release_file(struct inode * inode, struct file * filp) | |||
248 | return 0; | 248 | return 0; |
249 | } | 249 | } |
250 | 250 | ||
251 | struct file_operations udf_file_operations = { | 251 | const struct file_operations udf_file_operations = { |
252 | .read = generic_file_read, | 252 | .read = generic_file_read, |
253 | .ioctl = udf_ioctl, | 253 | .ioctl = udf_ioctl, |
254 | .open = generic_file_open, | 254 | .open = generic_file_open, |
diff --git a/fs/udf/udfdecl.h b/fs/udf/udfdecl.h index 1d5800e0cbe7..023e19ba5a2e 100644 --- a/fs/udf/udfdecl.h +++ b/fs/udf/udfdecl.h | |||
@@ -44,9 +44,9 @@ struct buffer_head; | |||
44 | struct super_block; | 44 | struct super_block; |
45 | 45 | ||
46 | extern struct inode_operations udf_dir_inode_operations; | 46 | extern struct inode_operations udf_dir_inode_operations; |
47 | extern struct file_operations udf_dir_operations; | 47 | extern const struct file_operations udf_dir_operations; |
48 | extern struct inode_operations udf_file_inode_operations; | 48 | extern struct inode_operations udf_file_inode_operations; |
49 | extern struct file_operations udf_file_operations; | 49 | extern const struct file_operations udf_file_operations; |
50 | extern struct address_space_operations udf_aops; | 50 | extern struct address_space_operations udf_aops; |
51 | extern struct address_space_operations udf_adinicb_aops; | 51 | extern struct address_space_operations udf_adinicb_aops; |
52 | extern struct address_space_operations udf_symlink_aops; | 52 | extern struct address_space_operations udf_symlink_aops; |
diff --git a/fs/ufs/dir.c b/fs/ufs/dir.c index 7c10c68902ae..1a561202d3f4 100644 --- a/fs/ufs/dir.c +++ b/fs/ufs/dir.c | |||
@@ -620,7 +620,7 @@ int ufs_empty_dir (struct inode * inode) | |||
620 | return 1; | 620 | return 1; |
621 | } | 621 | } |
622 | 622 | ||
623 | struct file_operations ufs_dir_operations = { | 623 | const struct file_operations ufs_dir_operations = { |
624 | .read = generic_read_dir, | 624 | .read = generic_read_dir, |
625 | .readdir = ufs_readdir, | 625 | .readdir = ufs_readdir, |
626 | .fsync = file_fsync, | 626 | .fsync = file_fsync, |
diff --git a/fs/ufs/file.c b/fs/ufs/file.c index 62ad481810ef..312fd3f86313 100644 --- a/fs/ufs/file.c +++ b/fs/ufs/file.c | |||
@@ -31,7 +31,7 @@ | |||
31 | * the ufs filesystem. | 31 | * the ufs filesystem. |
32 | */ | 32 | */ |
33 | 33 | ||
34 | struct file_operations ufs_file_operations = { | 34 | const struct file_operations ufs_file_operations = { |
35 | .llseek = generic_file_llseek, | 35 | .llseek = generic_file_llseek, |
36 | .read = generic_file_read, | 36 | .read = generic_file_read, |
37 | .write = generic_file_write, | 37 | .write = generic_file_write, |
diff --git a/fs/xfs/linux-2.6/xfs_file.c b/fs/xfs/linux-2.6/xfs_file.c index 185567a6a561..85997b1205f5 100644 --- a/fs/xfs/linux-2.6/xfs_file.c +++ b/fs/xfs/linux-2.6/xfs_file.c | |||
@@ -528,7 +528,7 @@ open_exec_out: | |||
528 | } | 528 | } |
529 | #endif /* HAVE_FOP_OPEN_EXEC */ | 529 | #endif /* HAVE_FOP_OPEN_EXEC */ |
530 | 530 | ||
531 | struct file_operations xfs_file_operations = { | 531 | const struct file_operations xfs_file_operations = { |
532 | .llseek = generic_file_llseek, | 532 | .llseek = generic_file_llseek, |
533 | .read = do_sync_read, | 533 | .read = do_sync_read, |
534 | .write = do_sync_write, | 534 | .write = do_sync_write, |
@@ -550,7 +550,7 @@ struct file_operations xfs_file_operations = { | |||
550 | #endif | 550 | #endif |
551 | }; | 551 | }; |
552 | 552 | ||
553 | struct file_operations xfs_invis_file_operations = { | 553 | const struct file_operations xfs_invis_file_operations = { |
554 | .llseek = generic_file_llseek, | 554 | .llseek = generic_file_llseek, |
555 | .read = do_sync_read, | 555 | .read = do_sync_read, |
556 | .write = do_sync_write, | 556 | .write = do_sync_write, |
@@ -570,7 +570,7 @@ struct file_operations xfs_invis_file_operations = { | |||
570 | }; | 570 | }; |
571 | 571 | ||
572 | 572 | ||
573 | struct file_operations xfs_dir_file_operations = { | 573 | const struct file_operations xfs_dir_file_operations = { |
574 | .read = generic_read_dir, | 574 | .read = generic_read_dir, |
575 | .readdir = xfs_file_readdir, | 575 | .readdir = xfs_file_readdir, |
576 | .unlocked_ioctl = xfs_file_ioctl, | 576 | .unlocked_ioctl = xfs_file_ioctl, |
diff --git a/fs/xfs/linux-2.6/xfs_iops.h b/fs/xfs/linux-2.6/xfs_iops.h index a8417d7af5f9..ad6173da5678 100644 --- a/fs/xfs/linux-2.6/xfs_iops.h +++ b/fs/xfs/linux-2.6/xfs_iops.h | |||
@@ -22,9 +22,9 @@ extern struct inode_operations xfs_inode_operations; | |||
22 | extern struct inode_operations xfs_dir_inode_operations; | 22 | extern struct inode_operations xfs_dir_inode_operations; |
23 | extern struct inode_operations xfs_symlink_inode_operations; | 23 | extern struct inode_operations xfs_symlink_inode_operations; |
24 | 24 | ||
25 | extern struct file_operations xfs_file_operations; | 25 | extern const struct file_operations xfs_file_operations; |
26 | extern struct file_operations xfs_dir_file_operations; | 26 | extern const struct file_operations xfs_dir_file_operations; |
27 | extern struct file_operations xfs_invis_file_operations; | 27 | extern const struct file_operations xfs_invis_file_operations; |
28 | 28 | ||
29 | extern int xfs_ioctl(struct bhv_desc *, struct inode *, struct file *, | 29 | extern int xfs_ioctl(struct bhv_desc *, struct inode *, struct file *, |
30 | int, unsigned int, void __user *); | 30 | int, unsigned int, void __user *); |