Commit ee9b6d61 authored by Josef 'Jeff' Sipek's avatar Josef 'Jeff' Sipek Committed by Linus Torvalds

[PATCH] Mark struct super_operations const

This patch is inspired by Arjan's "Patch series to mark struct
file_operations and struct inode_operations const".

Compile tested with gcc & sparse.
Signed-off-by: default avatarJosef 'Jeff' Sipek <jsipek@cs.sunysb.edu>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent c5ef1c42
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
#include "fid.h" #include "fid.h"
static void v9fs_clear_inode(struct inode *); static void v9fs_clear_inode(struct inode *);
static struct super_operations v9fs_super_ops; static const struct super_operations v9fs_super_ops;
/** /**
* v9fs_clear_inode - release an inode * v9fs_clear_inode - release an inode
...@@ -263,7 +263,7 @@ v9fs_umount_begin(struct vfsmount *vfsmnt, int flags) ...@@ -263,7 +263,7 @@ v9fs_umount_begin(struct vfsmount *vfsmnt, int flags)
v9fs_session_cancel(v9ses); v9fs_session_cancel(v9ses);
} }
static struct super_operations v9fs_super_ops = { static const struct super_operations v9fs_super_ops = {
.statfs = simple_statfs, .statfs = simple_statfs,
.clear_inode = v9fs_clear_inode, .clear_inode = v9fs_clear_inode,
.show_options = v9fs_show_options, .show_options = v9fs_show_options,
......
...@@ -254,7 +254,7 @@ static void destroy_inodecache(void) ...@@ -254,7 +254,7 @@ static void destroy_inodecache(void)
kmem_cache_destroy(adfs_inode_cachep); kmem_cache_destroy(adfs_inode_cachep);
} }
static struct super_operations adfs_sops = { static const struct super_operations adfs_sops = {
.alloc_inode = adfs_alloc_inode, .alloc_inode = adfs_alloc_inode,
.destroy_inode = adfs_destroy_inode, .destroy_inode = adfs_destroy_inode,
.write_inode = adfs_write_inode, .write_inode = adfs_write_inode,
......
...@@ -112,7 +112,7 @@ static void destroy_inodecache(void) ...@@ -112,7 +112,7 @@ static void destroy_inodecache(void)
kmem_cache_destroy(affs_inode_cachep); kmem_cache_destroy(affs_inode_cachep);
} }
static struct super_operations affs_sops = { static const struct super_operations affs_sops = {
.alloc_inode = affs_alloc_inode, .alloc_inode = affs_alloc_inode,
.destroy_inode = affs_destroy_inode, .destroy_inode = affs_destroy_inode,
.read_inode = affs_read_inode, .read_inode = affs_read_inode,
......
...@@ -56,7 +56,7 @@ struct file_system_type afs_fs_type = { ...@@ -56,7 +56,7 @@ struct file_system_type afs_fs_type = {
.fs_flags = FS_BINARY_MOUNTDATA, .fs_flags = FS_BINARY_MOUNTDATA,
}; };
static struct super_operations afs_super_ops = { static const struct super_operations afs_super_ops = {
.statfs = simple_statfs, .statfs = simple_statfs,
.alloc_inode = afs_alloc_inode, .alloc_inode = afs_alloc_inode,
.drop_inode = generic_delete_inode, .drop_inode = generic_delete_inode,
......
...@@ -52,7 +52,7 @@ void autofs_kill_sb(struct super_block *sb) ...@@ -52,7 +52,7 @@ void autofs_kill_sb(struct super_block *sb)
static void autofs_read_inode(struct inode *inode); static void autofs_read_inode(struct inode *inode);
static struct super_operations autofs_sops = { static const struct super_operations autofs_sops = {
.read_inode = autofs_read_inode, .read_inode = autofs_read_inode,
.statfs = simple_statfs, .statfs = simple_statfs,
}; };
......
...@@ -196,7 +196,7 @@ static int autofs4_show_options(struct seq_file *m, struct vfsmount *mnt) ...@@ -196,7 +196,7 @@ static int autofs4_show_options(struct seq_file *m, struct vfsmount *mnt)
return 0; return 0;
} }
static struct super_operations autofs4_sops = { static const struct super_operations autofs4_sops = {
.statfs = simple_statfs, .statfs = simple_statfs,
.show_options = autofs4_show_options, .show_options = autofs4_show_options,
}; };
......
...@@ -270,7 +270,7 @@ static void destroy_inodecache(void) ...@@ -270,7 +270,7 @@ static void destroy_inodecache(void)
kmem_cache_destroy(bfs_inode_cachep); kmem_cache_destroy(bfs_inode_cachep);
} }
static struct super_operations bfs_sops = { static const struct super_operations bfs_sops = {
.alloc_inode = bfs_alloc_inode, .alloc_inode = bfs_alloc_inode,
.destroy_inode = bfs_destroy_inode, .destroy_inode = bfs_destroy_inode,
.read_inode = bfs_read_inode, .read_inode = bfs_read_inode,
......
...@@ -719,7 +719,7 @@ static const struct file_operations bm_status_operations = { ...@@ -719,7 +719,7 @@ static const struct file_operations bm_status_operations = {
/* Superblock handling */ /* Superblock handling */
static struct super_operations s_ops = { static const struct super_operations s_ops = {
.statfs = simple_statfs, .statfs = simple_statfs,
.clear_inode = bm_clear_inode, .clear_inode = bm_clear_inode,
}; };
......
...@@ -489,7 +489,7 @@ static void bdev_clear_inode(struct inode *inode) ...@@ -489,7 +489,7 @@ static void bdev_clear_inode(struct inode *inode)
spin_unlock(&bdev_lock); spin_unlock(&bdev_lock);
} }
static struct super_operations bdev_sops = { static const struct super_operations bdev_sops = {
.statfs = simple_statfs, .statfs = simple_statfs,
.alloc_inode = bdev_alloc_inode, .alloc_inode = bdev_alloc_inode,
.destroy_inode = bdev_destroy_inode, .destroy_inode = bdev_destroy_inode,
......
...@@ -64,7 +64,7 @@ extern struct task_struct * oplockThread; /* remove sparse warning */ ...@@ -64,7 +64,7 @@ extern struct task_struct * oplockThread; /* remove sparse warning */
struct task_struct * oplockThread = NULL; struct task_struct * oplockThread = NULL;
extern struct task_struct * dnotifyThread; /* remove sparse warning */ extern struct task_struct * dnotifyThread; /* remove sparse warning */
struct task_struct * dnotifyThread = NULL; struct task_struct * dnotifyThread = NULL;
static struct super_operations cifs_super_ops; static const struct super_operations cifs_super_ops;
unsigned int CIFSMaxBufSize = CIFS_MAX_MSGSIZE; unsigned int CIFSMaxBufSize = CIFS_MAX_MSGSIZE;
module_param(CIFSMaxBufSize, int, 0); module_param(CIFSMaxBufSize, int, 0);
MODULE_PARM_DESC(CIFSMaxBufSize,"Network buffer size (not including header). Default: 16384 Range: 8192 to 130048"); MODULE_PARM_DESC(CIFSMaxBufSize,"Network buffer size (not including header). Default: 16384 Range: 8192 to 130048");
...@@ -453,7 +453,7 @@ static int cifs_remount(struct super_block *sb, int *flags, char *data) ...@@ -453,7 +453,7 @@ static int cifs_remount(struct super_block *sb, int *flags, char *data)
return 0; return 0;
} }
static struct super_operations cifs_super_ops = { static const struct super_operations cifs_super_ops = {
.read_inode = cifs_read_inode, .read_inode = cifs_read_inode,
.put_super = cifs_put_super, .put_super = cifs_put_super,
.statfs = cifs_statfs, .statfs = cifs_statfs,
......
...@@ -36,7 +36,7 @@ extern const struct address_space_operations cifs_addr_ops; ...@@ -36,7 +36,7 @@ extern const struct address_space_operations cifs_addr_ops;
extern const struct address_space_operations cifs_addr_ops_smallbuf; extern const struct address_space_operations cifs_addr_ops_smallbuf;
/* Functions related to super block operations */ /* Functions related to super block operations */
/* extern struct super_operations cifs_super_ops;*/ /* extern const struct super_operations cifs_super_ops;*/
extern void cifs_read_inode(struct inode *); extern void cifs_read_inode(struct inode *);
extern void cifs_delete_inode(struct inode *); extern void cifs_delete_inode(struct inode *);
/* extern void cifs_write_inode(struct inode *); *//* BB not needed yet */ /* extern void cifs_write_inode(struct inode *); *//* BB not needed yet */
......
...@@ -90,7 +90,7 @@ static int coda_remount(struct super_block *sb, int *flags, char *data) ...@@ -90,7 +90,7 @@ static int coda_remount(struct super_block *sb, int *flags, char *data)
} }
/* exported operations */ /* exported operations */
static struct super_operations coda_super_operations = static const struct super_operations coda_super_operations =
{ {
.alloc_inode = coda_alloc_inode, .alloc_inode = coda_alloc_inode,
.destroy_inode = coda_destroy_inode, .destroy_inode = coda_destroy_inode,
......
...@@ -41,7 +41,7 @@ struct super_block * configfs_sb = NULL; ...@@ -41,7 +41,7 @@ struct super_block * configfs_sb = NULL;
struct kmem_cache *configfs_dir_cachep; struct kmem_cache *configfs_dir_cachep;
static int configfs_mnt_count = 0; static int configfs_mnt_count = 0;
static struct super_operations configfs_ops = { static const struct super_operations configfs_ops = {
.statfs = simple_statfs, .statfs = simple_statfs,
.drop_inode = generic_delete_inode, .drop_inode = generic_delete_inode,
}; };
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
#include <asm/uaccess.h> #include <asm/uaccess.h>
static struct super_operations cramfs_ops; static const struct super_operations cramfs_ops;
static const struct inode_operations cramfs_dir_inode_operations; static const struct inode_operations cramfs_dir_inode_operations;
static const struct file_operations cramfs_directory_operations; static const struct file_operations cramfs_directory_operations;
static const struct address_space_operations cramfs_aops; static const struct address_space_operations cramfs_aops;
...@@ -522,7 +522,7 @@ static const struct inode_operations cramfs_dir_inode_operations = { ...@@ -522,7 +522,7 @@ static const struct inode_operations cramfs_dir_inode_operations = {
.lookup = cramfs_lookup, .lookup = cramfs_lookup,
}; };
static struct super_operations cramfs_ops = { static const struct super_operations cramfs_ops = {
.put_super = cramfs_put_super, .put_super = cramfs_put_super,
.remount_fs = cramfs_remount, .remount_fs = cramfs_remount,
.statfs = cramfs_statfs, .statfs = cramfs_statfs,
......
...@@ -91,7 +91,7 @@ static int devpts_remount(struct super_block *sb, int *flags, char *data) ...@@ -91,7 +91,7 @@ static int devpts_remount(struct super_block *sb, int *flags, char *data)
return 0; return 0;
} }
static struct super_operations devpts_sops = { static const struct super_operations devpts_sops = {
.statfs = simple_statfs, .statfs = simple_statfs,
.remount_fs = devpts_remount, .remount_fs = devpts_remount,
}; };
......
...@@ -449,7 +449,7 @@ extern const struct file_operations ecryptfs_dir_fops; ...@@ -449,7 +449,7 @@ extern const struct file_operations ecryptfs_dir_fops;
extern const struct inode_operations ecryptfs_main_iops; extern const struct inode_operations ecryptfs_main_iops;
extern const struct inode_operations ecryptfs_dir_iops; extern const struct inode_operations ecryptfs_dir_iops;
extern const struct inode_operations ecryptfs_symlink_iops; extern const struct inode_operations ecryptfs_symlink_iops;
extern struct super_operations ecryptfs_sops; extern const struct super_operations ecryptfs_sops;
extern struct dentry_operations ecryptfs_dops; extern struct dentry_operations ecryptfs_dops;
extern struct address_space_operations ecryptfs_aops; extern struct address_space_operations ecryptfs_aops;
extern int ecryptfs_verbosity; extern int ecryptfs_verbosity;
......
...@@ -168,7 +168,7 @@ static int ecryptfs_show_options(struct seq_file *m, struct vfsmount *mnt) ...@@ -168,7 +168,7 @@ static int ecryptfs_show_options(struct seq_file *m, struct vfsmount *mnt)
return rc; return rc;
} }
struct super_operations ecryptfs_sops = { const struct super_operations ecryptfs_sops = {
.alloc_inode = ecryptfs_alloc_inode, .alloc_inode = ecryptfs_alloc_inode,
.destroy_inode = ecryptfs_destroy_inode, .destroy_inode = ecryptfs_destroy_inode,
.drop_inode = generic_delete_inode, .drop_inode = generic_delete_inode,
......
...@@ -105,7 +105,7 @@ static int efs_remount(struct super_block *sb, int *flags, char *data) ...@@ -105,7 +105,7 @@ static int efs_remount(struct super_block *sb, int *flags, char *data)
return 0; return 0;
} }
static struct super_operations efs_superblock_operations = { static const struct super_operations efs_superblock_operations = {
.alloc_inode = efs_alloc_inode, .alloc_inode = efs_alloc_inode,
.destroy_inode = efs_destroy_inode, .destroy_inode = efs_destroy_inode,
.read_inode = efs_read_inode, .read_inode = efs_read_inode,
......
...@@ -231,7 +231,7 @@ static ssize_t ext2_quota_read(struct super_block *sb, int type, char *data, siz ...@@ -231,7 +231,7 @@ static ssize_t ext2_quota_read(struct super_block *sb, int type, char *data, siz
static ssize_t ext2_quota_write(struct super_block *sb, int type, const char *data, size_t len, loff_t off); static ssize_t ext2_quota_write(struct super_block *sb, int type, const char *data, size_t len, loff_t off);
#endif #endif
static struct super_operations ext2_sops = { static const struct super_operations ext2_sops = {
.alloc_inode = ext2_alloc_inode, .alloc_inode = ext2_alloc_inode,
.destroy_inode = ext2_destroy_inode, .destroy_inode = ext2_destroy_inode,
.read_inode = ext2_read_inode, .read_inode = ext2_read_inode,
......
...@@ -639,7 +639,7 @@ static struct quotactl_ops ext3_qctl_operations = { ...@@ -639,7 +639,7 @@ static struct quotactl_ops ext3_qctl_operations = {
}; };
#endif #endif
static struct super_operations ext3_sops = { static const struct super_operations ext3_sops = {
.alloc_inode = ext3_alloc_inode, .alloc_inode = ext3_alloc_inode,
.destroy_inode = ext3_destroy_inode, .destroy_inode = ext3_destroy_inode,
.read_inode = ext3_read_inode, .read_inode = ext3_read_inode,
......
...@@ -690,7 +690,7 @@ static struct quotactl_ops ext4_qctl_operations = { ...@@ -690,7 +690,7 @@ static struct quotactl_ops ext4_qctl_operations = {
}; };
#endif #endif
static struct super_operations ext4_sops = { static const struct super_operations ext4_sops = {
.alloc_inode = ext4_alloc_inode, .alloc_inode = ext4_alloc_inode,
.destroy_inode = ext4_destroy_inode, .destroy_inode = ext4_destroy_inode,
.read_inode = ext4_read_inode, .read_inode = ext4_read_inode,
......
...@@ -618,7 +618,7 @@ int fat_sync_inode(struct inode *inode) ...@@ -618,7 +618,7 @@ int fat_sync_inode(struct inode *inode)
EXPORT_SYMBOL_GPL(fat_sync_inode); EXPORT_SYMBOL_GPL(fat_sync_inode);
static int fat_show_options(struct seq_file *m, struct vfsmount *mnt); static int fat_show_options(struct seq_file *m, struct vfsmount *mnt);
static struct super_operations fat_sops = { static const struct super_operations fat_sops = {
.alloc_inode = fat_alloc_inode, .alloc_inode = fat_alloc_inode,
.destroy_inode = fat_destroy_inode, .destroy_inode = fat_destroy_inode,
.write_inode = fat_write_inode, .write_inode = fat_write_inode,
......
...@@ -59,7 +59,7 @@ static void vxfs_put_super(struct super_block *); ...@@ -59,7 +59,7 @@ static void vxfs_put_super(struct super_block *);
static int vxfs_statfs(struct dentry *, struct kstatfs *); static int vxfs_statfs(struct dentry *, struct kstatfs *);
static int vxfs_remount(struct super_block *, int *, char *); static int vxfs_remount(struct super_block *, int *, char *);
static struct super_operations vxfs_super_ops = { static const struct super_operations vxfs_super_ops = {
.read_inode = vxfs_read_inode, .read_inode = vxfs_read_inode,
.clear_inode = vxfs_clear_inode, .clear_inode = vxfs_clear_inode,
.put_super = vxfs_put_super, .put_super = vxfs_put_super,
......
...@@ -446,7 +446,7 @@ static struct inode *get_root_inode(struct super_block *sb, unsigned mode) ...@@ -446,7 +446,7 @@ static struct inode *get_root_inode(struct super_block *sb, unsigned mode)
return fuse_iget(sb, 1, 0, &attr); return fuse_iget(sb, 1, 0, &attr);
} }
static struct super_operations fuse_super_operations = { static const struct super_operations fuse_super_operations = {
.alloc_inode = fuse_alloc_inode, .alloc_inode = fuse_alloc_inode,
.destroy_inode = fuse_destroy_inode, .destroy_inode = fuse_destroy_inode,
.read_inode = fuse_read_inode, .read_inode = fuse_read_inode,
......
...@@ -468,7 +468,7 @@ static void gfs2_destroy_inode(struct inode *inode) ...@@ -468,7 +468,7 @@ static void gfs2_destroy_inode(struct inode *inode)
kmem_cache_free(gfs2_inode_cachep, inode); kmem_cache_free(gfs2_inode_cachep, inode);
} }
struct super_operations gfs2_super_ops = { const struct super_operations gfs2_super_ops = {
.alloc_inode = gfs2_alloc_inode, .alloc_inode = gfs2_alloc_inode,
.destroy_inode = gfs2_destroy_inode, .destroy_inode = gfs2_destroy_inode,
.write_inode = gfs2_write_inode, .write_inode = gfs2_write_inode,
......
...@@ -12,6 +12,6 @@ ...@@ -12,6 +12,6 @@
#include <linux/fs.h> #include <linux/fs.h>
extern struct super_operations gfs2_super_ops; extern const struct super_operations gfs2_super_ops;
#endif /* __OPS_SUPER_DOT_H__ */ #endif /* __OPS_SUPER_DOT_H__ */
...@@ -154,7 +154,7 @@ static void hfs_destroy_inode(struct inode *inode) ...@@ -154,7 +154,7 @@ static void hfs_destroy_inode(struct inode *inode)
kmem_cache_free(hfs_inode_cachep, HFS_I(inode)); kmem_cache_free(hfs_inode_cachep, HFS_I(inode));
} }
static struct super_operations hfs_super_operations = { static const struct super_operations hfs_super_operations = {
.alloc_inode = hfs_alloc_inode, .alloc_inode = hfs_alloc_inode,
.destroy_inode = hfs_destroy_inode, .destroy_inode = hfs_destroy_inode,
.write_inode = hfs_write_inode, .write_inode = hfs_write_inode,
......
...@@ -260,7 +260,7 @@ static int hfsplus_remount(struct super_block *sb, int *flags, char *data) ...@@ -260,7 +260,7 @@ static int hfsplus_remount(struct super_block *sb, int *flags, char *data)
return 0; return 0;
} }
static struct super_operations hfsplus_sops = { static const struct super_operations hfsplus_sops = {
.alloc_inode = hfsplus_alloc_inode, .alloc_inode = hfsplus_alloc_inode,
.destroy_inode = hfsplus_destroy_inode, .destroy_inode = hfsplus_destroy_inode,
.read_inode = hfsplus_read_inode, .read_inode = hfsplus_read_inode,
......
...@@ -309,7 +309,7 @@ static void hostfs_read_inode(struct inode *inode) ...@@ -309,7 +309,7 @@ static void hostfs_read_inode(struct inode *inode)
read_inode(inode); read_inode(inode);
} }
static struct super_operations hostfs_sbops = { static const struct super_operations hostfs_sbops = {
.alloc_inode = hostfs_alloc_inode, .alloc_inode = hostfs_alloc_inode,
.drop_inode = generic_delete_inode, .drop_inode = generic_delete_inode,
.delete_inode = hostfs_delete_inode, .delete_inode = hostfs_delete_inode,
......
...@@ -426,7 +426,7 @@ static int hpfs_remount_fs(struct super_block *s, int *flags, char *data) ...@@ -426,7 +426,7 @@ static int hpfs_remount_fs(struct super_block *s, int *flags, char *data)
/* Super operations */ /* Super operations */
static struct super_operations hpfs_sops = static const struct super_operations hpfs_sops =
{ {
.alloc_inode = hpfs_alloc_inode, .alloc_inode = hpfs_alloc_inode,
.destroy_inode = hpfs_destroy_inode, .destroy_inode = hpfs_destroy_inode,
......
...@@ -43,7 +43,7 @@ static inline struct hppfs_inode_info *HPPFS_I(struct inode *inode) ...@@ -43,7 +43,7 @@ static inline struct hppfs_inode_info *HPPFS_I(struct inode *inode)
#define HPPFS_SUPER_MAGIC 0xb00000ee #define HPPFS_SUPER_MAGIC 0xb00000ee
static struct super_operations hppfs_sbops; static const struct super_operations hppfs_sbops;
static int is_pid(struct dentry *dentry) static int is_pid(struct dentry *dentry)
{ {
...@@ -649,7 +649,7 @@ static void hppfs_destroy_inode(struct inode *inode) ...@@ -649,7 +649,7 @@ static void hppfs_destroy_inode(struct inode *inode)
kfree(HPPFS_I(inode)); kfree(HPPFS_I(inode));
} }
static struct super_operations hppfs_sbops = { static const struct super_operations hppfs_sbops = {
.alloc_inode = hppfs_alloc_inode, .alloc_inode = hppfs_alloc_inode,
.destroy_inode = hppfs_destroy_inode, .destroy_inode = hppfs_destroy_inode,
.read_inode = hppfs_read_inode, .read_inode = hppfs_read_inode,
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
/* some random number */ /* some random number */
#define HUGETLBFS_MAGIC 0x958458f6 #define HUGETLBFS_MAGIC 0x958458f6
static struct super_operations hugetlbfs_ops; static const struct super_operations hugetlbfs_ops;
static const struct address_space_operations hugetlbfs_aops; static const struct address_space_operations hugetlbfs_aops;
const struct file_operations hugetlbfs_file_operations; const struct file_operations hugetlbfs_file_operations;
static const struct inode_operations hugetlbfs_dir_inode_operations; static const struct inode_operations hugetlbfs_dir_inode_operations;
...@@ -580,7 +580,7 @@ static const struct inode_operations hugetlbfs_inode_operations = { ...@@ -580,7 +580,7 @@ static const struct inode_operations hugetlbfs_inode_operations = {
.setattr = hugetlbfs_setattr, .setattr = hugetlbfs_setattr,
}; };
static struct super_operations hugetlbfs_ops = { static const struct super_operations hugetlbfs_ops = {
.alloc_inode = hugetlbfs_alloc_inode, .alloc_inode = hugetlbfs_alloc_inode,
.destroy_inode = hugetlbfs_destroy_inode, .destroy_inode = hugetlbfs_destroy_inode,
.statfs = hugetlbfs_statfs, .statfs = hugetlbfs_statfs,
......
...@@ -1000,7 +1000,7 @@ EXPORT_SYMBOL(remove_inode_hash); ...@@ -1000,7 +1000,7 @@ EXPORT_SYMBOL(remove_inode_hash);
*/ */
void generic_delete_inode(struct inode *inode) void generic_delete_inode(struct inode *inode)
{ {
struct super_operations *op = inode->i_sb->s_op; const struct super_operations *op = inode->i_sb->s_op;
list_del_init(&inode->i_list); list_del_init(&inode->i_list);
list_del_init(&inode->i_sb_list); list_del_init(&inode->i_sb_list);
...@@ -1093,7 +1093,7 @@ EXPORT_SYMBOL_GPL(generic_drop_inode); ...@@ -1093,7 +1093,7 @@ EXPORT_SYMBOL_GPL(generic_drop_inode);
*/ */
static inline void iput_final(struct inode *inode) static inline void iput_final(struct inode *inode)
{ {
struct super_operations *op = inode->i_sb->s_op; const struct super_operations *op = inode->i_sb->s_op;
void (*drop)(struct inode *) = generic_drop_inode; void (*drop)(struct inode *) = generic_drop_inode;
if (op && op->drop_inode) if (op && op->drop_inode)
...@@ -1113,7 +1113,7 @@ static inline void iput_final(struct inode *inode) ...@@ -1113,7 +1113,7 @@ static inline void iput_final(struct inode *inode)
void iput(struct inode *inode) void iput(struct inode *inode)
{ {
if (inode) { if (inode) {
struct super_operations *op = inode->i_sb->s_op; const struct super_operations *op = inode->i_sb->s_op;
BUG_ON(inode->i_state == I_CLEAR); BUG_ON(inode->i_state == I_CLEAR);
......
...@@ -106,7 +106,7 @@ static int isofs_remount(struct super_block *sb, int *flags, char *data) ...@@ -106,7 +106,7 @@ static int isofs_remount(struct super_block *sb, int *flags, char *data)
return 0; return 0;
} }
static struct super_operations isofs_sops = { static const struct super_operations isofs_sops = {
.alloc_inode = isofs_alloc_inode, .alloc_inode = isofs_alloc_inode,
.destroy_inode = isofs_destroy_inode, .destroy_inode = isofs_destroy_inode,
.read_inode = isofs_read_inode, .read_inode = isofs_read_inode,
......
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
static int jffs_remove(struct inode *dir, struct dentry *dentry, int type); static int jffs_remove(struct inode *dir, struct dentry *dentry, int type);
static struct super_operations jffs_ops; static const struct super_operations jffs_ops;
static const struct file_operations jffs_file_operations; static const struct file_operations jffs_file_operations;
static const struct inode_operations jffs_file_inode_operations; static const struct inode_operations jffs_file_inode_operations;
static const struct file_operations jffs_dir_operations; static const struct file_operations jffs_dir_operations;
...@@ -1774,7 +1774,7 @@ static int jffs_remount(struct super_block *sb, int *flags, char *data) ...@@ -1774,7 +1774,7 @@ static int jffs_remount(struct super_block *sb, int *flags, char *data)
return 0; return 0;
} }
static struct super_operations jffs_ops = static const struct super_operations jffs_ops =
{ {
.read_inode = jffs_read_inode, .read_inode = jffs_read_inode,
.delete_inode = jffs_delete_inode, .delete_inode = jffs_delete_inode,
......
...@@ -66,7 +66,7 @@ static int jffs2_sync_fs(struct super_block *sb, int wait) ...@@ -66,7 +66,7 @@ static int jffs2_sync_fs(struct super_block *sb, int wait)
return 0; return 0;
} }
static struct super_operations jffs2_super_operations = static const struct super_operations jffs2_super_operations =
{ {
.alloc_inode = jffs2_alloc_inode, .alloc_inode = jffs2_alloc_inode,
.destroy_inode =jffs2_destroy_inode, .destroy_inode =jffs2_destroy_inode,
......
...@@ -46,7 +46,7 @@ MODULE_LICENSE("GPL"); ...@@ -46,7 +46,7 @@ MODULE_LICENSE("GPL");
static struct kmem_cache * jfs_inode_cachep; static struct kmem_cache * jfs_inode_cachep;
static struct super_operations jfs_super_operations; static const struct super_operations jfs_super_operations;
static struct export_operations jfs_export_operations; static struct export_operations jfs_export_operations;
static struct file_system_type jfs_fs_type; static struct file_system_type jfs_fs_type;
...@@ -716,7 +716,7 @@ static ssize_t jfs_quota_write(struct super_block *sb, int type, ...@@ -716,7 +716,7 @@ static ssize_t jfs_quota_write(struct super_block *sb, int type,
#endif #endif
static struct super_operations jfs_super_operations = { static const struct super_operations jfs_super_operations = {
.alloc_inode = jfs_alloc_inode, .alloc_inode = jfs_alloc_inode,
.destroy_inode = jfs_destroy_inode, .destroy_inode = jfs_destroy_inode,
.read_inode = jfs_read_inode, .read_inode = jfs_read_inode,
......
...@@ -195,11 +195,11 @@ const struct inode_operations simple_dir_inode_operations = { ...@@ -195,11 +195,11 @@ const struct inode_operations simple_dir_inode_operations = {
* will never be mountable) * will never be mountable)
*/ */
int get_sb_pseudo(struct file_system_type *fs_type, char *name, int get_sb_pseudo(struct file_system_type *fs_type, char *name,
struct super_operations *ops, unsigned long magic, const struct super_operations *ops, unsigned long magic,
struct vfsmount *mnt) struct vfsmount *mnt)
{ {
struct super_block *s = sget(fs_type, NULL, set_anon_super, NULL); struct super_block *s = sget(fs_type, NULL, set_anon_super, NULL);
static struct super_operations default_ops = {.statfs = simple_statfs}; static const struct super_operations default_ops = {.statfs = simple_statfs};
struct dentry *dentry; struct dentry *dentry;
struct inode *root; struct inode *root;
struct qstr d_name = {.name = name, .len = strlen(name)}; struct qstr d_name = {.name = name, .len = strlen(name)};
......
...@@ -95,7 +95,7 @@ static void destroy_inodecache(void) ...@@ -95,7 +95,7 @@ static void destroy_inodecache(void)
kmem_cache_destroy(minix_inode_cachep); kmem_cache_destroy(minix_inode_cachep);
} }
static struct super_operations minix_sops = { static const struct super_operations minix_sops = {
.alloc_inode = minix_alloc_inode, .alloc_inode = minix_alloc_inode,
.destroy_inode = minix_destroy_inode, .destroy_inode = minix_destroy_inode,
.read_inode = minix_read_inode, .read_inode = minix_read_inode,
......
...@@ -90,7 +90,7 @@ static int ncp_remount(struct super_block *sb, int *flags, char* data) ...@@ -90,7 +90,7 @@ static int ncp_remount(struct super_block *sb, int *flags, char* data)
return 0; return 0;
} }
static struct super_operations ncp_sops = static const struct super_operations ncp_sops =
{ {
.alloc_inode = ncp_alloc_inode, .alloc_inode = ncp_alloc_inode,
.destroy_inode = ncp_destroy_inode, .destroy_inode = ncp_destroy_inode,
......
...@@ -82,7 +82,7 @@ struct file_system_type nfs_xdev_fs_type = { ...@@ -82,7 +82,7 @@ struct file_system_type nfs_xdev_fs_type = {
.fs_flags = FS_RENAME_DOES_D_MOVE|FS_REVAL_DOT|FS_BINARY_MOUNTDATA, .fs_flags = FS_RENAME_DOES_D_MOVE|FS_REVAL_DOT|FS_BINARY_MOUNTDATA,
}; };
static struct super_operations nfs_sops = { static const struct super_operations nfs_sops = {
.alloc_inode = nfs_alloc_inode, .alloc_inode = nfs_alloc_inode,
.destroy_inode = nfs_destroy_inode, .destroy_inode = nfs_destroy_inode,
.write_inode = nfs_write_inode, .write_inode = nfs_write_inode,
...@@ -126,7 +126,7 @@ struct file_system_type nfs4_referral_fs_type = { ...@@ -126,7 +126,7 @@ struct file_system_type nfs4_referral_fs_type = {
.fs_flags = FS_RENAME_DOES_D_MOVE|FS_REVAL_DOT|FS_BINARY_MOUNTDATA, .fs_flags = FS_RENAME_DOES_D_MOVE|FS_REVAL_DOT|FS_BINARY_MOUNTDATA,
}; };
static struct super_operations nfs4_sops = { static const struct super_operations nfs4_sops = {