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

[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 @@
#include "fid.h"
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
......@@ -263,7 +263,7 @@ v9fs_umount_begin(struct vfsmount *vfsmnt, int flags)
v9fs_session_cancel(v9ses);
}
static struct super_operations v9fs_super_ops = {
static const struct super_operations v9fs_super_ops = {
.statfs = simple_statfs,
.clear_inode = v9fs_clear_inode,
.show_options = v9fs_show_options,
......
......@@ -254,7 +254,7 @@ static void destroy_inodecache(void)
kmem_cache_destroy(adfs_inode_cachep);
}
static struct super_operations adfs_sops = {
static const struct super_operations adfs_sops = {
.alloc_inode = adfs_alloc_inode,
.destroy_inode = adfs_destroy_inode,
.write_inode = adfs_write_inode,
......
......@@ -112,7 +112,7 @@ static void destroy_inodecache(void)
kmem_cache_destroy(affs_inode_cachep);
}
static struct super_operations affs_sops = {
static const struct super_operations affs_sops = {
.alloc_inode = affs_alloc_inode,
.destroy_inode = affs_destroy_inode,
.read_inode = affs_read_inode,
......
......@@ -56,7 +56,7 @@ struct file_system_type afs_fs_type = {
.fs_flags = FS_BINARY_MOUNTDATA,
};
static struct super_operations afs_super_ops = {
static const struct super_operations afs_super_ops = {
.statfs = simple_statfs,
.alloc_inode = afs_alloc_inode,
.drop_inode = generic_delete_inode,
......
......@@ -52,7 +52,7 @@ out_kill_sb:
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,
.statfs = simple_statfs,
};
......
......@@ -196,7 +196,7 @@ static int autofs4_show_options(struct seq_file *m, struct vfsmount *mnt)
return 0;
}
static struct super_operations autofs4_sops = {
static const struct super_operations autofs4_sops = {
.statfs = simple_statfs,
.show_options = autofs4_show_options,
};
......
......@@ -270,7 +270,7 @@ static void destroy_inodecache(void)
kmem_cache_destroy(bfs_inode_cachep);
}
static struct super_operations bfs_sops = {
static const struct super_operations bfs_sops = {
.alloc_inode = bfs_alloc_inode,
.destroy_inode = bfs_destroy_inode,
.read_inode = bfs_read_inode,
......
......@@ -719,7 +719,7 @@ static const struct file_operations bm_status_operations = {
/* Superblock handling */
static struct super_operations s_ops = {
static const struct super_operations s_ops = {
.statfs = simple_statfs,
.clear_inode = bm_clear_inode,
};
......
......@@ -489,7 +489,7 @@ static void bdev_clear_inode(struct inode *inode)
spin_unlock(&bdev_lock);
}
static struct super_operations bdev_sops = {
static const struct super_operations bdev_sops = {
.statfs = simple_statfs,
.alloc_inode = bdev_alloc_inode,
.destroy_inode = bdev_destroy_inode,
......
......@@ -64,7 +64,7 @@ extern struct task_struct * oplockThread; /* remove sparse warning */
struct task_struct * oplockThread = NULL;
extern struct task_struct * dnotifyThread; /* remove sparse warning */
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;
module_param(CIFSMaxBufSize, int, 0);
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)
return 0;
}
static struct super_operations cifs_super_ops = {
static const struct super_operations cifs_super_ops = {
.read_inode = cifs_read_inode,
.put_super = cifs_put_super,
.statfs = cifs_statfs,
......
......@@ -36,7 +36,7 @@ extern const struct address_space_operations cifs_addr_ops;
extern const struct address_space_operations cifs_addr_ops_smallbuf;
/* 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_delete_inode(struct inode *);
/* 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)
}
/* exported operations */
static struct super_operations coda_super_operations =
static const struct super_operations coda_super_operations =
{
.alloc_inode = coda_alloc_inode,
.destroy_inode = coda_destroy_inode,
......
......@@ -41,7 +41,7 @@ struct super_block * configfs_sb = NULL;
struct kmem_cache *configfs_dir_cachep;
static int configfs_mnt_count = 0;
static struct super_operations configfs_ops = {
static const struct super_operations configfs_ops = {
.statfs = simple_statfs,
.drop_inode = generic_delete_inode,
};
......
......@@ -27,7 +27,7 @@
#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 file_operations cramfs_directory_operations;
static const struct address_space_operations cramfs_aops;
......@@ -522,7 +522,7 @@ static const struct inode_operations cramfs_dir_inode_operations = {
.lookup = cramfs_lookup,
};
static struct super_operations cramfs_ops = {
static const struct super_operations cramfs_ops = {
.put_super = cramfs_put_super,
.remount_fs = cramfs_remount,
.statfs = cramfs_statfs,
......
......@@ -91,7 +91,7 @@ static int devpts_remount(struct super_block *sb, int *flags, char *data)
return 0;
}
static struct super_operations devpts_sops = {
static const struct super_operations devpts_sops = {
.statfs = simple_statfs,
.remount_fs = devpts_remount,
};
......
......@@ -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_dir_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 address_space_operations ecryptfs_aops;
extern int ecryptfs_verbosity;
......
......@@ -168,7 +168,7 @@ out:
return rc;
}
struct super_operations ecryptfs_sops = {
const struct super_operations ecryptfs_sops = {
.alloc_inode = ecryptfs_alloc_inode,
.destroy_inode = ecryptfs_destroy_inode,
.drop_inode = generic_delete_inode,
......
......@@ -105,7 +105,7 @@ static int efs_remount(struct super_block *sb, int *flags, char *data)
return 0;
}
static struct super_operations efs_superblock_operations = {
static const struct super_operations efs_superblock_operations = {
.alloc_inode = efs_alloc_inode,
.destroy_inode = efs_destroy_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
static ssize_t ext2_quota_write(struct super_block *sb, int type, const char *data, size_t len, loff_t off);
#endif
static struct super_operations ext2_sops = {
static const struct super_operations ext2_sops = {
.alloc_inode = ext2_alloc_inode,
.destroy_inode = ext2_destroy_inode,
.read_inode = ext2_read_inode,
......
......@@ -639,7 +639,7 @@ static struct quotactl_ops ext3_qctl_operations = {
};
#endif
static struct super_operations ext3_sops = {
static const struct super_operations ext3_sops = {
.alloc_inode = ext3_alloc_inode,
.destroy_inode = ext3_destroy_inode,
.read_inode = ext3_read_inode,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment