From: Arjan van de Ven 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 Signed-off-by: Andrew Morton --- drivers/misc/ibmasm/ibmasmfs.c | 2 +- fs/9p/v9fs_vfs.h | 4 ++-- fs/9p/vfs_dir.c | 2 +- fs/9p/vfs_file.c | 2 +- fs/adfs/adfs.h | 4 ++-- fs/adfs/dir.c | 2 +- fs/adfs/file.c | 2 +- fs/affs/affs.h | 6 +++--- fs/affs/dir.c | 2 +- fs/affs/file.c | 2 +- fs/afs/dir.c | 2 +- fs/afs/internal.h | 4 ++-- fs/afs/mntpt.c | 2 +- fs/afs/proc.c | 10 +++++----- fs/autofs/autofs_i.h | 2 +- fs/autofs/root.c | 2 +- fs/autofs4/autofs_i.h | 4 ++-- fs/autofs4/root.c | 4 ++-- fs/bad_inode.c | 2 +- fs/befs/linuxvfs.c | 2 +- fs/bfs/bfs.h | 4 ++-- fs/bfs/dir.c | 2 +- fs/bfs/file.c | 2 +- fs/binfmt_misc.c | 6 +++--- fs/block_dev.c | 2 +- fs/char_dev.c | 2 +- fs/cifs/cifsfs.c | 10 +++++----- fs/cifs/cifsfs.h | 10 +++++----- fs/coda/dir.c | 2 +- fs/coda/file.c | 2 +- fs/coda/pioctl.c | 2 +- fs/coda/psdev.c | 2 +- fs/configfs/configfs_internal.h | 6 +++--- fs/configfs/dir.c | 2 +- fs/configfs/file.c | 2 +- fs/cramfs/inode.c | 4 ++-- fs/debugfs/file.c | 4 ++-- fs/devfs/base.c | 12 ++++++------ fs/efs/dir.c | 2 +- fs/eventpoll.c | 2 +- fs/ext2/dir.c | 2 +- fs/ext2/ext2.h | 6 +++--- fs/ext2/file.c | 4 ++-- fs/ext3/dir.c | 2 +- fs/ext3/file.c | 2 +- fs/fat/dir.c | 2 +- fs/fat/file.c | 2 +- fs/fifo.c | 2 +- fs/freevxfs/vxfs_extern.h | 2 +- fs/freevxfs/vxfs_lookup.c | 2 +- fs/fuse/dev.c | 2 +- fs/fuse/dir.c | 2 +- fs/fuse/file.c | 6 +++--- fs/fuse/fuse_i.h | 2 +- fs/hfs/dir.c | 2 +- fs/hfs/hfs_fs.h | 2 +- fs/hfs/inode.c | 4 ++-- fs/hfsplus/dir.c | 2 +- fs/hfsplus/inode.c | 2 +- fs/hostfs/hostfs_kern.c | 4 ++-- fs/hpfs/dir.c | 2 +- fs/hpfs/file.c | 2 +- fs/hpfs/hpfs_fn.h | 4 ++-- fs/hppfs/hppfs_kern.c | 4 ++-- fs/hugetlbfs/inode.c | 4 ++-- fs/inotify.c | 2 +- fs/isofs/dir.c | 2 +- fs/isofs/isofs.h | 2 +- fs/jffs/inode-v23.c | 8 ++++---- fs/jffs2/dir.c | 2 +- fs/jffs2/file.c | 2 +- fs/jffs2/os-linux.h | 4 ++-- fs/jfs/file.c | 2 +- fs/jfs/jfs_inode.h | 4 ++-- fs/jfs/namei.c | 2 +- fs/libfs.c | 2 +- fs/minix/dir.c | 2 +- fs/minix/file.c | 2 +- fs/minix/minix.h | 4 ++-- fs/ncpfs/dir.c | 2 +- fs/ncpfs/file.c | 2 +- fs/nfs/dir.c | 2 +- fs/nfs/file.c | 2 +- fs/nfsd/nfsctl.c | 4 ++-- fs/nfsd/stats.c | 2 +- fs/ntfs/dir.c | 2 +- fs/ntfs/file.c | 4 ++-- fs/ntfs/ntfs.h | 6 +++--- fs/ocfs2/dlmglue.c | 2 +- fs/ocfs2/file.c | 4 ++-- fs/ocfs2/file.h | 4 ++-- fs/openpromfs/inode.c | 6 +++--- fs/pipe.c | 12 ++++++------ fs/proc/kcore.c | 2 +- fs/proc/kmsg.c | 2 +- fs/proc/vmcore.c | 2 +- fs/qnx4/dir.c | 2 +- fs/qnx4/file.c | 2 +- fs/ramfs/file-mmu.c | 2 +- fs/ramfs/file-nommu.c | 2 +- fs/ramfs/internal.h | 2 +- fs/read_write.c | 2 +- fs/reiserfs/dir.c | 2 +- fs/reiserfs/file.c | 2 +- fs/reiserfs/procfs.c | 2 +- fs/romfs/inode.c | 2 +- fs/smbfs/dir.c | 2 +- fs/smbfs/file.c | 2 +- fs/smbfs/proto.h | 4 ++-- fs/sysfs/bin.c | 2 +- fs/sysfs/dir.c | 2 +- fs/sysfs/file.c | 2 +- fs/sysfs/sysfs.h | 6 +++--- fs/sysv/dir.c | 2 +- fs/sysv/file.c | 2 +- fs/sysv/sysv.h | 4 ++-- fs/udf/dir.c | 2 +- fs/udf/file.c | 2 +- fs/udf/udfdecl.h | 4 ++-- fs/ufs/dir.c | 2 +- fs/ufs/file.c | 2 +- fs/xfs/linux-2.6/xfs_file.c | 6 +++--- fs/xfs/linux-2.6/xfs_iops.h | 6 +++--- include/linux/coda_linux.h | 6 +++--- include/linux/crash_dump.h | 2 +- include/linux/efs_fs.h | 2 +- include/linux/ext3_fs.h | 4 ++-- include/linux/fs.h | 26 +++++++++++++------------- include/linux/hugetlb.h | 2 +- include/linux/msdos_fs.h | 4 ++-- include/linux/ncp_fs.h | 4 ++-- include/linux/nfs_fs.h | 4 ++-- include/linux/proc_fs.h | 6 +++--- include/linux/qnx4_fs.h | 4 ++-- include/linux/ramfs.h | 2 +- include/linux/reiserfs_fs.h | 4 ++-- include/linux/ufs_fs.h | 4 ++-- net/nonet.c | 2 +- net/socket.c | 2 +- 139 files changed, 231 insertions(+), 231 deletions(-) diff -puN drivers/misc/ibmasm/ibmasmfs.c~make-most-file-operations-structs-in-fs-const drivers/misc/ibmasm/ibmasmfs.c --- devel/drivers/misc/ibmasm/ibmasmfs.c~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/drivers/misc/ibmasm/ibmasmfs.c 2006-02-27 20:59:08.000000000 -0800 @@ -101,7 +101,7 @@ static struct super_operations ibmasmfs_ .drop_inode = generic_delete_inode, }; -static struct file_operations *ibmasmfs_dir_ops = &simple_dir_operations; +static const struct file_operations *ibmasmfs_dir_ops = &simple_dir_operations; static struct file_system_type ibmasmfs_type = { .owner = THIS_MODULE, diff -puN fs/9p/v9fs_vfs.h~make-most-file-operations-structs-in-fs-const fs/9p/v9fs_vfs.h --- devel/fs/9p/v9fs_vfs.h~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/9p/v9fs_vfs.h 2006-02-27 20:59:08.000000000 -0800 @@ -40,8 +40,8 @@ extern struct file_system_type v9fs_fs_type; extern struct address_space_operations v9fs_addr_operations; -extern struct file_operations v9fs_file_operations; -extern struct file_operations v9fs_dir_operations; +extern const struct file_operations v9fs_file_operations; +extern const struct file_operations v9fs_dir_operations; extern struct dentry_operations v9fs_dentry_operations; struct inode *v9fs_get_inode(struct super_block *sb, int mode); diff -puN fs/9p/vfs_dir.c~make-most-file-operations-structs-in-fs-const fs/9p/vfs_dir.c --- devel/fs/9p/vfs_dir.c~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/9p/vfs_dir.c 2006-02-27 20:59:08.000000000 -0800 @@ -206,7 +206,7 @@ int v9fs_dir_release(struct inode *inode return 0; } -struct file_operations v9fs_dir_operations = { +const struct file_operations v9fs_dir_operations = { .read = generic_read_dir, .readdir = v9fs_dir_readdir, .open = v9fs_file_open, diff -puN fs/9p/vfs_file.c~make-most-file-operations-structs-in-fs-const fs/9p/vfs_file.c --- devel/fs/9p/vfs_file.c~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/9p/vfs_file.c 2006-02-27 20:59:08.000000000 -0800 @@ -295,7 +295,7 @@ v9fs_file_write(struct file *filp, const return total; } -struct file_operations v9fs_file_operations = { +const struct file_operations v9fs_file_operations = { .llseek = generic_file_llseek, .read = v9fs_file_read, .write = v9fs_file_write, diff -puN fs/adfs/adfs.h~make-most-file-operations-structs-in-fs-const fs/adfs/adfs.h --- devel/fs/adfs/adfs.h~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/adfs/adfs.h 2006-02-27 20:59:08.000000000 -0800 @@ -85,7 +85,7 @@ void __adfs_error(struct super_block *sb /* dir_*.c */ extern struct inode_operations adfs_dir_inode_operations; -extern struct file_operations adfs_dir_operations; +extern const struct file_operations adfs_dir_operations; extern struct dentry_operations adfs_dentry_operations; extern struct adfs_dir_ops adfs_f_dir_ops; extern struct adfs_dir_ops adfs_fplus_dir_ops; @@ -94,7 +94,7 @@ extern int adfs_dir_update(struct super_ /* file.c */ extern struct inode_operations adfs_file_inode_operations; -extern struct file_operations adfs_file_operations; +extern const struct file_operations adfs_file_operations; static inline __u32 signed_asl(__u32 val, signed int shift) { diff -puN fs/adfs/dir.c~make-most-file-operations-structs-in-fs-const fs/adfs/dir.c --- devel/fs/adfs/dir.c~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/adfs/dir.c 2006-02-27 20:59:08.000000000 -0800 @@ -196,7 +196,7 @@ out: return ret; } -struct file_operations adfs_dir_operations = { +const struct file_operations adfs_dir_operations = { .read = generic_read_dir, .readdir = adfs_readdir, .fsync = file_fsync, diff -puN fs/adfs/file.c~make-most-file-operations-structs-in-fs-const fs/adfs/file.c --- devel/fs/adfs/file.c~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/adfs/file.c 2006-02-27 20:59:08.000000000 -0800 @@ -25,7 +25,7 @@ #include "adfs.h" -struct file_operations adfs_file_operations = { +const struct file_operations adfs_file_operations = { .llseek = generic_file_llseek, .read = generic_file_read, .mmap = generic_file_mmap, diff -puN fs/affs/affs.h~make-most-file-operations-structs-in-fs-const fs/affs/affs.h --- devel/fs/affs/affs.h~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/affs/affs.h 2006-02-27 20:59:08.000000000 -0800 @@ -192,9 +192,9 @@ extern void affs_dir_truncate(struct i extern struct inode_operations affs_file_inode_operations; extern struct inode_operations affs_dir_inode_operations; extern struct inode_operations affs_symlink_inode_operations; -extern struct file_operations affs_file_operations; -extern struct file_operations affs_file_operations_ofs; -extern struct file_operations affs_dir_operations; +extern const struct file_operations affs_file_operations; +extern const struct file_operations affs_file_operations_ofs; +extern const struct file_operations affs_dir_operations; extern struct address_space_operations affs_symlink_aops; extern struct address_space_operations affs_aops; extern struct address_space_operations affs_aops_ofs; diff -puN fs/affs/dir.c~make-most-file-operations-structs-in-fs-const fs/affs/dir.c --- devel/fs/affs/dir.c~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/affs/dir.c 2006-02-27 20:59:08.000000000 -0800 @@ -17,7 +17,7 @@ static int affs_readdir(struct file *, void *, filldir_t); -struct file_operations affs_dir_operations = { +const struct file_operations affs_dir_operations = { .read = generic_read_dir, .readdir = affs_readdir, .fsync = file_fsync, diff -puN fs/affs/file.c~make-most-file-operations-structs-in-fs-const fs/affs/file.c --- devel/fs/affs/file.c~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/affs/file.c 2006-02-27 20:59:08.000000000 -0800 @@ -25,7 +25,7 @@ static struct buffer_head *affs_get_extb static int affs_file_open(struct inode *inode, struct file *filp); static int affs_file_release(struct inode *inode, struct file *filp); -struct file_operations affs_file_operations = { +const struct file_operations affs_file_operations = { .llseek = generic_file_llseek, .read = generic_file_read, .write = generic_file_write, diff -puN fs/afs/dir.c~make-most-file-operations-structs-in-fs-const fs/afs/dir.c --- devel/fs/afs/dir.c~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/afs/dir.c 2006-02-27 20:59:08.000000000 -0800 @@ -32,7 +32,7 @@ static int afs_d_delete(struct dentry *d static int afs_dir_lookup_filldir(void *_cookie, const char *name, int nlen, loff_t fpos, ino_t ino, unsigned dtype); -struct file_operations afs_dir_file_operations = { +const struct file_operations afs_dir_file_operations = { .open = afs_dir_open, .readdir = afs_dir_readdir, }; diff -puN fs/afs/internal.h~make-most-file-operations-structs-in-fs-const fs/afs/internal.h --- devel/fs/afs/internal.h~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/afs/internal.h 2006-02-27 20:59:08.000000000 -0800 @@ -64,7 +64,7 @@ extern struct cachefs_index_def afs_cach * dir.c */ extern struct inode_operations afs_dir_inode_operations; -extern struct file_operations afs_dir_file_operations; +extern const struct file_operations afs_dir_file_operations; /* * file.c @@ -105,7 +105,7 @@ extern struct cachefs_netfs afs_cache_ne * mntpt.c */ extern struct inode_operations afs_mntpt_inode_operations; -extern struct file_operations afs_mntpt_file_operations; +extern const struct file_operations afs_mntpt_file_operations; extern struct afs_timer afs_mntpt_expiry_timer; extern struct afs_timer_ops afs_mntpt_expiry_timer_ops; extern unsigned long afs_mntpt_expiry_timeout; diff -puN fs/afs/mntpt.c~make-most-file-operations-structs-in-fs-const fs/afs/mntpt.c --- devel/fs/afs/mntpt.c~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/afs/mntpt.c 2006-02-27 20:59:08.000000000 -0800 @@ -32,7 +32,7 @@ static struct dentry *afs_mntpt_lookup(s static int afs_mntpt_open(struct inode *inode, struct file *file); static void *afs_mntpt_follow_link(struct dentry *dentry, struct nameidata *nd); -struct file_operations afs_mntpt_file_operations = { +const struct file_operations afs_mntpt_file_operations = { .open = afs_mntpt_open, }; diff -puN fs/afs/proc.c~make-most-file-operations-structs-in-fs-const fs/afs/proc.c --- devel/fs/afs/proc.c~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/afs/proc.c 2006-02-27 20:59:08.000000000 -0800 @@ -37,7 +37,7 @@ static struct seq_operations afs_proc_ce .show = afs_proc_cells_show, }; -static struct file_operations afs_proc_cells_fops = { +static const struct file_operations afs_proc_cells_fops = { .open = afs_proc_cells_open, .read = seq_read, .write = afs_proc_cells_write, @@ -53,7 +53,7 @@ static ssize_t afs_proc_rootcell_write(s const char __user *buf, size_t size, loff_t *_pos); -static struct file_operations afs_proc_rootcell_fops = { +static const struct file_operations afs_proc_rootcell_fops = { .open = afs_proc_rootcell_open, .read = afs_proc_rootcell_read, .write = afs_proc_rootcell_write, @@ -77,7 +77,7 @@ static struct seq_operations afs_proc_ce .show = afs_proc_cell_volumes_show, }; -static struct file_operations afs_proc_cell_volumes_fops = { +static const struct file_operations afs_proc_cell_volumes_fops = { .open = afs_proc_cell_volumes_open, .read = seq_read, .llseek = seq_lseek, @@ -101,7 +101,7 @@ static struct seq_operations afs_proc_ce .show = afs_proc_cell_vlservers_show, }; -static struct file_operations afs_proc_cell_vlservers_fops = { +static const struct file_operations afs_proc_cell_vlservers_fops = { .open = afs_proc_cell_vlservers_open, .read = seq_read, .llseek = seq_lseek, @@ -124,7 +124,7 @@ static struct seq_operations afs_proc_ce .show = afs_proc_cell_servers_show, }; -static struct file_operations afs_proc_cell_servers_fops = { +static const struct file_operations afs_proc_cell_servers_fops = { .open = afs_proc_cell_servers_open, .read = seq_read, .llseek = seq_lseek, diff -puN fs/autofs4/autofs_i.h~make-most-file-operations-structs-in-fs-const fs/autofs4/autofs_i.h --- devel/fs/autofs4/autofs_i.h~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/autofs4/autofs_i.h 2006-02-27 20:59:08.000000000 -0800 @@ -176,8 +176,8 @@ extern struct inode_operations autofs4_d extern struct inode_operations autofs4_root_inode_operations; extern struct inode_operations autofs4_indirect_root_inode_operations; extern struct inode_operations autofs4_direct_root_inode_operations; -extern struct file_operations autofs4_dir_operations; -extern struct file_operations autofs4_root_operations; +extern const struct file_operations autofs4_dir_operations; +extern const struct file_operations autofs4_root_operations; /* Initializing function */ diff -puN fs/autofs4/root.c~make-most-file-operations-structs-in-fs-const fs/autofs4/root.c --- devel/fs/autofs4/root.c~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/autofs4/root.c 2006-02-27 20:59:08.000000000 -0800 @@ -32,7 +32,7 @@ static int autofs4_root_readdir(struct f static struct dentry *autofs4_lookup(struct inode *,struct dentry *, struct nameidata *); static void *autofs4_follow_link(struct dentry *, struct nameidata *); -struct file_operations autofs4_root_operations = { +const struct file_operations autofs4_root_operations = { .open = dcache_dir_open, .release = dcache_dir_close, .read = generic_read_dir, @@ -40,7 +40,7 @@ struct file_operations autofs4_root_oper .ioctl = autofs4_root_ioctl, }; -struct file_operations autofs4_dir_operations = { +const struct file_operations autofs4_dir_operations = { .open = autofs4_dir_open, .release = autofs4_dir_close, .read = generic_read_dir, diff -puN fs/autofs/autofs_i.h~make-most-file-operations-structs-in-fs-const fs/autofs/autofs_i.h --- devel/fs/autofs/autofs_i.h~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/autofs/autofs_i.h 2006-02-27 20:59:08.000000000 -0800 @@ -146,7 +146,7 @@ struct autofs_dir_ent *autofs_expire(str extern struct inode_operations autofs_root_inode_operations; extern struct inode_operations autofs_symlink_inode_operations; -extern struct file_operations autofs_root_operations; +extern const struct file_operations autofs_root_operations; /* Initializing function */ diff -puN fs/autofs/root.c~make-most-file-operations-structs-in-fs-const fs/autofs/root.c --- devel/fs/autofs/root.c~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/autofs/root.c 2006-02-27 20:59:08.000000000 -0800 @@ -26,7 +26,7 @@ static int autofs_root_rmdir(struct inod static int autofs_root_mkdir(struct inode *,struct dentry *,int); static int autofs_root_ioctl(struct inode *, struct file *,unsigned int,unsigned long); -struct file_operations autofs_root_operations = { +const struct file_operations autofs_root_operations = { .read = generic_read_dir, .readdir = autofs_root_readdir, .ioctl = autofs_root_ioctl, diff -puN fs/bad_inode.c~make-most-file-operations-structs-in-fs-const fs/bad_inode.c --- devel/fs/bad_inode.c~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/bad_inode.c 2006-02-27 20:59:08.000000000 -0800 @@ -22,7 +22,7 @@ static int return_EIO(void) #define EIO_ERROR ((void *) (return_EIO)) -static struct file_operations bad_file_ops = +static const struct file_operations bad_file_ops = { .llseek = EIO_ERROR, .aio_read = EIO_ERROR, diff -puN fs/befs/linuxvfs.c~make-most-file-operations-structs-in-fs-const fs/befs/linuxvfs.c --- devel/fs/befs/linuxvfs.c~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/befs/linuxvfs.c 2006-02-27 20:59:08.000000000 -0800 @@ -64,7 +64,7 @@ static const struct super_operations bef /* slab cache for befs_inode_info objects */ static kmem_cache_t *befs_inode_cachep; -static struct file_operations befs_dir_operations = { +static const struct file_operations befs_dir_operations = { .read = generic_read_dir, .readdir = befs_readdir, }; diff -puN fs/bfs/bfs.h~make-most-file-operations-structs-in-fs-const fs/bfs/bfs.h --- devel/fs/bfs/bfs.h~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/bfs/bfs.h 2006-02-27 20:59:08.000000000 -0800 @@ -49,11 +49,11 @@ static inline struct bfs_inode_info *BFS /* file.c */ extern struct inode_operations bfs_file_inops; -extern struct file_operations bfs_file_operations; +extern const struct file_operations bfs_file_operations; extern struct address_space_operations bfs_aops; /* dir.c */ extern struct inode_operations bfs_dir_inops; -extern struct file_operations bfs_dir_operations; +extern const struct file_operations bfs_dir_operations; #endif /* _FS_BFS_BFS_H */ diff -puN fs/bfs/dir.c~make-most-file-operations-structs-in-fs-const fs/bfs/dir.c --- devel/fs/bfs/dir.c~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/bfs/dir.c 2006-02-27 20:59:08.000000000 -0800 @@ -70,7 +70,7 @@ static int bfs_readdir(struct file * f, return 0; } -struct file_operations bfs_dir_operations = { +const struct file_operations bfs_dir_operations = { .read = generic_read_dir, .readdir = bfs_readdir, .fsync = file_fsync, diff -puN fs/bfs/file.c~make-most-file-operations-structs-in-fs-const fs/bfs/file.c --- devel/fs/bfs/file.c~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/bfs/file.c 2006-02-27 20:59:08.000000000 -0800 @@ -17,7 +17,7 @@ #define dprintf(x...) #endif -struct file_operations bfs_file_operations = { +const struct file_operations bfs_file_operations = { .llseek = generic_file_llseek, .read = generic_file_read, .write = generic_file_write, diff -puN fs/binfmt_misc.c~make-most-file-operations-structs-in-fs-const fs/binfmt_misc.c --- devel/fs/binfmt_misc.c~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/binfmt_misc.c 2006-02-27 20:59:08.000000000 -0800 @@ -600,7 +600,7 @@ static ssize_t bm_entry_write(struct fil return count; } -static struct file_operations bm_entry_operations = { +static const struct file_operations bm_entry_operations = { .read = bm_entry_read, .write = bm_entry_write, }; @@ -668,7 +668,7 @@ out: return count; } -static struct file_operations bm_register_operations = { +static const struct file_operations bm_register_operations = { .write = bm_register_write, }; @@ -715,7 +715,7 @@ static ssize_t bm_status_write(struct fi return count; } -static struct file_operations bm_status_operations = { +static const struct file_operations bm_status_operations = { .read = bm_status_read, .write = bm_status_write, }; diff -puN fs/block_dev.c~make-most-file-operations-structs-in-fs-const fs/block_dev.c --- devel/fs/block_dev.c~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/block_dev.c 2006-02-27 20:59:08.000000000 -0800 @@ -789,7 +789,7 @@ struct address_space_operations def_blk_ .direct_IO = blkdev_direct_IO, }; -struct file_operations def_blk_fops = { +const struct file_operations def_blk_fops = { .open = blkdev_open, .release = blkdev_close, .llseek = block_llseek, diff -puN fs/char_dev.c~make-most-file-operations-structs-in-fs-const fs/char_dev.c --- devel/fs/char_dev.c~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/char_dev.c 2006-02-27 20:59:08.000000000 -0800 @@ -408,7 +408,7 @@ static void cdev_purge(struct cdev *cdev * is contain the open that then fills in the correct operations * depending on the special file... */ -struct file_operations def_chr_fops = { +const struct file_operations def_chr_fops = { .open = chrdev_open, }; diff -puN fs/cifs/cifsfs.c~make-most-file-operations-structs-in-fs-const fs/cifs/cifsfs.c --- devel/fs/cifs/cifsfs.c~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/cifs/cifsfs.c 2006-02-27 20:59:08.000000000 -0800 @@ -580,7 +580,7 @@ struct inode_operations cifs_symlink_ino #endif }; -struct file_operations cifs_file_ops = { +const struct file_operations cifs_file_ops = { .read = do_sync_read, .write = do_sync_write, .readv = generic_file_readv, @@ -604,7 +604,7 @@ struct file_operations cifs_file_ops = { #endif /* CONFIG_CIFS_EXPERIMENTAL */ }; -struct file_operations cifs_file_direct_ops = { +const struct file_operations cifs_file_direct_ops = { /* no mmap, no aio, no readv - BB reevaluate whether they can be done with directio, no cache */ .read = cifs_user_read, @@ -623,7 +623,7 @@ struct file_operations cifs_file_direct_ .dir_notify = cifs_dir_notify, #endif /* CONFIG_CIFS_EXPERIMENTAL */ }; -struct file_operations cifs_file_nobrl_ops = { +const struct file_operations cifs_file_nobrl_ops = { .read = do_sync_read, .write = do_sync_write, .readv = generic_file_readv, @@ -646,7 +646,7 @@ struct file_operations cifs_file_nobrl_o #endif /* CONFIG_CIFS_EXPERIMENTAL */ }; -struct file_operations cifs_file_direct_nobrl_ops = { +const struct file_operations cifs_file_direct_nobrl_ops = { /* no mmap, no aio, no readv - BB reevaluate whether they can be done with directio, no cache */ .read = cifs_user_read, @@ -665,7 +665,7 @@ struct file_operations cifs_file_direct_ #endif /* CONFIG_CIFS_EXPERIMENTAL */ }; -struct file_operations cifs_dir_ops = { +const struct file_operations cifs_dir_ops = { .readdir = cifs_readdir, .release = cifs_closedir, .read = generic_read_dir, diff -puN fs/cifs/cifsfs.h~make-most-file-operations-structs-in-fs-const fs/cifs/cifsfs.h --- devel/fs/cifs/cifsfs.h~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/cifs/cifsfs.h 2006-02-27 20:59:08.000000000 -0800 @@ -61,10 +61,10 @@ extern struct inode_operations cifs_file extern struct inode_operations cifs_symlink_inode_ops; /* Functions related to files and directories */ -extern struct file_operations cifs_file_ops; -extern struct file_operations cifs_file_direct_ops; /* if directio mount */ -extern struct file_operations cifs_file_nobrl_ops; -extern struct file_operations cifs_file_direct_nobrl_ops; /* if directio mount */ +extern const struct file_operations cifs_file_ops; +extern const struct file_operations cifs_file_direct_ops; /* if directio mount */ +extern const struct file_operations cifs_file_nobrl_ops; +extern const struct file_operations cifs_file_direct_nobrl_ops; /* if directio mount */ extern int cifs_open(struct inode *inode, struct file *file); extern int cifs_close(struct inode *inode, struct file *file); extern int cifs_closedir(struct inode *inode, struct file *file); @@ -76,7 +76,7 @@ extern int cifs_lock(struct file *, int, extern int cifs_fsync(struct file *, struct dentry *, int); extern int cifs_flush(struct file *); extern int cifs_file_mmap(struct file * , struct vm_area_struct *); -extern struct file_operations cifs_dir_ops; +extern const struct file_operations cifs_dir_ops; extern int cifs_dir_open(struct inode *inode, struct file *file); extern int cifs_readdir(struct file *file, void *direntry, filldir_t filldir); extern int cifs_dir_notify(struct file *, unsigned long arg); diff -puN fs/coda/dir.c~make-most-file-operations-structs-in-fs-const fs/coda/dir.c --- devel/fs/coda/dir.c~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/coda/dir.c 2006-02-27 20:59:08.000000000 -0800 @@ -82,7 +82,7 @@ struct inode_operations coda_dir_inode_o .setattr = coda_setattr, }; -struct file_operations coda_dir_operations = { +const struct file_operations coda_dir_operations = { .llseek = generic_file_llseek, .read = generic_read_dir, .readdir = coda_readdir, diff -puN fs/coda/file.c~make-most-file-operations-structs-in-fs-const fs/coda/file.c --- devel/fs/coda/file.c~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/coda/file.c 2006-02-27 20:59:08.000000000 -0800 @@ -288,7 +288,7 @@ int coda_fsync(struct file *coda_file, s return err; } -struct file_operations coda_file_operations = { +const struct file_operations coda_file_operations = { .llseek = generic_file_llseek, .read = coda_file_read, .write = coda_file_write, diff -puN fs/coda/pioctl.c~make-most-file-operations-structs-in-fs-const fs/coda/pioctl.c --- devel/fs/coda/pioctl.c~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/coda/pioctl.c 2006-02-27 20:59:08.000000000 -0800 @@ -36,7 +36,7 @@ struct inode_operations coda_ioctl_inode .setattr = coda_setattr, }; -struct file_operations coda_ioctl_operations = { +const struct file_operations coda_ioctl_operations = { .owner = THIS_MODULE, .ioctl = coda_pioctl, }; diff -puN fs/coda/psdev.c~make-most-file-operations-structs-in-fs-const fs/coda/psdev.c --- devel/fs/coda/psdev.c~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/coda/psdev.c 2006-02-27 20:59:08.000000000 -0800 @@ -342,7 +342,7 @@ static int coda_psdev_release(struct ino } -static struct file_operations coda_psdev_fops = { +static const struct file_operations coda_psdev_fops = { .owner = THIS_MODULE, .read = coda_psdev_read, .write = coda_psdev_write, diff -puN fs/configfs/configfs_internal.h~make-most-file-operations-structs-in-fs-const fs/configfs/configfs_internal.h --- devel/fs/configfs/configfs_internal.h~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/configfs/configfs_internal.h 2006-02-27 20:59:08.000000000 -0800 @@ -72,9 +72,9 @@ extern void configfs_release_fs(void); extern struct rw_semaphore configfs_rename_sem; extern struct super_block * configfs_sb; -extern struct file_operations configfs_dir_operations; -extern struct file_operations configfs_file_operations; -extern struct file_operations bin_fops; +extern const struct file_operations configfs_dir_operations; +extern const struct file_operations configfs_file_operations; +extern const struct file_operations bin_fops; extern struct inode_operations configfs_dir_inode_operations; extern struct inode_operations configfs_symlink_inode_operations; diff -puN fs/configfs/dir.c~make-most-file-operations-structs-in-fs-const fs/configfs/dir.c --- devel/fs/configfs/dir.c~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/configfs/dir.c 2006-02-27 20:59:08.000000000 -0800 @@ -1027,7 +1027,7 @@ static loff_t configfs_dir_lseek(struct return offset; } -struct file_operations configfs_dir_operations = { +const struct file_operations configfs_dir_operations = { .open = configfs_dir_open, .release = configfs_dir_close, .llseek = configfs_dir_lseek, diff -puN fs/configfs/file.c~make-most-file-operations-structs-in-fs-const fs/configfs/file.c --- devel/fs/configfs/file.c~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/configfs/file.c 2006-02-27 20:59:08.000000000 -0800 @@ -322,7 +322,7 @@ static int configfs_release(struct inode return 0; } -struct file_operations configfs_file_operations = { +const struct file_operations configfs_file_operations = { .read = configfs_read_file, .write = configfs_write_file, .llseek = generic_file_llseek, diff -puN fs/cramfs/inode.c~make-most-file-operations-structs-in-fs-const fs/cramfs/inode.c --- devel/fs/cramfs/inode.c~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/cramfs/inode.c 2006-02-27 20:59:08.000000000 -0800 @@ -29,7 +29,7 @@ static struct super_operations cramfs_ops; static struct inode_operations cramfs_dir_inode_operations; -static struct file_operations cramfs_directory_operations; +static const struct file_operations cramfs_directory_operations; static struct address_space_operations cramfs_aops; static DEFINE_MUTEX(read_mutex); @@ -514,7 +514,7 @@ static struct address_space_operations c /* * A directory can only readdir */ -static struct file_operations cramfs_directory_operations = { +static const struct file_operations cramfs_directory_operations = { .llseek = generic_file_llseek, .read = generic_read_dir, .readdir = cramfs_readdir, diff -puN fs/debugfs/file.c~make-most-file-operations-structs-in-fs-const fs/debugfs/file.c --- devel/fs/debugfs/file.c~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/debugfs/file.c 2006-02-27 20:59:08.000000000 -0800 @@ -39,7 +39,7 @@ static int default_open(struct inode *in return 0; } -struct file_operations debugfs_file_operations = { +const struct file_operations debugfs_file_operations = { .read = default_read_file, .write = default_write_file, .open = default_open, @@ -213,7 +213,7 @@ static ssize_t write_file_bool(struct fi return count; } -static struct file_operations fops_bool = { +static const struct file_operations fops_bool = { .read = read_file_bool, .write = write_file_bool, .open = default_open, diff -puN fs/devfs/base.c~make-most-file-operations-structs-in-fs-const fs/devfs/base.c --- devel/fs/devfs/base.c~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/devfs/base.c 2006-02-27 20:59:09.000000000 -0800 @@ -856,14 +856,14 @@ static int devfsd_close(struct inode *in #ifdef CONFIG_DEVFS_DEBUG static ssize_t stat_read(struct file *file, char __user *buf, size_t len, loff_t * ppos); -static struct file_operations stat_fops = { +static const struct file_operations stat_fops = { .open = nonseekable_open, .read = stat_read, }; #endif /* Devfs daemon file operations */ -static struct file_operations devfsd_fops = { +static const struct file_operations devfsd_fops = { .open = nonseekable_open, .read = devfsd_read, .ioctl = devfsd_ioctl, @@ -1842,8 +1842,8 @@ static int try_modload(struct devfs_entr static struct inode_operations devfs_iops; static struct inode_operations devfs_dir_iops; -static struct file_operations devfs_fops; -static struct file_operations devfs_dir_fops; +static const struct file_operations devfs_fops; +static const struct file_operations devfs_dir_fops; static struct inode_operations devfs_symlink_iops; static int devfs_notify_change(struct dentry *dentry, struct iattr *iattr) @@ -2061,11 +2061,11 @@ static int devfs_open(struct inode *inod return err; } /* End Function devfs_open */ -static struct file_operations devfs_fops = { +static const struct file_operations devfs_fops = { .open = devfs_open, }; -static struct file_operations devfs_dir_fops = { +static const struct file_operations devfs_dir_fops = { .read = generic_read_dir, .readdir = devfs_readdir, }; diff -puN fs/efs/dir.c~make-most-file-operations-structs-in-fs-const fs/efs/dir.c --- devel/fs/efs/dir.c~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/efs/dir.c 2006-02-27 20:59:09.000000000 -0800 @@ -10,7 +10,7 @@ static int efs_readdir(struct file *, void *, filldir_t); -struct file_operations efs_dir_operations = { +const struct file_operations efs_dir_operations = { .read = generic_read_dir, .readdir = efs_readdir, }; diff -puN fs/eventpoll.c~make-most-file-operations-structs-in-fs-const fs/eventpoll.c --- devel/fs/eventpoll.c~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/eventpoll.c 2006-02-27 20:59:09.000000000 -0800 @@ -290,7 +290,7 @@ static kmem_cache_t *pwq_cache; static struct vfsmount *eventpoll_mnt; /* File callbacks that implement the eventpoll file behaviour */ -static struct file_operations eventpoll_fops = { +static const struct file_operations eventpoll_fops = { .release = ep_eventpoll_close, .poll = ep_eventpoll_poll }; diff -puN fs/ext2/dir.c~make-most-file-operations-structs-in-fs-const fs/ext2/dir.c --- devel/fs/ext2/dir.c~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/ext2/dir.c 2006-02-27 20:59:09.000000000 -0800 @@ -664,7 +664,7 @@ not_empty: return 0; } -struct file_operations ext2_dir_operations = { +const struct file_operations ext2_dir_operations = { .llseek = generic_file_llseek, .read = generic_read_dir, .readdir = ext2_readdir, diff -puN fs/ext2/ext2.h~make-most-file-operations-structs-in-fs-const fs/ext2/ext2.h --- devel/fs/ext2/ext2.h~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/ext2/ext2.h 2006-02-27 20:59:09.000000000 -0800 @@ -154,12 +154,12 @@ extern void ext2_write_super (struct sup */ /* dir.c */ -extern struct file_operations ext2_dir_operations; +extern const struct file_operations ext2_dir_operations; /* file.c */ extern struct inode_operations ext2_file_inode_operations; -extern struct file_operations ext2_file_operations; -extern struct file_operations ext2_xip_file_operations; +extern const struct file_operations ext2_file_operations; +extern const struct file_operations ext2_xip_file_operations; /* inode.c */ extern struct address_space_operations ext2_aops; diff -puN fs/ext2/file.c~make-most-file-operations-structs-in-fs-const fs/ext2/file.c --- devel/fs/ext2/file.c~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/ext2/file.c 2006-02-27 20:59:09.000000000 -0800 @@ -39,7 +39,7 @@ static int ext2_release_file (struct ino * We have mostly NULL's here: the current defaults are ok for * the ext2 filesystem. */ -struct file_operations ext2_file_operations = { +const struct file_operations ext2_file_operations = { .llseek = generic_file_llseek, .read = generic_file_read, .write = generic_file_write, @@ -56,7 +56,7 @@ struct file_operations ext2_file_operati }; #ifdef CONFIG_EXT2_FS_XIP -struct file_operations ext2_xip_file_operations = { +const struct file_operations ext2_xip_file_operations = { .llseek = generic_file_llseek, .read = xip_file_read, .write = xip_file_write, diff -puN fs/ext3/dir.c~make-most-file-operations-structs-in-fs-const fs/ext3/dir.c --- devel/fs/ext3/dir.c~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/ext3/dir.c 2006-02-27 20:59:09.000000000 -0800 @@ -39,7 +39,7 @@ static int ext3_dx_readdir(struct file * static int ext3_release_dir (struct inode * inode, struct file * filp); -struct file_operations ext3_dir_operations = { +const struct file_operations ext3_dir_operations = { .llseek = generic_file_llseek, .read = generic_read_dir, .readdir = ext3_readdir, /* we take BKL. needed?*/ diff -puN fs/ext3/file.c~make-most-file-operations-structs-in-fs-const fs/ext3/file.c --- devel/fs/ext3/file.c~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/ext3/file.c 2006-02-27 20:59:09.000000000 -0800 @@ -105,7 +105,7 @@ force_commit: return ret; } -struct file_operations ext3_file_operations = { +const struct file_operations ext3_file_operations = { .llseek = generic_file_llseek, .read = do_sync_read, .write = do_sync_write, diff -puN fs/fat/dir.c~make-most-file-operations-structs-in-fs-const fs/fat/dir.c --- devel/fs/fat/dir.c~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/fat/dir.c 2006-02-27 20:59:09.000000000 -0800 @@ -741,7 +741,7 @@ static int fat_dir_ioctl(struct inode * return ret; } -struct file_operations fat_dir_operations = { +const struct file_operations fat_dir_operations = { .read = generic_read_dir, .readdir = fat_readdir, .ioctl = fat_dir_ioctl, diff -puN fs/fat/file.c~make-most-file-operations-structs-in-fs-const fs/fat/file.c --- devel/fs/fat/file.c~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/fat/file.c 2006-02-27 20:59:09.000000000 -0800 @@ -112,7 +112,7 @@ int fat_generic_ioctl(struct inode *inod } } -struct file_operations fat_file_operations = { +const struct file_operations fat_file_operations = { .llseek = generic_file_llseek, .read = do_sync_read, .write = do_sync_write, diff -puN fs/fifo.c~make-most-file-operations-structs-in-fs-const fs/fifo.c --- devel/fs/fifo.c~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/fifo.c 2006-02-27 20:59:09.000000000 -0800 @@ -150,6 +150,6 @@ err_nolock_nocleanup: * is contain the open that then fills in the correct operations * depending on the access mode of the file... */ -struct file_operations def_fifo_fops = { +const struct file_operations def_fifo_fops = { .open = fifo_open, /* will set read or write pipe_fops */ }; diff -puN fs/freevxfs/vxfs_extern.h~make-most-file-operations-structs-in-fs-const fs/freevxfs/vxfs_extern.h --- devel/fs/freevxfs/vxfs_extern.h~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/freevxfs/vxfs_extern.h 2006-02-27 20:59:09.000000000 -0800 @@ -63,7 +63,7 @@ extern void vxfs_clear_inode(struct in /* vxfs_lookup.c */ extern struct inode_operations vxfs_dir_inode_ops; -extern struct file_operations vxfs_dir_operations; +extern const struct file_operations vxfs_dir_operations; /* vxfs_olt.c */ extern int vxfs_read_olt(struct super_block *, u_long); diff -puN fs/freevxfs/vxfs_lookup.c~make-most-file-operations-structs-in-fs-const fs/freevxfs/vxfs_lookup.c --- devel/fs/freevxfs/vxfs_lookup.c~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/freevxfs/vxfs_lookup.c 2006-02-27 20:59:09.000000000 -0800 @@ -56,7 +56,7 @@ struct inode_operations vxfs_dir_inode_o .lookup = vxfs_lookup, }; -struct file_operations vxfs_dir_operations = { +const struct file_operations vxfs_dir_operations = { .readdir = vxfs_readdir, }; diff -puN fs/fuse/dev.c~make-most-file-operations-structs-in-fs-const fs/fuse/dev.c --- devel/fs/fuse/dev.c~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/fuse/dev.c 2006-02-27 20:59:09.000000000 -0800 @@ -922,7 +922,7 @@ static int fuse_dev_release(struct inode return 0; } -struct file_operations fuse_dev_operations = { +const struct file_operations fuse_dev_operations = { .owner = THIS_MODULE, .llseek = no_llseek, .read = fuse_dev_read, diff -puN fs/fuse/dir.c~make-most-file-operations-structs-in-fs-const fs/fuse/dir.c --- devel/fs/fuse/dir.c~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/fuse/dir.c 2006-02-27 20:59:09.000000000 -0800 @@ -1170,7 +1170,7 @@ static struct inode_operations fuse_dir_ .removexattr = fuse_removexattr, }; -static struct file_operations fuse_dir_operations = { +static const struct file_operations fuse_dir_operations = { .llseek = generic_file_llseek, .read = generic_read_dir, .readdir = fuse_readdir, diff -puN fs/fuse/file.c~make-most-file-operations-structs-in-fs-const fs/fuse/file.c --- devel/fs/fuse/file.c~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/fuse/file.c 2006-02-27 20:59:09.000000000 -0800 @@ -12,7 +12,7 @@ #include #include -static struct file_operations fuse_direct_io_file_operations; +static const struct file_operations fuse_direct_io_file_operations; static int fuse_send_open(struct inode *inode, struct file *file, int isdir, struct fuse_open_out *outargp) @@ -611,7 +611,7 @@ static int fuse_set_page_dirty(struct pa return 0; } -static struct file_operations fuse_file_operations = { +static const struct file_operations fuse_file_operations = { .llseek = generic_file_llseek, .read = generic_file_read, .write = generic_file_write, @@ -623,7 +623,7 @@ static struct file_operations fuse_file_ .sendfile = generic_file_sendfile, }; -static struct file_operations fuse_direct_io_file_operations = { +static const struct file_operations fuse_direct_io_file_operations = { .llseek = generic_file_llseek, .read = fuse_direct_read, .write = fuse_direct_write, diff -puN fs/fuse/fuse_i.h~make-most-file-operations-structs-in-fs-const fs/fuse/fuse_i.h --- devel/fs/fuse/fuse_i.h~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/fuse/fuse_i.h 2006-02-27 20:59:09.000000000 -0800 @@ -346,7 +346,7 @@ static inline u64 get_node_id(struct ino } /** Device operations */ -extern struct file_operations fuse_dev_operations; +extern const struct file_operations fuse_dev_operations; /** * This is the single global spinlock which protects FUSE's structures diff -puN fs/hfs/dir.c~make-most-file-operations-structs-in-fs-const fs/hfs/dir.c --- devel/fs/hfs/dir.c~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/hfs/dir.c 2006-02-27 20:59:09.000000000 -0800 @@ -313,7 +313,7 @@ static int hfs_rename(struct inode *old_ return res; } -struct file_operations hfs_dir_operations = { +const struct file_operations hfs_dir_operations = { .read = generic_read_dir, .readdir = hfs_readdir, .llseek = generic_file_llseek, diff -puN fs/hfs/hfs_fs.h~make-most-file-operations-structs-in-fs-const fs/hfs/hfs_fs.h --- devel/fs/hfs/hfs_fs.h~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/hfs/hfs_fs.h 2006-02-27 20:59:09.000000000 -0800 @@ -169,7 +169,7 @@ extern int hfs_cat_move(u32, struct inod extern void hfs_cat_build_key(struct super_block *, btree_key *, u32, struct qstr *); /* dir.c */ -extern struct file_operations hfs_dir_operations; +extern const struct file_operations hfs_dir_operations; extern struct inode_operations hfs_dir_inode_operations; /* extent.c */ diff -puN fs/hfs/inode.c~make-most-file-operations-structs-in-fs-const fs/hfs/inode.c --- devel/fs/hfs/inode.c~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/hfs/inode.c 2006-02-27 20:59:09.000000000 -0800 @@ -17,7 +17,7 @@ #include "hfs_fs.h" #include "btree.h" -static struct file_operations hfs_file_operations; +static const struct file_operations hfs_file_operations; static struct inode_operations hfs_file_inode_operations; /*================ Variable-like macros ================*/ @@ -612,7 +612,7 @@ int hfs_inode_setattr(struct dentry *den } -static struct file_operations hfs_file_operations = { +static const struct file_operations hfs_file_operations = { .llseek = generic_file_llseek, .read = generic_file_read, .write = generic_file_write, diff -puN fs/hfsplus/dir.c~make-most-file-operations-structs-in-fs-const fs/hfsplus/dir.c --- devel/fs/hfsplus/dir.c~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/hfsplus/dir.c 2006-02-27 20:59:09.000000000 -0800 @@ -483,7 +483,7 @@ struct inode_operations hfsplus_dir_inod .rename = hfsplus_rename, }; -struct file_operations hfsplus_dir_operations = { +const struct file_operations hfsplus_dir_operations = { .read = generic_read_dir, .readdir = hfsplus_readdir, .ioctl = hfsplus_ioctl, diff -puN fs/hfsplus/inode.c~make-most-file-operations-structs-in-fs-const fs/hfsplus/inode.c --- devel/fs/hfsplus/inode.c~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/hfsplus/inode.c 2006-02-27 20:59:09.000000000 -0800 @@ -291,7 +291,7 @@ static struct inode_operations hfsplus_f .listxattr = hfsplus_listxattr, }; -static struct file_operations hfsplus_file_operations = { +static const struct file_operations hfsplus_file_operations = { .llseek = generic_file_llseek, .read = generic_file_read, .write = generic_file_write, diff -puN fs/hostfs/hostfs_kern.c~make-most-file-operations-structs-in-fs-const fs/hostfs/hostfs_kern.c --- devel/fs/hostfs/hostfs_kern.c~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/hostfs/hostfs_kern.c 2006-02-27 20:59:09.000000000 -0800 @@ -384,7 +384,7 @@ int hostfs_fsync(struct file *file, stru return fsync_file(HOSTFS_I(dentry->d_inode)->fd, datasync); } -static struct file_operations hostfs_file_fops = { +static const struct file_operations hostfs_file_fops = { .llseek = generic_file_llseek, .read = generic_file_read, .sendfile = generic_file_sendfile, @@ -399,7 +399,7 @@ static struct file_operations hostfs_fil .fsync = hostfs_fsync, }; -static struct file_operations hostfs_dir_fops = { +static const struct file_operations hostfs_dir_fops = { .llseek = generic_file_llseek, .readdir = hostfs_readdir, .read = generic_read_dir, diff -puN fs/hpfs/dir.c~make-most-file-operations-structs-in-fs-const fs/hpfs/dir.c --- devel/fs/hpfs/dir.c~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/hpfs/dir.c 2006-02-27 20:59:09.000000000 -0800 @@ -310,7 +310,7 @@ struct dentry *hpfs_lookup(struct inode return ERR_PTR(-ENOENT); } -struct file_operations hpfs_dir_ops = +const struct file_operations hpfs_dir_ops = { .llseek = hpfs_dir_lseek, .read = generic_read_dir, diff -puN fs/hpfs/file.c~make-most-file-operations-structs-in-fs-const fs/hpfs/file.c --- devel/fs/hpfs/file.c~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/hpfs/file.c 2006-02-27 20:59:09.000000000 -0800 @@ -119,7 +119,7 @@ static ssize_t hpfs_file_write(struct fi return retval; } -struct file_operations hpfs_file_ops = +const struct file_operations hpfs_file_ops = { .llseek = generic_file_llseek, .read = generic_file_read, diff -puN fs/hpfs/hpfs_fn.h~make-most-file-operations-structs-in-fs-const fs/hpfs/hpfs_fn.h --- devel/fs/hpfs/hpfs_fn.h~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/hpfs/hpfs_fn.h 2006-02-27 20:59:09.000000000 -0800 @@ -240,7 +240,7 @@ void hpfs_set_dentry_operations(struct d /* dir.c */ struct dentry *hpfs_lookup(struct inode *, struct dentry *, struct nameidata *); -extern struct file_operations hpfs_dir_ops; +extern const struct file_operations hpfs_dir_ops; /* dnode.c */ @@ -266,7 +266,7 @@ void hpfs_set_ea(struct inode *, struct /* file.c */ int hpfs_file_fsync(struct file *, struct dentry *, int); -extern struct file_operations hpfs_file_ops; +extern const struct file_operations hpfs_file_ops; extern struct inode_operations hpfs_file_iops; extern struct address_space_operations hpfs_aops; diff -puN fs/hppfs/hppfs_kern.c~make-most-file-operations-structs-in-fs-const fs/hppfs/hppfs_kern.c --- devel/fs/hppfs/hppfs_kern.c~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/hppfs/hppfs_kern.c 2006-02-27 20:59:09.000000000 -0800 @@ -558,7 +558,7 @@ static loff_t hppfs_llseek(struct file * return(default_llseek(file, off, where)); } -static struct file_operations hppfs_file_fops = { +static const struct file_operations hppfs_file_fops = { .owner = NULL, .llseek = hppfs_llseek, .read = hppfs_read, @@ -609,7 +609,7 @@ static int hppfs_fsync(struct file *file return(0); } -static struct file_operations hppfs_dir_fops = { +static const struct file_operations hppfs_dir_fops = { .owner = NULL, .readdir = hppfs_readdir, .open = hppfs_dir_open, diff -puN fs/hugetlbfs/inode.c~make-most-file-operations-structs-in-fs-const fs/hugetlbfs/inode.c --- devel/fs/hugetlbfs/inode.c~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/hugetlbfs/inode.c 2006-02-27 20:59:09.000000000 -0800 @@ -35,7 +35,7 @@ static struct super_operations hugetlbfs_ops; static struct address_space_operations hugetlbfs_aops; -struct file_operations hugetlbfs_file_operations; +const struct file_operations hugetlbfs_file_operations; static struct inode_operations hugetlbfs_dir_inode_operations; static struct inode_operations hugetlbfs_inode_operations; @@ -600,7 +600,7 @@ static void init_once(void *foo, kmem_ca inode_init_once(&ei->vfs_inode); } -struct file_operations hugetlbfs_file_operations = { +const struct file_operations hugetlbfs_file_operations = { .mmap = hugetlbfs_file_mmap, .fsync = simple_sync_file, .get_unmapped_area = hugetlb_get_unmapped_area, diff -puN fs/inotify.c~make-most-file-operations-structs-in-fs-const fs/inotify.c --- devel/fs/inotify.c~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/inotify.c 2006-02-27 20:59:09.000000000 -0800 @@ -915,7 +915,7 @@ static long inotify_ioctl(struct file *f return ret; } -static struct file_operations inotify_fops = { +static const struct file_operations inotify_fops = { .poll = inotify_poll, .read = inotify_read, .release = inotify_release, diff -puN fs/isofs/dir.c~make-most-file-operations-structs-in-fs-const fs/isofs/dir.c --- devel/fs/isofs/dir.c~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/isofs/dir.c 2006-02-27 20:59:09.000000000 -0800 @@ -16,7 +16,7 @@ static int isofs_readdir(struct file *, void *, filldir_t); -struct file_operations isofs_dir_operations = +const struct file_operations isofs_dir_operations = { .read = generic_read_dir, .readdir = isofs_readdir, diff -puN fs/isofs/isofs.h~make-most-file-operations-structs-in-fs-const fs/isofs/isofs.h --- devel/fs/isofs/isofs.h~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/isofs/isofs.h 2006-02-27 20:59:09.000000000 -0800 @@ -175,6 +175,6 @@ isofs_normalize_block_and_offset(struct } extern struct inode_operations isofs_dir_inode_operations; -extern struct file_operations isofs_dir_operations; +extern const struct file_operations isofs_dir_operations; extern struct address_space_operations isofs_symlink_aops; extern struct export_operations isofs_export_ops; diff -puN fs/jffs2/dir.c~make-most-file-operations-structs-in-fs-const fs/jffs2/dir.c --- devel/fs/jffs2/dir.c~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/jffs2/dir.c 2006-02-27 20:59:09.000000000 -0800 @@ -37,7 +37,7 @@ static int jffs2_mknod (struct inode *,s static int jffs2_rename (struct inode *, struct dentry *, struct inode *, struct dentry *); -struct file_operations jffs2_dir_operations = +const struct file_operations jffs2_dir_operations = { .read = generic_read_dir, .readdir = jffs2_readdir, diff -puN fs/jffs2/file.c~make-most-file-operations-structs-in-fs-const fs/jffs2/file.c --- devel/fs/jffs2/file.c~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/jffs2/file.c 2006-02-27 20:59:09.000000000 -0800 @@ -38,7 +38,7 @@ int jffs2_fsync(struct file *filp, struc return 0; } -struct file_operations jffs2_file_operations = +const struct file_operations jffs2_file_operations = { .llseek = generic_file_llseek, .open = generic_file_open, diff -puN fs/jffs2/os-linux.h~make-most-file-operations-structs-in-fs-const fs/jffs2/os-linux.h --- devel/fs/jffs2/os-linux.h~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/jffs2/os-linux.h 2006-02-27 20:59:09.000000000 -0800 @@ -159,11 +159,11 @@ void jffs2_stop_garbage_collect_thread(s void jffs2_garbage_collect_trigger(struct jffs2_sb_info *c); /* dir.c */ -extern struct file_operations jffs2_dir_operations; +extern const struct file_operations jffs2_dir_operations; extern struct inode_operations jffs2_dir_inode_operations; /* file.c */ -extern struct file_operations jffs2_file_operations; +extern const struct file_operations jffs2_file_operations; extern struct inode_operations jffs2_file_inode_operations; extern struct address_space_operations jffs2_file_address_operations; int jffs2_fsync(struct file *, struct dentry *, int); diff -puN fs/jffs/inode-v23.c~make-most-file-operations-structs-in-fs-const fs/jffs/inode-v23.c --- devel/fs/jffs/inode-v23.c~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/jffs/inode-v23.c 2006-02-27 20:59:09.000000000 -0800 @@ -55,9 +55,9 @@ static int jffs_remove(struct inode *dir, struct dentry *dentry, int type); static struct super_operations jffs_ops; -static struct file_operations jffs_file_operations; +static const struct file_operations jffs_file_operations; static struct inode_operations jffs_file_inode_operations; -static struct file_operations jffs_dir_operations; +static const struct file_operations jffs_dir_operations; static struct inode_operations jffs_dir_inode_operations; static struct address_space_operations jffs_address_operations; @@ -1629,7 +1629,7 @@ static int jffs_fsync(struct file *f, st } -static struct file_operations jffs_file_operations = +static const struct file_operations jffs_file_operations = { .open = generic_file_open, .llseek = generic_file_llseek, @@ -1649,7 +1649,7 @@ static struct inode_operations jffs_file }; -static struct file_operations jffs_dir_operations = +static const struct file_operations jffs_dir_operations = { .readdir = jffs_readdir, }; diff -puN fs/jfs/file.c~make-most-file-operations-structs-in-fs-const fs/jfs/file.c --- devel/fs/jfs/file.c~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/jfs/file.c 2006-02-27 20:59:09.000000000 -0800 @@ -100,7 +100,7 @@ struct inode_operations jfs_file_inode_o #endif }; -struct file_operations jfs_file_operations = { +const struct file_operations jfs_file_operations = { .open = jfs_open, .llseek = generic_file_llseek, .write = generic_file_write, diff -puN fs/jfs/jfs_inode.h~make-most-file-operations-structs-in-fs-const fs/jfs/jfs_inode.h --- devel/fs/jfs/jfs_inode.h~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/jfs/jfs_inode.h 2006-02-27 20:59:09.000000000 -0800 @@ -35,9 +35,9 @@ extern void jfs_set_inode_flags(struct i extern struct address_space_operations jfs_aops; extern struct inode_operations jfs_dir_inode_operations; -extern struct file_operations jfs_dir_operations; +extern const struct file_operations jfs_dir_operations; extern struct inode_operations jfs_file_inode_operations; -extern struct file_operations jfs_file_operations; +extern const struct file_operations jfs_file_operations; extern struct inode_operations jfs_symlink_inode_operations; extern struct dentry_operations jfs_ci_dentry_operations; #endif /* _H_JFS_INODE */ diff -puN fs/jfs/namei.c~make-most-file-operations-structs-in-fs-const fs/jfs/namei.c --- devel/fs/jfs/namei.c~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/jfs/namei.c 2006-02-27 20:59:09.000000000 -0800 @@ -1519,7 +1519,7 @@ struct inode_operations jfs_dir_inode_op #endif }; -struct file_operations jfs_dir_operations = { +const struct file_operations jfs_dir_operations = { .read = generic_read_dir, .readdir = jfs_readdir, .fsync = jfs_fsync, diff -puN fs/libfs.c~make-most-file-operations-structs-in-fs-const fs/libfs.c --- devel/fs/libfs.c~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/libfs.c 2006-02-27 20:59:09.000000000 -0800 @@ -179,7 +179,7 @@ ssize_t generic_read_dir(struct file *fi return -EISDIR; } -struct file_operations simple_dir_operations = { +const struct file_operations simple_dir_operations = { .open = dcache_dir_open, .release = dcache_dir_close, .llseek = dcache_dir_lseek, diff -puN fs/minix/dir.c~make-most-file-operations-structs-in-fs-const fs/minix/dir.c --- devel/fs/minix/dir.c~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/minix/dir.c 2006-02-27 20:59:09.000000000 -0800 @@ -14,7 +14,7 @@ typedef struct minix_dir_entry minix_dir static int minix_readdir(struct file *, void *, filldir_t); -struct file_operations minix_dir_operations = { +const struct file_operations minix_dir_operations = { .read = generic_read_dir, .readdir = minix_readdir, .fsync = minix_sync_file, diff -puN fs/minix/file.c~make-most-file-operations-structs-in-fs-const fs/minix/file.c --- devel/fs/minix/file.c~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/minix/file.c 2006-02-27 20:59:09.000000000 -0800 @@ -15,7 +15,7 @@ */ int minix_sync_file(struct file *, struct dentry *, int); -struct file_operations minix_file_operations = { +const struct file_operations minix_file_operations = { .llseek = generic_file_llseek, .read = generic_file_read, .write = generic_file_write, diff -puN fs/minix/minix.h~make-most-file-operations-structs-in-fs-const fs/minix/minix.h --- devel/fs/minix/minix.h~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/minix/minix.h 2006-02-27 20:59:09.000000000 -0800 @@ -81,8 +81,8 @@ extern int minix_sync_file(struct file * extern struct inode_operations minix_file_inode_operations; extern struct inode_operations minix_dir_inode_operations; -extern struct file_operations minix_file_operations; -extern struct file_operations minix_dir_operations; +extern const struct file_operations minix_file_operations; +extern const struct file_operations minix_dir_operations; extern struct dentry_operations minix_dentry_operations; static inline struct minix_sb_info *minix_sb(struct super_block *sb) diff -puN fs/ncpfs/dir.c~make-most-file-operations-structs-in-fs-const fs/ncpfs/dir.c --- devel/fs/ncpfs/dir.c~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/ncpfs/dir.c 2006-02-27 20:59:09.000000000 -0800 @@ -49,7 +49,7 @@ extern int ncp_symlink(struct inode *, s #define ncp_symlink NULL #endif -struct file_operations ncp_dir_operations = +const struct file_operations ncp_dir_operations = { .read = generic_read_dir, .readdir = ncp_readdir, diff -puN fs/ncpfs/file.c~make-most-file-operations-structs-in-fs-const fs/ncpfs/file.c --- devel/fs/ncpfs/file.c~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/ncpfs/file.c 2006-02-27 20:59:09.000000000 -0800 @@ -283,7 +283,7 @@ static int ncp_release(struct inode *ino return 0; } -struct file_operations ncp_file_operations = +const struct file_operations ncp_file_operations = { .llseek = remote_llseek, .read = ncp_file_read, diff -puN fs/nfs/dir.c~make-most-file-operations-structs-in-fs-const fs/nfs/dir.c --- devel/fs/nfs/dir.c~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/nfs/dir.c 2006-02-27 20:59:09.000000000 -0800 @@ -54,7 +54,7 @@ static int nfs_rename(struct inode *, st static int nfs_fsync_dir(struct file *, struct dentry *, int); static loff_t nfs_llseek_dir(struct file *, loff_t, int); -struct file_operations nfs_dir_operations = { +const struct file_operations nfs_dir_operations = { .llseek = nfs_llseek_dir, .read = generic_read_dir, .readdir = nfs_readdir, diff -puN fs/nfsd/nfsctl.c~make-most-file-operations-structs-in-fs-const fs/nfsd/nfsctl.c --- devel/fs/nfsd/nfsctl.c~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/nfsd/nfsctl.c 2006-02-27 20:59:09.000000000 -0800 @@ -134,7 +134,7 @@ static ssize_t nfsctl_transaction_read(s return simple_transaction_read(file, buf, size, pos); } -static struct file_operations transaction_ops = { +static const struct file_operations transaction_ops = { .write = nfsctl_transaction_write, .read = nfsctl_transaction_read, .release = simple_transaction_release, @@ -146,7 +146,7 @@ static int exports_open(struct inode *in return seq_open(file, &nfs_exports_op); } -static struct file_operations exports_operations = { +static const struct file_operations exports_operations = { .open = exports_open, .read = seq_read, .llseek = seq_lseek, diff -puN fs/nfsd/stats.c~make-most-file-operations-structs-in-fs-const fs/nfsd/stats.c --- devel/fs/nfsd/stats.c~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/nfsd/stats.c 2006-02-27 20:59:09.000000000 -0800 @@ -80,7 +80,7 @@ static int nfsd_proc_open(struct inode * return single_open(file, nfsd_proc_show, NULL); } -static struct file_operations nfsd_proc_fops = { +static const struct file_operations nfsd_proc_fops = { .owner = THIS_MODULE, .open = nfsd_proc_open, .read = seq_read, diff -puN fs/nfs/file.c~make-most-file-operations-structs-in-fs-const fs/nfs/file.c --- devel/fs/nfs/file.c~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/nfs/file.c 2006-02-27 20:59:09.000000000 -0800 @@ -49,7 +49,7 @@ static int nfs_check_flags(int flags); static int nfs_lock(struct file *filp, int cmd, struct file_lock *fl); static int nfs_flock(struct file *filp, int cmd, struct file_lock *fl); -struct file_operations nfs_file_operations = { +const struct file_operations nfs_file_operations = { .llseek = nfs_file_llseek, .read = do_sync_read, .write = do_sync_write, diff -puN fs/ntfs/dir.c~make-most-file-operations-structs-in-fs-const fs/ntfs/dir.c --- devel/fs/ntfs/dir.c~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/ntfs/dir.c 2006-02-27 20:59:09.000000000 -0800 @@ -1553,7 +1553,7 @@ static int ntfs_dir_fsync(struct file *f #endif /* NTFS_RW */ -struct file_operations ntfs_dir_ops = { +const struct file_operations ntfs_dir_ops = { .llseek = generic_file_llseek, /* Seek inside directory. */ .read = generic_read_dir, /* Return -EISDIR. */ .readdir = ntfs_readdir, /* Read directory contents. */ diff -puN fs/ntfs/file.c~make-most-file-operations-structs-in-fs-const fs/ntfs/file.c --- devel/fs/ntfs/file.c~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/ntfs/file.c 2006-02-27 20:59:09.000000000 -0800 @@ -2304,7 +2304,7 @@ static int ntfs_file_fsync(struct file * #endif /* NTFS_RW */ -struct file_operations ntfs_file_ops = { +const struct file_operations ntfs_file_ops = { .llseek = generic_file_llseek, /* Seek inside file. */ .read = generic_file_read, /* Read from file. */ .aio_read = generic_file_aio_read, /* Async read from file. */ @@ -2347,6 +2347,6 @@ struct inode_operations ntfs_file_inode_ #endif /* NTFS_RW */ }; -struct file_operations ntfs_empty_file_ops = {}; +const struct file_operations ntfs_empty_file_ops = {}; struct inode_operations ntfs_empty_inode_ops = {}; diff -puN fs/ntfs/ntfs.h~make-most-file-operations-structs-in-fs-const fs/ntfs/ntfs.h --- devel/fs/ntfs/ntfs.h~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/ntfs/ntfs.h 2006-02-27 20:59:09.000000000 -0800 @@ -60,13 +60,13 @@ extern struct kmem_cache *ntfs_index_ctx extern struct address_space_operations ntfs_aops; extern struct address_space_operations ntfs_mst_aops; -extern struct file_operations ntfs_file_ops; +extern const struct file_operations ntfs_file_ops; extern struct inode_operations ntfs_file_inode_ops; -extern struct file_operations ntfs_dir_ops; +extern const struct file_operations ntfs_dir_ops; extern struct inode_operations ntfs_dir_inode_ops; -extern struct file_operations ntfs_empty_file_ops; +extern const struct file_operations ntfs_empty_file_ops; extern struct inode_operations ntfs_empty_inode_ops; extern struct export_operations ntfs_export_ops; diff -puN fs/ocfs2/dlmglue.c~make-most-file-operations-structs-in-fs-const fs/ocfs2/dlmglue.c --- devel/fs/ocfs2/dlmglue.c~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/ocfs2/dlmglue.c 2006-02-27 20:59:09.000000000 -0800 @@ -2017,7 +2017,7 @@ out: return ret; } -static struct file_operations ocfs2_dlm_debug_fops = { +static const struct file_operations ocfs2_dlm_debug_fops = { .open = ocfs2_dlm_debug_open, .release = ocfs2_dlm_debug_release, .read = seq_read, diff -puN fs/ocfs2/file.c~make-most-file-operations-structs-in-fs-const fs/ocfs2/file.c --- devel/fs/ocfs2/file.c~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/ocfs2/file.c 2006-02-27 20:59:09.000000000 -0800 @@ -1172,7 +1172,7 @@ struct inode_operations ocfs2_special_fi .getattr = ocfs2_getattr, }; -struct file_operations ocfs2_fops = { +const struct file_operations ocfs2_fops = { .read = do_sync_read, .write = do_sync_write, .sendfile = generic_file_sendfile, @@ -1184,7 +1184,7 @@ struct file_operations ocfs2_fops = { .aio_write = ocfs2_file_aio_write, }; -struct file_operations ocfs2_dops = { +const struct file_operations ocfs2_dops = { .read = generic_read_dir, .readdir = ocfs2_readdir, .fsync = ocfs2_sync_file, diff -puN fs/ocfs2/file.h~make-most-file-operations-structs-in-fs-const fs/ocfs2/file.h --- devel/fs/ocfs2/file.h~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/ocfs2/file.h 2006-02-27 20:59:09.000000000 -0800 @@ -26,8 +26,8 @@ #ifndef OCFS2_FILE_H #define OCFS2_FILE_H -extern struct file_operations ocfs2_fops; -extern struct file_operations ocfs2_dops; +extern const struct file_operations ocfs2_fops; +extern const struct file_operations ocfs2_dops; extern struct inode_operations ocfs2_file_iops; extern struct inode_operations ocfs2_special_file_iops; struct ocfs2_alloc_context; diff -puN fs/openpromfs/inode.c~make-most-file-operations-structs-in-fs-const fs/openpromfs/inode.c --- devel/fs/openpromfs/inode.c~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/openpromfs/inode.c 2006-02-27 20:59:09.000000000 -0800 @@ -581,17 +581,17 @@ int property_release (struct inode *inod return 0; } -static struct file_operations openpromfs_prop_ops = { +static const struct file_operations openpromfs_prop_ops = { .read = property_read, .write = property_write, .release = property_release, }; -static struct file_operations openpromfs_nodenum_ops = { +static const struct file_operations openpromfs_nodenum_ops = { .read = nodenum_read, }; -static struct file_operations openprom_operations = { +static const struct file_operations openprom_operations = { .read = generic_read_dir, .readdir = openpromfs_readdir, }; diff -puN fs/pipe.c~make-most-file-operations-structs-in-fs-const fs/pipe.c --- devel/fs/pipe.c~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/pipe.c 2006-02-27 20:59:09.000000000 -0800 @@ -568,7 +568,7 @@ pipe_rdwr_open(struct inode *inode, stru * The file_operations structs are not static because they * are also used in linux/fs/fifo.c to do operations on FIFOs. */ -struct file_operations read_fifo_fops = { +const struct file_operations read_fifo_fops = { .llseek = no_llseek, .read = pipe_read, .readv = pipe_readv, @@ -580,7 +580,7 @@ struct file_operations read_fifo_fops = .fasync = pipe_read_fasync, }; -struct file_operations write_fifo_fops = { +const struct file_operations write_fifo_fops = { .llseek = no_llseek, .read = bad_pipe_r, .write = pipe_write, @@ -592,7 +592,7 @@ struct file_operations write_fifo_fops = .fasync = pipe_write_fasync, }; -struct file_operations rdwr_fifo_fops = { +const struct file_operations rdwr_fifo_fops = { .llseek = no_llseek, .read = pipe_read, .readv = pipe_readv, @@ -605,7 +605,7 @@ struct file_operations rdwr_fifo_fops = .fasync = pipe_rdwr_fasync, }; -struct file_operations read_pipe_fops = { +const struct file_operations read_pipe_fops = { .llseek = no_llseek, .read = pipe_read, .readv = pipe_readv, @@ -617,7 +617,7 @@ struct file_operations read_pipe_fops = .fasync = pipe_read_fasync, }; -struct file_operations write_pipe_fops = { +const struct file_operations write_pipe_fops = { .llseek = no_llseek, .read = bad_pipe_r, .write = pipe_write, @@ -629,7 +629,7 @@ struct file_operations write_pipe_fops = .fasync = pipe_write_fasync, }; -struct file_operations rdwr_pipe_fops = { +const struct file_operations rdwr_pipe_fops = { .llseek = no_llseek, .read = pipe_read, .readv = pipe_readv, diff -puN fs/proc/kcore.c~make-most-file-operations-structs-in-fs-const fs/proc/kcore.c --- devel/fs/proc/kcore.c~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/proc/kcore.c 2006-02-27 20:59:09.000000000 -0800 @@ -31,7 +31,7 @@ static int open_kcore(struct inode * ino static ssize_t read_kcore(struct file *, char __user *, size_t, loff_t *); -struct file_operations proc_kcore_operations = { +const struct file_operations proc_kcore_operations = { .read = read_kcore, .open = open_kcore, }; diff -puN fs/proc/kmsg.c~make-most-file-operations-structs-in-fs-const fs/proc/kmsg.c --- devel/fs/proc/kmsg.c~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/proc/kmsg.c 2006-02-27 20:59:09.000000000 -0800 @@ -47,7 +47,7 @@ static unsigned int kmsg_poll(struct fil } -struct file_operations proc_kmsg_operations = { +const struct file_operations proc_kmsg_operations = { .read = kmsg_read, .poll = kmsg_poll, .open = kmsg_open, diff -puN fs/proc/vmcore.c~make-most-file-operations-structs-in-fs-const fs/proc/vmcore.c --- devel/fs/proc/vmcore.c~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/proc/vmcore.c 2006-02-27 20:59:09.000000000 -0800 @@ -172,7 +172,7 @@ static int open_vmcore(struct inode *ino return 0; } -struct file_operations proc_vmcore_operations = { +const struct file_operations proc_vmcore_operations = { .read = read_vmcore, .open = open_vmcore, }; diff -puN fs/qnx4/dir.c~make-most-file-operations-structs-in-fs-const fs/qnx4/dir.c --- devel/fs/qnx4/dir.c~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/qnx4/dir.c 2006-02-27 20:59:09.000000000 -0800 @@ -81,7 +81,7 @@ out: return 0; } -struct file_operations qnx4_dir_operations = +const struct file_operations qnx4_dir_operations = { .read = generic_read_dir, .readdir = qnx4_readdir, diff -puN fs/qnx4/file.c~make-most-file-operations-structs-in-fs-const fs/qnx4/file.c --- devel/fs/qnx4/file.c~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/qnx4/file.c 2006-02-27 20:59:09.000000000 -0800 @@ -19,7 +19,7 @@ * We have mostly NULL's here: the current defaults are ok for * the qnx4 filesystem. */ -struct file_operations qnx4_file_operations = +const struct file_operations qnx4_file_operations = { .llseek = generic_file_llseek, .read = generic_file_read, diff -puN fs/ramfs/file-mmu.c~make-most-file-operations-structs-in-fs-const fs/ramfs/file-mmu.c --- devel/fs/ramfs/file-mmu.c~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/ramfs/file-mmu.c 2006-02-27 20:59:09.000000000 -0800 @@ -32,7 +32,7 @@ struct address_space_operations ramfs_ao .commit_write = simple_commit_write }; -struct file_operations ramfs_file_operations = { +const struct file_operations ramfs_file_operations = { .read = generic_file_read, .write = generic_file_write, .mmap = generic_file_mmap, diff -puN fs/ramfs/file-nommu.c~make-most-file-operations-structs-in-fs-const fs/ramfs/file-nommu.c --- devel/fs/ramfs/file-nommu.c~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/ramfs/file-nommu.c 2006-02-27 20:59:09.000000000 -0800 @@ -33,7 +33,7 @@ struct address_space_operations ramfs_ao .commit_write = simple_commit_write }; -struct file_operations ramfs_file_operations = { +const struct file_operations ramfs_file_operations = { .mmap = ramfs_nommu_mmap, .get_unmapped_area = ramfs_nommu_get_unmapped_area, .read = generic_file_read, diff -puN fs/ramfs/internal.h~make-most-file-operations-structs-in-fs-const fs/ramfs/internal.h --- devel/fs/ramfs/internal.h~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/ramfs/internal.h 2006-02-27 20:59:09.000000000 -0800 @@ -11,5 +11,5 @@ extern struct address_space_operations ramfs_aops; -extern struct file_operations ramfs_file_operations; +extern const struct file_operations ramfs_file_operations; extern struct inode_operations ramfs_file_inode_operations; diff -puN fs/read_write.c~make-most-file-operations-structs-in-fs-const fs/read_write.c --- devel/fs/read_write.c~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/read_write.c 2006-02-27 20:59:09.000000000 -0800 @@ -19,7 +19,7 @@ #include #include -struct file_operations generic_ro_fops = { +const struct file_operations generic_ro_fops = { .llseek = generic_file_llseek, .read = generic_file_read, .mmap = generic_file_readonly_mmap, diff -puN fs/reiserfs/dir.c~make-most-file-operations-structs-in-fs-const fs/reiserfs/dir.c --- devel/fs/reiserfs/dir.c~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/reiserfs/dir.c 2006-02-27 20:59:09.000000000 -0800 @@ -18,7 +18,7 @@ static int reiserfs_readdir(struct file static int reiserfs_dir_fsync(struct file *filp, struct dentry *dentry, int datasync); -struct file_operations reiserfs_dir_operations = { +const struct file_operations reiserfs_dir_operations = { .read = generic_read_dir, .readdir = reiserfs_readdir, .fsync = reiserfs_dir_fsync, diff -puN fs/reiserfs/file.c~make-most-file-operations-structs-in-fs-const fs/reiserfs/file.c --- devel/fs/reiserfs/file.c~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/reiserfs/file.c 2006-02-27 20:59:09.000000000 -0800 @@ -1566,7 +1566,7 @@ static ssize_t reiserfs_aio_write(struct return generic_file_aio_write(iocb, buf, count, pos); } -struct file_operations reiserfs_file_operations = { +const struct file_operations reiserfs_file_operations = { .read = generic_file_read, .write = reiserfs_file_write, .ioctl = reiserfs_ioctl, diff -puN fs/reiserfs/procfs.c~make-most-file-operations-structs-in-fs-const fs/reiserfs/procfs.c --- devel/fs/reiserfs/procfs.c~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/reiserfs/procfs.c 2006-02-27 20:59:09.000000000 -0800 @@ -470,7 +470,7 @@ static int r_open(struct inode *inode, s return ret; } -static struct file_operations r_file_operations = { +static const struct file_operations r_file_operations = { .open = r_open, .read = seq_read, .llseek = seq_lseek, diff -puN fs/romfs/inode.c~make-most-file-operations-structs-in-fs-const fs/romfs/inode.c --- devel/fs/romfs/inode.c~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/romfs/inode.c 2006-02-27 20:59:09.000000000 -0800 @@ -463,7 +463,7 @@ static struct address_space_operations r .readpage = romfs_readpage }; -static struct file_operations romfs_dir_operations = { +static const struct file_operations romfs_dir_operations = { .read = generic_read_dir, .readdir = romfs_readdir, }; diff -puN fs/smbfs/dir.c~make-most-file-operations-structs-in-fs-const fs/smbfs/dir.c --- devel/fs/smbfs/dir.c~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/smbfs/dir.c 2006-02-27 20:59:09.000000000 -0800 @@ -34,7 +34,7 @@ static int smb_rename(struct inode *, st static int smb_make_node(struct inode *,struct dentry *,int,dev_t); static int smb_link(struct dentry *, struct inode *, struct dentry *); -struct file_operations smb_dir_operations = +const struct file_operations smb_dir_operations = { .read = generic_read_dir, .readdir = smb_readdir, diff -puN fs/smbfs/file.c~make-most-file-operations-structs-in-fs-const fs/smbfs/file.c --- devel/fs/smbfs/file.c~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/smbfs/file.c 2006-02-27 20:59:09.000000000 -0800 @@ -401,7 +401,7 @@ smb_file_permission(struct inode *inode, return error; } -struct file_operations smb_file_operations = +const struct file_operations smb_file_operations = { .llseek = remote_llseek, .read = smb_file_read, diff -puN fs/smbfs/proto.h~make-most-file-operations-structs-in-fs-const fs/smbfs/proto.h --- devel/fs/smbfs/proto.h~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/smbfs/proto.h 2006-02-27 20:59:09.000000000 -0800 @@ -35,7 +35,7 @@ extern int smb_proc_symlink(struct smb_s extern int smb_proc_link(struct smb_sb_info *server, struct dentry *dentry, struct dentry *new_dentry); extern void smb_install_null_ops(struct smb_ops *ops); /* dir.c */ -extern struct file_operations smb_dir_operations; +extern const struct file_operations smb_dir_operations; extern struct inode_operations smb_dir_inode_operations; extern struct inode_operations smb_dir_inode_operations_unix; extern void smb_new_dentry(struct dentry *dentry); @@ -64,7 +64,7 @@ extern int smb_getattr(struct vfsmount * extern int smb_notify_change(struct dentry *dentry, struct iattr *attr); /* file.c */ extern struct address_space_operations smb_file_aops; -extern struct file_operations smb_file_operations; +extern const struct file_operations smb_file_operations; extern struct inode_operations smb_file_inode_operations; /* ioctl.c */ extern int smb_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg); diff -puN fs/sysfs/bin.c~make-most-file-operations-structs-in-fs-const fs/sysfs/bin.c --- devel/fs/sysfs/bin.c~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/sysfs/bin.c 2006-02-27 20:59:09.000000000 -0800 @@ -163,7 +163,7 @@ static int release(struct inode * inode, return 0; } -struct file_operations bin_fops = { +const struct file_operations bin_fops = { .read = read, .write = write, .mmap = mmap, diff -puN fs/sysfs/dir.c~make-most-file-operations-structs-in-fs-const fs/sysfs/dir.c --- devel/fs/sysfs/dir.c~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/sysfs/dir.c 2006-02-27 20:59:09.000000000 -0800 @@ -499,7 +499,7 @@ static loff_t sysfs_dir_lseek(struct fil return offset; } -struct file_operations sysfs_dir_operations = { +const struct file_operations sysfs_dir_operations = { .open = sysfs_dir_open, .release = sysfs_dir_close, .llseek = sysfs_dir_lseek, diff -puN fs/sysfs/file.c~make-most-file-operations-structs-in-fs-const fs/sysfs/file.c --- devel/fs/sysfs/file.c~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/sysfs/file.c 2006-02-27 20:59:09.000000000 -0800 @@ -436,7 +436,7 @@ void sysfs_notify(struct kobject * k, ch } EXPORT_SYMBOL_GPL(sysfs_notify); -struct file_operations sysfs_file_operations = { +const struct file_operations sysfs_file_operations = { .read = sysfs_read_file, .write = sysfs_write_file, .llseek = generic_file_llseek, diff -puN fs/sysfs/sysfs.h~make-most-file-operations-structs-in-fs-const fs/sysfs/sysfs.h --- devel/fs/sysfs/sysfs.h~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/sysfs/sysfs.h 2006-02-27 20:59:09.000000000 -0800 @@ -21,9 +21,9 @@ extern int sysfs_setattr(struct dentry * extern struct rw_semaphore sysfs_rename_sem; extern struct super_block * sysfs_sb; -extern struct file_operations sysfs_dir_operations; -extern struct file_operations sysfs_file_operations; -extern struct file_operations bin_fops; +extern const struct file_operations sysfs_dir_operations; +extern const struct file_operations sysfs_file_operations; +extern const struct file_operations bin_fops; extern struct inode_operations sysfs_dir_inode_operations; extern struct inode_operations sysfs_symlink_inode_operations; diff -puN fs/sysv/dir.c~make-most-file-operations-structs-in-fs-const fs/sysv/dir.c --- devel/fs/sysv/dir.c~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/sysv/dir.c 2006-02-27 20:59:09.000000000 -0800 @@ -20,7 +20,7 @@ static int sysv_readdir(struct file *, void *, filldir_t); -struct file_operations sysv_dir_operations = { +const struct file_operations sysv_dir_operations = { .read = generic_read_dir, .readdir = sysv_readdir, .fsync = sysv_sync_file, diff -puN fs/sysv/file.c~make-most-file-operations-structs-in-fs-const fs/sysv/file.c --- devel/fs/sysv/file.c~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/sysv/file.c 2006-02-27 20:59:09.000000000 -0800 @@ -19,7 +19,7 @@ * We have mostly NULLs here: the current defaults are OK for * the coh filesystem. */ -struct file_operations sysv_file_operations = { +const struct file_operations sysv_file_operations = { .llseek = generic_file_llseek, .read = generic_file_read, .write = generic_file_write, diff -puN fs/sysv/sysv.h~make-most-file-operations-structs-in-fs-const fs/sysv/sysv.h --- devel/fs/sysv/sysv.h~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/sysv/sysv.h 2006-02-27 20:59:09.000000000 -0800 @@ -159,8 +159,8 @@ extern ino_t sysv_inode_by_name(struct d extern struct inode_operations sysv_file_inode_operations; extern struct inode_operations sysv_dir_inode_operations; extern struct inode_operations sysv_fast_symlink_inode_operations; -extern struct file_operations sysv_file_operations; -extern struct file_operations sysv_dir_operations; +extern const struct file_operations sysv_file_operations; +extern const struct file_operations sysv_dir_operations; extern struct address_space_operations sysv_aops; extern struct super_operations sysv_sops; extern struct dentry_operations sysv_dentry_operations; diff -puN fs/udf/dir.c~make-most-file-operations-structs-in-fs-const fs/udf/dir.c --- devel/fs/udf/dir.c~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/udf/dir.c 2006-02-27 20:59:09.000000000 -0800 @@ -42,7 +42,7 @@ static int do_udf_readdir(struct inode * /* readdir and lookup functions */ -struct file_operations udf_dir_operations = { +const struct file_operations udf_dir_operations = { .read = generic_read_dir, .readdir = udf_readdir, .ioctl = udf_ioctl, diff -puN fs/udf/file.c~make-most-file-operations-structs-in-fs-const fs/udf/file.c --- devel/fs/udf/file.c~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/udf/file.c 2006-02-27 20:59:09.000000000 -0800 @@ -248,7 +248,7 @@ static int udf_release_file(struct inode return 0; } -struct file_operations udf_file_operations = { +const struct file_operations udf_file_operations = { .read = generic_file_read, .ioctl = udf_ioctl, .open = generic_file_open, diff -puN fs/udf/udfdecl.h~make-most-file-operations-structs-in-fs-const fs/udf/udfdecl.h --- devel/fs/udf/udfdecl.h~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/udf/udfdecl.h 2006-02-27 20:59:09.000000000 -0800 @@ -44,9 +44,9 @@ struct buffer_head; struct super_block; extern struct inode_operations udf_dir_inode_operations; -extern struct file_operations udf_dir_operations; +extern const struct file_operations udf_dir_operations; extern struct inode_operations udf_file_inode_operations; -extern struct file_operations udf_file_operations; +extern const struct file_operations udf_file_operations; extern struct address_space_operations udf_aops; extern struct address_space_operations udf_adinicb_aops; extern struct address_space_operations udf_symlink_aops; diff -puN fs/ufs/dir.c~make-most-file-operations-structs-in-fs-const fs/ufs/dir.c --- devel/fs/ufs/dir.c~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/ufs/dir.c 2006-02-27 20:59:09.000000000 -0800 @@ -620,7 +620,7 @@ int ufs_empty_dir (struct inode * inode) return 1; } -struct file_operations ufs_dir_operations = { +const struct file_operations ufs_dir_operations = { .read = generic_read_dir, .readdir = ufs_readdir, .fsync = file_fsync, diff -puN fs/ufs/file.c~make-most-file-operations-structs-in-fs-const fs/ufs/file.c --- devel/fs/ufs/file.c~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/ufs/file.c 2006-02-27 20:59:09.000000000 -0800 @@ -31,7 +31,7 @@ * the ufs filesystem. */ -struct file_operations ufs_file_operations = { +const struct file_operations ufs_file_operations = { .llseek = generic_file_llseek, .read = generic_file_read, .write = generic_file_write, diff -puN fs/xfs/linux-2.6/xfs_file.c~make-most-file-operations-structs-in-fs-const fs/xfs/linux-2.6/xfs_file.c --- devel/fs/xfs/linux-2.6/xfs_file.c~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/xfs/linux-2.6/xfs_file.c 2006-02-27 20:59:09.000000000 -0800 @@ -527,7 +527,7 @@ open_exec_out: } #endif /* HAVE_FOP_OPEN_EXEC */ -struct file_operations linvfs_file_operations = { +const struct file_operations linvfs_file_operations = { .llseek = generic_file_llseek, .read = do_sync_read, .write = do_sync_write, @@ -549,7 +549,7 @@ struct file_operations linvfs_file_opera #endif }; -struct file_operations linvfs_invis_file_operations = { +const struct file_operations linvfs_invis_file_operations = { .llseek = generic_file_llseek, .read = do_sync_read, .write = do_sync_write, @@ -569,7 +569,7 @@ struct file_operations linvfs_invis_file }; -struct file_operations linvfs_dir_operations = { +const struct file_operations linvfs_dir_operations = { .read = generic_read_dir, .readdir = linvfs_readdir, .unlocked_ioctl = linvfs_ioctl, diff -puN fs/xfs/linux-2.6/xfs_iops.h~make-most-file-operations-structs-in-fs-const fs/xfs/linux-2.6/xfs_iops.h --- devel/fs/xfs/linux-2.6/xfs_iops.h~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/fs/xfs/linux-2.6/xfs_iops.h 2006-02-27 20:59:09.000000000 -0800 @@ -22,9 +22,9 @@ extern struct inode_operations linvfs_fi extern struct inode_operations linvfs_dir_inode_operations; extern struct inode_operations linvfs_symlink_inode_operations; -extern struct file_operations linvfs_file_operations; -extern struct file_operations linvfs_invis_file_operations; -extern struct file_operations linvfs_dir_operations; +extern const struct file_operations linvfs_file_operations; +extern const struct file_operations linvfs_invis_file_operations; +extern const struct file_operations linvfs_dir_operations; extern int xfs_ioctl(struct bhv_desc *, struct inode *, struct file *, int, unsigned int, void __user *); diff -puN include/linux/coda_linux.h~make-most-file-operations-structs-in-fs-const include/linux/coda_linux.h --- devel/include/linux/coda_linux.h~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/include/linux/coda_linux.h 2006-02-27 20:59:09.000000000 -0800 @@ -30,9 +30,9 @@ extern struct inode_operations coda_ioct extern struct address_space_operations coda_file_aops; extern struct address_space_operations coda_symlink_aops; -extern struct file_operations coda_dir_operations; -extern struct file_operations coda_file_operations; -extern struct file_operations coda_ioctl_operations; +extern const struct file_operations coda_dir_operations; +extern const struct file_operations coda_file_operations; +extern const struct file_operations coda_ioctl_operations; /* operations shared over more than one file */ int coda_open(struct inode *i, struct file *f); diff -puN include/linux/crash_dump.h~make-most-file-operations-structs-in-fs-const include/linux/crash_dump.h --- devel/include/linux/crash_dump.h~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/include/linux/crash_dump.h 2006-02-27 20:59:09.000000000 -0800 @@ -11,7 +11,7 @@ extern unsigned long long elfcorehdr_addr; extern ssize_t copy_oldmem_page(unsigned long, char *, size_t, unsigned long, int); -extern struct file_operations proc_vmcore_operations; +extern const struct file_operations proc_vmcore_operations; extern struct proc_dir_entry *proc_vmcore; #endif /* CONFIG_CRASH_DUMP */ diff -puN include/linux/efs_fs.h~make-most-file-operations-structs-in-fs-const include/linux/efs_fs.h --- devel/include/linux/efs_fs.h~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/include/linux/efs_fs.h 2006-02-27 20:59:09.000000000 -0800 @@ -37,7 +37,7 @@ static inline struct efs_sb_info *SUPER_ struct statfs; extern struct inode_operations efs_dir_inode_operations; -extern struct file_operations efs_dir_operations; +extern const struct file_operations efs_dir_operations; extern struct address_space_operations efs_symlink_aops; extern void efs_read_inode(struct inode *); diff -puN include/linux/ext3_fs.h~make-most-file-operations-structs-in-fs-const include/linux/ext3_fs.h --- devel/include/linux/ext3_fs.h~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/include/linux/ext3_fs.h 2006-02-27 20:59:09.000000000 -0800 @@ -833,11 +833,11 @@ do { \ */ /* dir.c */ -extern struct file_operations ext3_dir_operations; +extern const struct file_operations ext3_dir_operations; /* file.c */ extern struct inode_operations ext3_file_inode_operations; -extern struct file_operations ext3_file_operations; +extern const struct file_operations ext3_file_operations; /* namei.c */ extern struct inode_operations ext3_dir_inode_operations; diff -puN include/linux/fs.h~make-most-file-operations-structs-in-fs-const include/linux/fs.h --- devel/include/linux/fs.h~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/include/linux/fs.h 2006-02-27 20:59:09.000000000 -0800 @@ -1389,11 +1389,11 @@ extern void bd_set_size(struct block_dev extern void bd_forget(struct inode *inode); extern void bdput(struct block_device *); extern struct block_device *open_by_devnum(dev_t, unsigned); -extern struct file_operations def_blk_fops; +extern const struct file_operations def_blk_fops; extern struct address_space_operations def_blk_aops; -extern struct file_operations def_chr_fops; -extern struct file_operations bad_sock_fops; -extern struct file_operations def_fifo_fops; +extern const struct file_operations def_chr_fops; +extern const struct file_operations bad_sock_fops; +extern const struct file_operations def_fifo_fops; extern int ioctl_by_bdev(struct block_device *, unsigned, unsigned long); extern int blkdev_ioctl(struct inode *, struct file *, unsigned, unsigned long); extern long compat_blkdev_ioctl(struct file *, unsigned, unsigned long); @@ -1436,12 +1436,12 @@ extern void init_special_inode(struct in extern void make_bad_inode(struct inode *); extern int is_bad_inode(struct inode *); -extern struct file_operations read_fifo_fops; -extern struct file_operations write_fifo_fops; -extern struct file_operations rdwr_fifo_fops; -extern struct file_operations read_pipe_fops; -extern struct file_operations write_pipe_fops; -extern struct file_operations rdwr_pipe_fops; +extern const struct file_operations read_fifo_fops; +extern const struct file_operations write_fifo_fops; +extern const struct file_operations rdwr_fifo_fops; +extern const struct file_operations read_pipe_fops; +extern const struct file_operations write_pipe_fops; +extern const struct file_operations rdwr_pipe_fops; extern int fs_may_remount_ro(struct super_block *); @@ -1684,7 +1684,7 @@ static inline ssize_t blockdev_direct_IO nr_segs, get_blocks, end_io, DIO_OWN_LOCKING); } -extern struct file_operations generic_ro_fops; +extern const struct file_operations generic_ro_fops; #define special_file(m) (S_ISCHR(m)||S_ISBLK(m)||S_ISFIFO(m)||S_ISSOCK(m)) @@ -1738,9 +1738,9 @@ extern int simple_commit_write(struct fi extern struct dentry *simple_lookup(struct inode *, struct dentry *, struct nameidata *); extern ssize_t generic_read_dir(struct file *, char __user *, size_t, loff_t *); -extern struct file_operations simple_dir_operations; +extern const struct file_operations simple_dir_operations; extern struct inode_operations simple_dir_inode_operations; -struct tree_descr { char *name; struct file_operations *ops; int mode; }; +struct tree_descr { char *name; const struct file_operations *ops; int mode; }; struct dentry *d_alloc_name(struct dentry *, const char *); extern int simple_fill_super(struct super_block *, int, struct tree_descr *); extern int simple_pin_fs(char *name, struct vfsmount **mount, int *count); diff -puN include/linux/hugetlb.h~make-most-file-operations-structs-in-fs-const include/linux/hugetlb.h --- devel/include/linux/hugetlb.h~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/include/linux/hugetlb.h 2006-02-27 20:59:09.000000000 -0800 @@ -145,7 +145,7 @@ static inline struct hugetlbfs_sb_info * return sb->s_fs_info; } -extern struct file_operations hugetlbfs_file_operations; +extern const struct file_operations hugetlbfs_file_operations; extern struct vm_operations_struct hugetlb_vm_ops; struct file *hugetlb_zero_setup(size_t); int hugetlb_get_quota(struct address_space *mapping); diff -puN include/linux/msdos_fs.h~make-most-file-operations-structs-in-fs-const include/linux/msdos_fs.h --- devel/include/linux/msdos_fs.h~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/include/linux/msdos_fs.h 2006-02-27 20:59:09.000000000 -0800 @@ -334,7 +334,7 @@ extern int fat_bmap(struct inode *inode, unsigned long *mapped_blocks); /* fat/dir.c */ -extern struct file_operations fat_dir_operations; +extern const struct file_operations fat_dir_operations; extern int fat_search_long(struct inode *inode, const unsigned char *name, int name_len, struct fat_slot_info *sinfo); extern int fat_dir_empty(struct inode *dir); @@ -397,7 +397,7 @@ extern int fat_count_free_clusters(struc /* fat/file.c */ extern int fat_generic_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg); -extern struct file_operations fat_file_operations; +extern const struct file_operations fat_file_operations; extern struct inode_operations fat_file_inode_operations; extern int fat_notify_change(struct dentry * dentry, struct iattr * attr); extern void fat_truncate(struct inode *inode); diff -puN include/linux/ncp_fs.h~make-most-file-operations-structs-in-fs-const include/linux/ncp_fs.h --- devel/include/linux/ncp_fs.h~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/include/linux/ncp_fs.h 2006-02-27 20:59:09.000000000 -0800 @@ -209,7 +209,7 @@ void ncp_update_inode2(struct inode *, s /* linux/fs/ncpfs/dir.c */ extern struct inode_operations ncp_dir_inode_operations; -extern struct file_operations ncp_dir_operations; +extern const struct file_operations ncp_dir_operations; int ncp_conn_logged_in(struct super_block *); int ncp_date_dos2unix(__le16 time, __le16 date); void ncp_date_unix2dos(int unix_date, __le16 * time, __le16 * date); @@ -230,7 +230,7 @@ void ncp_unlock_server(struct ncp_server /* linux/fs/ncpfs/file.c */ extern struct inode_operations ncp_file_inode_operations; -extern struct file_operations ncp_file_operations; +extern const struct file_operations ncp_file_operations; int ncp_make_open(struct inode *, int); /* linux/fs/ncpfs/mmap.c */ diff -puN include/linux/nfs_fs.h~make-most-file-operations-structs-in-fs-const include/linux/nfs_fs.h --- devel/include/linux/nfs_fs.h~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/include/linux/nfs_fs.h 2006-02-27 20:59:09.000000000 -0800 @@ -328,7 +328,7 @@ extern struct inode_operations nfs_file_ #ifdef CONFIG_NFS_V3 extern struct inode_operations nfs3_file_inode_operations; #endif /* CONFIG_NFS_V3 */ -extern struct file_operations nfs_file_operations; +extern const struct file_operations nfs_file_operations; extern struct address_space_operations nfs_file_aops; static inline struct rpc_cred *nfs_file_cred(struct file *file) @@ -375,7 +375,7 @@ extern struct inode_operations nfs_dir_i #ifdef CONFIG_NFS_V3 extern struct inode_operations nfs3_dir_inode_operations; #endif /* CONFIG_NFS_V3 */ -extern struct file_operations nfs_dir_operations; +extern const struct file_operations nfs_dir_operations; extern struct dentry_operations nfs_dentry_operations; extern int nfs_instantiate(struct dentry *dentry, struct nfs_fh *fh, struct nfs_fattr *fattr); diff -puN include/linux/proc_fs.h~make-most-file-operations-structs-in-fs-const include/linux/proc_fs.h --- devel/include/linux/proc_fs.h~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/include/linux/proc_fs.h 2006-02-27 20:59:09.000000000 -0800 @@ -127,9 +127,9 @@ extern int proc_match(int, const char *, extern int proc_readdir(struct file *, void *, filldir_t); extern struct dentry *proc_lookup(struct inode *, struct dentry *, struct nameidata *); -extern struct file_operations proc_kcore_operations; -extern struct file_operations proc_kmsg_operations; -extern struct file_operations ppc_htab_operations; +extern const struct file_operations proc_kcore_operations; +extern const struct file_operations proc_kmsg_operations; +extern const struct file_operations ppc_htab_operations; /* * proc_tty.c diff -puN include/linux/qnx4_fs.h~make-most-file-operations-structs-in-fs-const include/linux/qnx4_fs.h --- devel/include/linux/qnx4_fs.h~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/include/linux/qnx4_fs.h 2006-02-27 20:59:09.000000000 -0800 @@ -118,8 +118,8 @@ extern struct buffer_head *qnx4_bread(st extern struct inode_operations qnx4_file_inode_operations; extern struct inode_operations qnx4_dir_inode_operations; -extern struct file_operations qnx4_file_operations; -extern struct file_operations qnx4_dir_operations; +extern const struct file_operations qnx4_file_operations; +extern const struct file_operations qnx4_dir_operations; extern int qnx4_is_free(struct super_block *sb, long block); extern int qnx4_set_bitmap(struct super_block *sb, long block, int busy); extern int qnx4_create(struct inode *inode, struct dentry *dentry, int mode, struct nameidata *nd); diff -puN include/linux/ramfs.h~make-most-file-operations-structs-in-fs-const include/linux/ramfs.h --- devel/include/linux/ramfs.h~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/include/linux/ramfs.h 2006-02-27 20:59:09.000000000 -0800 @@ -15,7 +15,7 @@ extern unsigned long ramfs_nommu_get_unm extern int ramfs_nommu_mmap(struct file *file, struct vm_area_struct *vma); #endif -extern struct file_operations ramfs_file_operations; +extern const struct file_operations ramfs_file_operations; extern struct vm_operations_struct generic_file_vm_ops; #endif diff -puN include/linux/reiserfs_fs.h~make-most-file-operations-structs-in-fs-const include/linux/reiserfs_fs.h --- devel/include/linux/reiserfs_fs.h~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/include/linux/reiserfs_fs.h 2006-02-27 20:59:09.000000000 -0800 @@ -1960,7 +1960,7 @@ int reiserfs_global_version_in_proc(char extern struct inode_operations reiserfs_dir_inode_operations; extern struct inode_operations reiserfs_symlink_inode_operations; extern struct inode_operations reiserfs_special_inode_operations; -extern struct file_operations reiserfs_dir_operations; +extern const struct file_operations reiserfs_dir_operations; /* tail_conversion.c */ int direct2indirect(struct reiserfs_transaction_handle *, struct inode *, @@ -1972,7 +1972,7 @@ void reiserfs_unmap_buffer(struct buffer /* file.c */ extern struct inode_operations reiserfs_file_inode_operations; -extern struct file_operations reiserfs_file_operations; +extern const struct file_operations reiserfs_file_operations; extern struct address_space_operations reiserfs_address_space_operations; /* fix_nodes.c */ diff -puN include/linux/ufs_fs.h~make-most-file-operations-structs-in-fs-const include/linux/ufs_fs.h --- devel/include/linux/ufs_fs.h~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/include/linux/ufs_fs.h 2006-02-27 20:59:09.000000000 -0800 @@ -895,7 +895,7 @@ extern void ufs_set_link(struct inode *, /* file.c */ extern struct inode_operations ufs_file_inode_operations; -extern struct file_operations ufs_file_operations; +extern const struct file_operations ufs_file_operations; extern struct address_space_operations ufs_aops; @@ -915,7 +915,7 @@ extern struct buffer_head * ufs_bread (s extern int ufs_getfrag_block (struct inode *inode, sector_t fragment, struct buffer_head *bh_result, int create); /* namei.c */ -extern struct file_operations ufs_dir_operations; +extern const struct file_operations ufs_dir_operations; /* super.c */ extern void ufs_warning (struct super_block *, const char *, const char *, ...) __attribute__ ((format (printf, 3, 4))); diff -puN net/nonet.c~make-most-file-operations-structs-in-fs-const net/nonet.c --- devel/net/nonet.c~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/net/nonet.c 2006-02-27 20:59:09.000000000 -0800 @@ -19,7 +19,7 @@ static int sock_no_open(struct inode *ir return -ENXIO; } -struct file_operations bad_sock_fops = { +const struct file_operations bad_sock_fops = { .owner = THIS_MODULE, .open = sock_no_open, }; diff -puN net/socket.c~make-most-file-operations-structs-in-fs-const net/socket.c --- devel/net/socket.c~make-most-file-operations-structs-in-fs-const 2006-02-27 20:59:08.000000000 -0800 +++ devel-akpm/net/socket.c 2006-02-27 20:59:09.000000000 -0800 @@ -517,7 +517,7 @@ static int sock_no_open(struct inode *ir return -ENXIO; } -struct file_operations bad_sock_fops = { +const struct file_operations bad_sock_fops = { .owner = THIS_MODULE, .open = sock_no_open, }; _