const: make struct super_block::dq_op const
Subsystems (46)
PATCH 1/9 const: make struct super_block::dq_op const
Signed-off-by Alexey Dobriyan <[email protected]>
---
fs/ext3/super.c | 2 +- fs/ext4/super.c | 2 +- fs/ocfs2/quota.h | 2 +- fs/ocfs2/quota_global.c | 2 +- fs/quota/dquot.c | 2 +- fs/reiserfs/super.c | 2 +- include/linux/fs.h | 2 +- include/linux/quotaops.h | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-)
fs/ext3/super.c +1 -1
@@ -720,7 +720,7 @@ static ssize_t ext3_quota_read(struct super_block *sb, int type, char *data,static ssize_t ext3_quota_write (struct super_block *sb,int type,const char *data,size_t len,loff_t off); -static struct dquot_operations ext3_quota_operations = { +static const struct dquot_operations ext3_quota_operations = { .initialize = dquot_initialize, .drop = dquot_drop, .alloc_space = dquot_alloc_space,
fs/ext4/super.c +1 -1
@@ -962,7 +962,7 @@ static ssize_t ext4_quota_read(struct super_block *sb, int type, char *data,static ssize_t ext4_quota_write (struct super_block *sb,int type,const char *data,size_t len,loff_t off); -static struct dquot_operations ext4_quota_operations = { +static const struct dquot_operations ext4_quota_operations = { .initialize = dquot_initialize, .drop = dquot_drop, .alloc_space = dquot_alloc_space,
fs/ocfs2/quota.h +1 -1
@@ -109,7 +109,7 @@ void ocfs2_unlock_global_qf(struct ocfs2_mem_dqinfo *oinfo, int ex);int ocfs2_read_quota_block (struct inode *inode,u64 v_block,struct buffer_head **bh); -extern struct dquot_operations ocfs2_quota_operations; +extern const struct dquot_operations ocfs2_quota_operations;extern struct quota_format_type ocfs2_quota_format;int ocfs2_quota_setup (void );
fs/ocfs2/quota_global.c +1 -1
@@ -849,7 +849,7 @@ static void ocfs2_destroy_dquot(struct dquot *dquot)kmem_cache_free (ocfs2_dquot_cachep, dquot); } -struct dquot_operations ocfs2_quota_operations = { +const struct dquot_operations ocfs2_quota_operations = { .initialize = dquot_initialize, .drop = dquot_drop, .alloc_space = dquot_alloc_space,
fs/quota/dquot.c +1 -1
@@ -1839,7 +1839,7 @@ EXPORT_SYMBOL(dquot_commit_info);/* * Definitions of diskquota operations. */ -struct dquot_operations dquot_operations = { +const struct dquot_operations dquot_operations = { .initialize = dquot_initialize, .drop = dquot_drop, .alloc_space = dquot_alloc_space,
fs/reiserfs/super.c +1 -1
@@ -612,7 +612,7 @@ static int reiserfs_mark_dquot_dirty(struct dquot *);static int reiserfs_write_info (struct super_block *,int );static int reiserfs_quota_on (struct super_block *,int ,int ,char *,int ); -static struct dquot_operations reiserfs_quota_operations = { +static const struct dquot_operations reiserfs_quota_operations = { .initialize = dquot_initialize, .drop = dquot_drop, .alloc_space = dquot_alloc_space,
include/linux/fs.h +1 -1
@@ -1319,7 +1319,7 @@ struct super_block {unsigned long long s_maxbytes;/* Max file size */ struct file_system_type *s_type;const struct super_operations *s_op; -struct dquot_operations *dq_op; +const struct dquot_operations *dq_op;struct quotactl_ops *s_qcop;const struct export_operations *s_export_op;unsigned long s_flags;
include/linux/quotaops.h +1 -1
@@ -135,7 +135,7 @@ static inline int sb_any_quota_active(struct super_block *sb)/* * Operations supported for diskquotas. */ -extern struct dquot_operations dquot_operations; +extern const struct dquot_operations dquot_operations;extern struct quotactl_ops vfs_quotactl_ops;#define sb_dquot_ops (&dquot_operations)
PATCH 2/9 const: make struct super_block::s_qcop const
Signed-off-by Alexey Dobriyan <[email protected]>
---
fs/cifs/cifsfs.c | 4 ++-- fs/ext3/super.c | 2 +- fs/ext4/super.c | 2 +- fs/ocfs2/super.c | 2 +- fs/quota/dquot.c | 2 +- fs/reiserfs/super.c | 2 +- fs/xfs/linux-2.6/xfs_quotaops.c | 2 +- fs/xfs/linux-2.6/xfs_super.h | 2 +- include/linux/fs.h | 2 +- include/linux/quotaops.h | 2 +- 10 files changed, 11 insertions(+), 11 deletions(-)
fs/cifs/cifsfs.c +2 -2
@@ -50,7 +50,7 @@#define CIFS_MAGIC_NUMBER 0xFF534D42/* the first four bytes of SMB PDUs */ #ifdef CONFIG_CIFS_QUOTA -static struct quotactl_ops cifs_quotactl_ops; +static const struct quotactl_ops cifs_quotactl_ops;#endif /* QUOTA */ int cifsFYI =0 ;
@@ -520,7 +520,7 @@ int cifs_xstate_get(struct super_block *sb, struct fs_quota_stat *qstats)return rc; } -static struct quotactl_ops cifs_quotactl_ops = { +static const struct quotactl_ops cifs_quotactl_ops = { .set_xquota = cifs_xquota_set, .get_xquota = cifs_xquota_get, .set_xstate = cifs_xstate_set,
fs/ext3/super.c +1 -1
@@ -737,7 +737,7 @@ static const struct dquot_operations ext3_quota_operations = { .destroy_dquot = dquot_destroy, }; -static struct quotactl_ops ext3_qctl_operations = { +static const struct quotactl_ops ext3_qctl_operations = { .quota_on = ext3_quota_on, .quota_off = vfs_quota_off, .quota_sync = vfs_quota_sync,
fs/ext4/super.c +1 -1
@@ -983,7 +983,7 @@ static const struct dquot_operations ext4_quota_operations = { .destroy_dquot = dquot_destroy, }; -static struct quotactl_ops ext4_qctl_operations = { +static const struct quotactl_ops ext4_qctl_operations = { .quota_on = ext4_quota_on, .quota_off = vfs_quota_off, .quota_sync = vfs_quota_sync,
fs/ocfs2/super.c +1 -1
@@ -965,7 +965,7 @@ static int ocfs2_quota_off(struct super_block *sb, int type, int remount)return vfs_quota_disable (sb, type,DQUOT_LIMITS_ENABLED ); } -static struct quotactl_ops ocfs2_quotactl_ops = { +static const struct quotactl_ops ocfs2_quotactl_ops = { .quota_on = ocfs2_quota_on, .quota_off = ocfs2_quota_off, .quota_sync = vfs_quota_sync,
fs/quota/dquot.c +1 -1
@@ -2461,7 +2461,7 @@ out: }EXPORT_SYMBOL (vfs_set_dqinfo); -struct quotactl_ops vfs_quotactl_ops = { +const struct quotactl_ops vfs_quotactl_ops = { .quota_on = vfs_quota_on, .quota_off = vfs_quota_off, .quota_sync = vfs_quota_sync,
fs/reiserfs/super.c +1 -1
@@ -629,7 +629,7 @@ static const struct dquot_operations reiserfs_quota_operations = { .destroy_dquot = dquot_destroy, }; -static struct quotactl_ops reiserfs_qctl_operations = { +static const struct quotactl_ops reiserfs_qctl_operations = { .quota_on = reiserfs_quota_on, .quota_off = vfs_quota_off, .quota_sync = vfs_quota_sync,
fs/xfs/linux-2.6/xfs_quotaops.c +1 -1
@@ -150,7 +150,7 @@ xfs_fs_set_xquota(return -xfs_qm_scall_setqlim (mp, id,xfs_quota_type (type), fdq); } -struct quotactl_ops xfs_quotactl_operations = { +const struct quotactl_ops xfs_quotactl_operations = { .quota_sync = xfs_fs_quota_sync, .get_xstate = xfs_fs_get_xstate, .set_xstate = xfs_fs_set_xstate,
fs/xfs/linux-2.6/xfs_super.h +1 -1
@@ -93,7 +93,7 @@ extern void xfs_blkdev_issue_flush(struct xfs_buftarg *);extern const struct export_operations xfs_export_operations;extern struct xattr_handler *xfs_xattr_handlers[]; -extern struct quotactl_ops xfs_quotactl_operations; +extern const struct quotactl_ops xfs_quotactl_operations;#define XFS_M (sb) ((struct xfs_mount *)((sb)->s_fs_info))
include/linux/fs.h +1 -1
@@ -1320,7 +1320,7 @@ struct super_block {struct file_system_type *s_type;const struct super_operations *s_op;const struct dquot_operations *dq_op; -struct quotactl_ops *s_qcop; +const struct quotactl_ops *s_qcop;const struct export_operations *s_export_op;unsigned long s_flags;unsigned long s_magic;
include/linux/quotaops.h +1 -1
@@ -136,7 +136,7 @@ static inline int sb_any_quota_active(struct super_block *sb)* Operations supported for diskquotas. */ extern const struct dquot_operations dquot_operations; -extern struct quotactl_ops vfs_quotactl_ops; +extern const struct quotactl_ops vfs_quotactl_ops;#define sb_dquot_ops (&dquot_operations)#define sb_quotactl_ops (&vfs_quotactl_ops)
PATCH 3/9 const: mark remaining super_operations const
In reply to Alexey DobriyanSigned-off-by Alexey Dobriyan <[email protected]>
---
arch/powerpc/platforms/cell/spufs/inode.c | 2 +- arch/s390/hypfs/inode.c | 4 ++-- drivers/isdn/capi/capifs.c | 2 +- drivers/misc/ibmasm/ibmasmfs.c | 2 +- drivers/oprofile/oprofilefs.c | 2 +- drivers/usb/core/inode.c | 3 +-- drivers/usb/gadget/inode.c | 2 +- fs/befs/linuxvfs.c | 2 +- fs/btrfs/super.c | 4 ++-- fs/nilfs2/super.c | 2 +- fs/omfs/inode.c | 2 +- fs/squashfs/super.c | 4 ++-- fs/super.c | 2 +- fs/xfs/linux-2.6/xfs_super.c | 4 ++-- ipc/mqueue.c | 4 ++-- kernel/cgroup.c | 2 +- net/socket.c | 2 +- net/sunrpc/rpc_pipe.c | 2 +- 18 files changed, 23 insertions(+), 24 deletions(-)
arch/powerpc/platforms/cell/spufs/inode.c +1 -1
@@ -773,7 +773,7 @@ static int spufs_fill_super(struct super_block *sb, void *data, int silent) { struct spufs_sb_info *info; - static struct super_operations s_ops = { + static const struct super_operations s_ops = { .alloc_inode = spufs_alloc_inode, .destroy_inode = spufs_destroy_inode, .statfs = simple_statfs,
arch/s390/hypfs/inode.c +2 -2
@@ -41,7 +41,7 @@ struct hypfs_sb_info {static const struct file_operations hypfs_file_ops;static struct file_system_type hypfs_type; -static struct super_operations hypfs_s_ops; +static const struct super_operations hypfs_s_ops;/* start of list of all dentries, which have to be deleted on update */ static struct dentry *hypfs_last_dentry;
@@ -476,7 +476,7 @@ static struct file_system_type hypfs_type = { .kill_sb = hypfs_kill_super }; -static struct super_operations hypfs_s_ops = { +static const struct super_operations hypfs_s_ops = { .statfs = simple_statfs, .drop_inode = hypfs_drop_inode, .show_options = hypfs_show_options,
drivers/isdn/capi/capifs.c +1 -1
@@ -89,7 +89,7 @@ static int capifs_remount(struct super_block *s, int *flags, char *data)return 0 ; } -static struct super_operations capifs_sops = +static const struct super_operations capifs_sops = { .statfs = simple_statfs, .remount_fs = capifs_remount,
drivers/misc/ibmasm/ibmasmfs.c +1 -1
@@ -97,7 +97,7 @@ static int ibmasmfs_get_super(struct file_system_type *fst,return get_sb_single (fst, flags, data, ibmasmfs_fill_super, mnt); } -static struct super_operations ibmasmfs_s_ops = { +static const struct super_operations ibmasmfs_s_ops = { .statfs = simple_statfs, .drop_inode = generic_delete_inode, };
drivers/oprofile/oprofilefs.c +1 -1
@@ -35,7 +35,7 @@ static struct inode *oprofilefs_get_inode(struct super_block *sb, int mode) } -static struct super_operations s_ops = { +static const struct super_operations s_ops = { .statfs = simple_statfs, .drop_inode = generic_delete_inode, };
drivers/usb/core/inode.c +1 -2
@@ -48,7 +48,6 @@#define USBFS_DEFAULT_BUSMODE (S_IXUGO | S_IRUGO)#define USBFS_DEFAULT_LISTMODE S_IRUGO -static struct super_operations usbfs_ops;static const struct file_operations default_file_operations;static struct vfsmount *usbfs_mount;static int usbfs_mount_count;/* = 0 */
@@ -449,7 +448,7 @@ static const struct file_operations default_file_operations = { .llseek = default_file_lseek, }; -static struct super_operations usbfs_ops = { +static const struct super_operations usbfs_ops = { .statfs = simple_statfs, .drop_inode = generic_delete_inode, .remount_fs = remount,
drivers/usb/gadget/inode.c +1 -1
@@ -2033,7 +2033,7 @@ gadgetfs_create_file (struct super_block *sb, char const *name,return inode; } -static struct super_operations gadget_fs_operations = { +static const struct super_operations gadget_fs_operations = { .statfs = simple_statfs, .drop_inode = generic_delete_inode, };
fs/befs/linuxvfs.c +1 -1
@@ -842,7 +842,7 @@ befs_fill_super(struct super_block *sb, void *data, int silent) sb->s_magic =BEFS_SUPER_MAGIC ;/* Set real blocksize of fs */ sb_set_blocksize (sb, (ulong ) befs_sb->block_size); - sb->s_op = (struct super_operations *) &befs_sops; + sb->s_op = &befs_sops; root =befs_iget (sb,iaddr2blockno (sb, &(befs_sb->root_dir)));if (IS_ERR (root)) { ret =PTR_ERR (root);
fs/btrfs/super.c +2 -2
@@ -51,7 +51,7 @@#include "export.h" #include "compression.h" -static struct super_operations btrfs_super_ops; +static const struct super_operations btrfs_super_ops;static void btrfs_put_super (struct super_block *sb) {
@@ -675,7 +675,7 @@ static int btrfs_unfreeze(struct super_block *sb)return 0 ; } -static struct super_operations btrfs_super_ops = { +static const struct super_operations btrfs_super_ops = { .delete_inode = btrfs_delete_inode, .put_super = btrfs_put_super, .sync_fs = btrfs_sync_fs,
fs/nilfs2/super.c +1 -1
@@ -529,7 +529,7 @@ static int nilfs_statfs(struct dentry *dentry, struct kstatfs *buf)return 0 ; } -static struct super_operations nilfs_sops = { +static const struct super_operations nilfs_sops = { .alloc_inode = nilfs_alloc_inode, .destroy_inode = nilfs_destroy_inode, .dirty_inode = nilfs_dirty_inode,
fs/omfs/inode.c +1 -1
@@ -278,7 +278,7 @@ static int omfs_statfs(struct dentry *dentry, struct kstatfs *buf)return 0 ; } -static struct super_operations omfs_sops = { +static const struct super_operations omfs_sops = { .write_inode = omfs_write_inode, .delete_inode = omfs_delete_inode, .put_super = omfs_put_super,
fs/squashfs/super.c +2 -2
@@ -44,7 +44,7 @@#include "squashfs.h" static struct file_system_type squashfs_fs_type; -static struct super_operations squashfs_super_ops; +static const struct super_operations squashfs_super_ops;static int supported_squashfs_filesystem (short major,short minor,short comp) {
@@ -444,7 +444,7 @@ static struct file_system_type squashfs_fs_type = { .fs_flags = FS_REQUIRES_DEV }; -static struct super_operations squashfs_super_ops = { +static const struct super_operations squashfs_super_ops = { .alloc_inode = squashfs_alloc_inode, .destroy_inode = squashfs_destroy_inode, .statfs = squashfs_statfs,
fs/super.c +1 -1
@@ -54,7 +54,7 @@ DEFINE_SPINLOCK(sb_lock);static struct super_block *alloc_super (struct file_system_type *type) {struct super_block *s =kzalloc (sizeof (struct super_block ),GFP_USER ); -static struct super_operations default_op; +static const struct super_operations default_op;if (s) {if (security_sb_alloc (s)) {
fs/xfs/linux-2.6/xfs_super.c +2 -2
@@ -67,7 +67,7 @@#include <linux/freezer.h> #include <linux/parser.h> -static struct super_operations xfs_super_operations; +static const struct super_operations xfs_super_operations;static kmem_zone_t *xfs_ioend_zone;mempool_t *xfs_ioend_pool;
@@ -1532,7 +1532,7 @@ xfs_fs_get_sb( mnt); } -static struct super_operations xfs_super_operations = { +static const struct super_operations xfs_super_operations = { .alloc_inode = xfs_fs_alloc_inode, .destroy_inode = xfs_fs_destroy_inode, .write_inode = xfs_fs_write_inode,
ipc/mqueue.c +2 -2
@@ -77,7 +77,7 @@ struct mqueue_inode_info {static const struct inode_operations mqueue_dir_inode_operations;static const struct file_operations mqueue_file_operations; -static struct super_operations mqueue_super_ops; +static const struct super_operations mqueue_super_ops;static void remove_notification (struct mqueue_inode_info *info);static struct kmem_cache *mqueue_inode_cachep;
@@ -1224,7 +1224,7 @@ static const struct file_operations mqueue_file_operations = { .read = mqueue_read_file, }; -static struct super_operations mqueue_super_ops = { +static const struct super_operations mqueue_super_ops = { .alloc_inode = mqueue_alloc_inode, .destroy_inode = mqueue_destroy_inode, .statfs = simple_statfs,
kernel/cgroup.c +1 -1
@@ -960,7 +960,7 @@ static int cgroup_remount(struct super_block *sb, int *flags, char *data)return ret; } -static struct super_operations cgroup_ops = { +static const struct super_operations cgroup_ops = { .statfs = simple_statfs, .drop_inode = generic_delete_inode, .show_options = cgroup_show_options,
net/socket.c +1 -1
@@ -285,7 +285,7 @@ static int init_inodecache(void)return 0 ; } -static struct super_operations sockfs_ops = { +static const struct super_operations sockfs_ops = { .alloc_inode = sock_alloc_inode, .destroy_inode =sock_destroy_inode, .statfs = simple_statfs,
net/sunrpc/rpc_pipe.c +1 -1
@@ -858,7 +858,7 @@ EXPORT_SYMBOL_GPL(rpc_unlink);/* * populate the filesystem */ -static struct super_operations s_ops = { +static const struct super_operations s_ops = { .alloc_inode = rpc_alloc_inode, .destroy_inode = rpc_destroy_inode, .statfs = simple_statfs,
PATCH 4/9 const: mark remaining export_operations const
In reply to Alexey DobriyanSigned-off-by Alexey Dobriyan <[email protected]>
---
fs/jffs2/super.c | 2 +- fs/nilfs2/super.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
fs/jffs2/super.c +1 -1
@@ -123,7 +123,7 @@ static struct dentry *jffs2_get_parent(struct dentry *child)return d_obtain_alias (jffs2_iget (child->d_inode->i_sb, pino)); } -static struct export_operations jffs2_export_ops = { +static const struct export_operations jffs2_export_ops = { .get_parent = jffs2_get_parent, .fh_to_dentry = jffs2_fh_to_dentry, .fh_to_parent = jffs2_fh_to_parent,
fs/nilfs2/super.c +1 -1
@@ -585,7 +585,7 @@ nilfs_fh_to_parent(struct super_block *sb, struct fid *fid, int fh_len, nilfs_nfs_get_inode); } -static struct export_operations nilfs_export_ops = { +static const struct export_operations nilfs_export_ops = { .fh_to_dentry = nilfs_fh_to_dentry, .fh_to_parent = nilfs_fh_to_parent, .get_parent = nilfs_get_parent,
PATCH 5/9 const: mark remaining address_space_operations const
In reply to Alexey DobriyanSigned-off-by Alexey Dobriyan <[email protected]>
---
fs/btrfs/disk-io.c | 2 +- fs/btrfs/inode.c | 8 ++++---- fs/ecryptfs/ecryptfs_kernel.h | 2 +- fs/ecryptfs/mmap.c | 2 +- fs/nilfs2/btnode.c | 2 +- fs/nilfs2/gcinode.c | 2 +- fs/nilfs2/inode.c | 2 +- fs/nilfs2/mdt.c | 2 +- fs/nilfs2/nilfs.h | 2 +- fs/omfs/file.c | 2 +- fs/omfs/omfs.h | 2 +- fs/ubifs/xattr.c | 2 +- 12 files changed, 15 insertions(+), 15 deletions(-)
fs/btrfs/disk-io.c +1 -1
@@ -772,7 +772,7 @@ static void btree_invalidatepage(struct page *page, unsigned long offset) } } -static struct address_space_operations btree_aops = { +static const struct address_space_operations btree_aops = { .readpage = btree_readpage, .writepage = btree_writepage, .writepages = btree_writepages,
fs/btrfs/inode.c +4 -4
@@ -60,8 +60,8 @@ static struct inode_operations btrfs_symlink_inode_operations;static struct inode_operations btrfs_dir_ro_inode_operations;static struct inode_operations btrfs_special_inode_operations;static struct inode_operations btrfs_file_inode_operations; -static struct address_space_operations btrfs_aops; -static struct address_space_operations btrfs_symlink_aops; +static const struct address_space_operations btrfs_aops; +static const struct address_space_operations btrfs_symlink_aops;static struct file_operations btrfs_dir_file_operations;static struct extent_io_ops btrfs_extent_io_ops;
@@ -5259,7 +5259,7 @@ static struct extent_io_ops btrfs_extent_io_ops = {* * For now we're avoiding this by dropping bmap. */ -static struct address_space_operations btrfs_aops = { +static const struct address_space_operations btrfs_aops = { .readpage = btrfs_readpage, .writepage = btrfs_writepage, .writepages = btrfs_writepages,
@@ -5271,7 +5271,7 @@ static struct address_space_operations btrfs_aops = { .set_page_dirty = btrfs_set_page_dirty, }; -static struct address_space_operations btrfs_symlink_aops = { +static const struct address_space_operations btrfs_symlink_aops = { .readpage = btrfs_readpage, .writepage = btrfs_writepage, .invalidatepage = btrfs_invalidatepage,
fs/ecryptfs/ecryptfs_kernel.h +1 -1
@@ -582,7 +582,7 @@ extern const struct inode_operations ecryptfs_dir_iops;extern const struct inode_operations ecryptfs_symlink_iops;extern const struct super_operations ecryptfs_sops;extern const struct dentry_operations ecryptfs_dops; -extern struct address_space_operations ecryptfs_aops; +extern const struct address_space_operations ecryptfs_aops;extern int ecryptfs_verbosity;extern unsigned int ecryptfs_message_buf_len;extern signed long ecryptfs_message_wait_timeout;
fs/ecryptfs/mmap.c +1 -1
@@ -545,7 +545,7 @@ static sector_t ecryptfs_bmap(struct address_space *mapping, sector_t block)return rc; } -struct address_space_operations ecryptfs_aops = { +const struct address_space_operations ecryptfs_aops = { .writepage = ecryptfs_writepage, .readpage = ecryptfs_readpage, .write_begin = ecryptfs_write_begin,
fs/nilfs2/btnode.c +1 -1
@@ -46,7 +46,7 @@ void nilfs_btnode_cache_init_once(struct address_space *btnc)INIT_LIST_HEAD (&btnc->i_mmap_nonlinear); } -static struct address_space_operations def_btnode_aops = { +static const struct address_space_operations def_btnode_aops = { .sync_page = block_sync_page, };
fs/nilfs2/gcinode.c +1 -1
@@ -52,7 +52,7 @@#include "dat.h" #include "ifile.h" -static struct address_space_operations def_gcinode_aops = { +static const struct address_space_operations def_gcinode_aops = { .sync_page = block_sync_page, };
fs/nilfs2/inode.c +1 -1
@@ -238,7 +238,7 @@ nilfs_direct_IO(int rw, struct kiocb *iocb, const struct iovec *iov,return size; } -struct address_space_operations nilfs_aops = { +const struct address_space_operations nilfs_aops = { .writepage = nilfs_writepage, .readpage = nilfs_readpage, .sync_page = block_sync_page,
fs/nilfs2/mdt.c +1 -1
@@ -430,7 +430,7 @@ nilfs_mdt_write_page(struct page *page, struct writeback_control *wbc) } -static struct address_space_operations def_mdt_aops = { +static const struct address_space_operations def_mdt_aops = { .writepage = nilfs_mdt_write_page, .sync_page = block_sync_page, };
fs/nilfs2/nilfs.h +1 -1
@@ -297,7 +297,7 @@ void nilfs_clear_gcdat_inode(struct the_nilfs *);extern struct file_operations nilfs_dir_operations;extern struct inode_operations nilfs_file_inode_operations;extern struct file_operations nilfs_file_operations; -extern struct address_space_operations nilfs_aops; +extern const struct address_space_operations nilfs_aops;extern struct inode_operations nilfs_dir_inode_operations;extern struct inode_operations nilfs_special_inode_operations;extern struct inode_operations nilfs_symlink_inode_operations;
fs/omfs/file.c +1 -1
@@ -337,7 +337,7 @@ struct inode_operations omfs_file_inops = { .truncate = omfs_truncate }; -struct address_space_operations omfs_aops = { +const struct address_space_operations omfs_aops = { .readpage = omfs_readpage, .readpages = omfs_readpages, .writepage = omfs_writepage,
fs/omfs/omfs.h +1 -1
@@ -53,7 +53,7 @@ extern int omfs_is_bad(struct omfs_sb_info *sbi, struct omfs_header *header,/* file.c */ extern struct file_operations omfs_file_operations;extern struct inode_operations omfs_file_inops; -extern struct address_space_operations omfs_aops; +extern const struct address_space_operations omfs_aops;extern void omfs_make_empty_table (struct buffer_head *bh,int offset);extern int omfs_shrink_inode (struct inode *inode);
fs/ubifs/xattr.c +1 -1
@@ -79,7 +79,7 @@ enum { };static struct inode_operations none_inode_operations; -static struct address_space_operations none_address_operations; +static const struct address_space_operations none_address_operations;static struct file_operations none_file_operations;/**
PATCH 6/9 const: mark remaining inode_operations as const
In reply to Alexey DobriyanSigned-off-by Alexey Dobriyan <[email protected]>
---
arch/powerpc/platforms/cell/spufs/inode.c | 2 +- fs/btrfs/inode.c | 20 ++++++++++---------- fs/cifs/cifs_dfs_ref.c | 2 +- fs/cifs/cifsfs.h | 2 +- fs/inode.c | 2 +- fs/nilfs2/file.c | 2 +- fs/nilfs2/mdt.c | 2 +- fs/nilfs2/namei.c | 6 +++--- fs/nilfs2/nilfs.h | 8 ++++---- fs/omfs/dir.c | 2 +- fs/omfs/file.c | 2 +- fs/omfs/omfs.h | 4 ++-- fs/romfs/super.c | 2 +- fs/ubifs/xattr.c | 2 +- kernel/cgroup.c | 4 ++-- 15 files changed, 31 insertions(+), 31 deletions(-)
arch/powerpc/platforms/cell/spufs/inode.c +1 -1
@@ -119,7 +119,7 @@ spufs_new_file(struct super_block *sb, struct dentry *dentry, const struct file_operations *fops, int mode, size_t size, struct spu_context *ctx) { - static struct inode_operations spufs_file_iops = { + static const struct inode_operations spufs_file_iops = { .setattr = spufs_setattr, };struct inode *inode;
fs/btrfs/inode.c +10 -10
@@ -55,11 +55,11 @@ struct btrfs_iget_args {struct btrfs_root *root; }; -static struct inode_operations btrfs_dir_inode_operations; -static struct inode_operations btrfs_symlink_inode_operations; -static struct inode_operations btrfs_dir_ro_inode_operations; -static struct inode_operations btrfs_special_inode_operations; -static struct inode_operations btrfs_file_inode_operations; +static const struct inode_operations btrfs_dir_inode_operations; +static const struct inode_operations btrfs_symlink_inode_operations; +static const struct inode_operations btrfs_dir_ro_inode_operations; +static const struct inode_operations btrfs_special_inode_operations; +static const struct inode_operations btrfs_file_inode_operations;static const struct address_space_operations btrfs_aops;static const struct address_space_operations btrfs_symlink_aops;static struct file_operations btrfs_dir_file_operations;
@@ -5201,7 +5201,7 @@ static int btrfs_permission(struct inode *inode, int mask)return generic_permission (inode, mask, btrfs_check_acl); } -static struct inode_operations btrfs_dir_inode_operations = { +static const struct inode_operations btrfs_dir_inode_operations = { .getattr = btrfs_getattr, .lookup = btrfs_lookup, .create = btrfs_create,
@@ -5219,7 +5219,7 @@ static struct inode_operations btrfs_dir_inode_operations = { .removexattr = btrfs_removexattr, .permission = btrfs_permission, }; -static struct inode_operations btrfs_dir_ro_inode_operations = { +static const struct inode_operations btrfs_dir_ro_inode_operations = { .lookup = btrfs_lookup, .permission = btrfs_permission, };
@@ -5278,7 +5278,7 @@ static const struct address_space_operations btrfs_symlink_aops = { .releasepage = btrfs_releasepage, }; -static struct inode_operations btrfs_file_inode_operations = { +static const struct inode_operations btrfs_file_inode_operations = { .truncate = btrfs_truncate, .getattr = btrfs_getattr, .setattr = btrfs_setattr,
@@ -5290,7 +5290,7 @@ static struct inode_operations btrfs_file_inode_operations = { .fallocate = btrfs_fallocate, .fiemap = btrfs_fiemap, }; -static struct inode_operations btrfs_special_inode_operations = { +static const struct inode_operations btrfs_special_inode_operations = { .getattr = btrfs_getattr, .setattr = btrfs_setattr, .permission = btrfs_permission,
@@ -5299,7 +5299,7 @@ static struct inode_operations btrfs_special_inode_operations = { .listxattr = btrfs_listxattr, .removexattr = btrfs_removexattr, }; -static struct inode_operations btrfs_symlink_inode_operations = { +static const struct inode_operations btrfs_symlink_inode_operations = { .readlink = generic_readlink, .follow_link = page_follow_link_light, .put_link = page_put_link,
fs/cifs/cifs_dfs_ref.c +1 -1
@@ -385,7 +385,7 @@ out_err: goto out; } -struct inode_operations cifs_dfs_referral_inode_operations = { +const struct inode_operations cifs_dfs_referral_inode_operations = { .follow_link = cifs_dfs_follow_mountpoint, };
fs/cifs/cifsfs.h +1 -1
@@ -67,7 +67,7 @@ extern int cifs_setattr(struct dentry *, struct iattr *);extern const struct inode_operations cifs_file_inode_ops;extern const struct inode_operations cifs_symlink_inode_ops; -extern struct inode_operations cifs_dfs_referral_inode_operations; +extern const struct inode_operations cifs_dfs_referral_inode_operations;/* Functions related to files and directories */
fs/inode.c +1 -1
@@ -123,7 +123,7 @@ static void wake_up_inode(struct inode *inode)int inode_init_always (struct super_block *sb,struct inode *inode) {static const struct address_space_operations empty_aops; -static struct inode_operations empty_iops; +static const struct inode_operations empty_iops;static const struct file_operations empty_fops;struct address_space *const mapping = &inode->i_data;
fs/nilfs2/file.c +1 -1
@@ -151,7 +151,7 @@ struct file_operations nilfs_file_operations = { .splice_read = generic_file_splice_read, }; -struct inode_operations nilfs_file_inode_operations = { +const struct inode_operations nilfs_file_inode_operations = { .truncate = nilfs_truncate, .setattr = nilfs_setattr, .permission = nilfs_permission,
fs/nilfs2/mdt.c +1 -1
@@ -435,7 +435,7 @@ static const struct address_space_operations def_mdt_aops = { .sync_page = block_sync_page, }; -static struct inode_operations def_mdt_iops; +static const struct inode_operations def_mdt_iops;static struct file_operations def_mdt_fops;/*
fs/nilfs2/namei.c +3 -3
@@ -448,7 +448,7 @@ out:return err; } -struct inode_operations nilfs_dir_inode_operations = { +const struct inode_operations nilfs_dir_inode_operations = { .create = nilfs_create, .lookup = nilfs_lookup, .link = nilfs_link,
@@ -462,12 +462,12 @@ struct inode_operations nilfs_dir_inode_operations = { .permission = nilfs_permission, }; -struct inode_operations nilfs_special_inode_operations = { +const struct inode_operations nilfs_special_inode_operations = { .setattr = nilfs_setattr, .permission = nilfs_permission, }; -struct inode_operations nilfs_symlink_inode_operations = { +const struct inode_operations nilfs_symlink_inode_operations = { .readlink = generic_readlink, .follow_link = page_follow_link_light, .put_link = page_put_link,
fs/nilfs2/nilfs.h +4 -4
@@ -295,12 +295,12 @@ void nilfs_clear_gcdat_inode(struct the_nilfs *);* Inodes and files operations */ extern struct file_operations nilfs_dir_operations; -extern struct inode_operations nilfs_file_inode_operations; +extern const struct inode_operations nilfs_file_inode_operations;extern struct file_operations nilfs_file_operations;extern const struct address_space_operations nilfs_aops; -extern struct inode_operations nilfs_dir_inode_operations; -extern struct inode_operations nilfs_special_inode_operations; -extern struct inode_operations nilfs_symlink_inode_operations; +extern const struct inode_operations nilfs_dir_inode_operations; +extern const struct inode_operations nilfs_special_inode_operations; +extern const struct inode_operations nilfs_symlink_inode_operations;/* * filesystem type
fs/omfs/dir.c +1 -1
@@ -489,7 +489,7 @@ out:return ret; } -struct inode_operations omfs_dir_inops = { +const struct inode_operations omfs_dir_inops = { .lookup = omfs_lookup, .mkdir = omfs_mkdir, .rename = omfs_rename,
fs/omfs/file.c +1 -1
@@ -333,7 +333,7 @@ struct file_operations omfs_file_operations = { .splice_read = generic_file_splice_read, }; -struct inode_operations omfs_file_inops = { +const struct inode_operations omfs_file_inops = { .truncate = omfs_truncate };
fs/omfs/omfs.h +2 -2
@@ -45,14 +45,14 @@ extern int omfs_clear_range(struct super_block *sb, u64 block, int count);/* dir.c */ extern struct file_operations omfs_dir_operations; -extern struct inode_operations omfs_dir_inops; +extern const struct inode_operations omfs_dir_inops;extern int omfs_make_empty (struct inode *inode,struct super_block *sb);extern int omfs_is_bad (struct omfs_sb_info *sbi,struct omfs_header *header,u64 fsblock);/* file.c */ extern struct file_operations omfs_file_operations; -extern struct inode_operations omfs_file_inops; +extern const struct inode_operations omfs_file_inops;extern const struct address_space_operations omfs_aops;extern void omfs_make_empty_table (struct buffer_head *bh,int offset);extern int omfs_shrink_inode (struct inode *inode);
fs/romfs/super.c +1 -1
@@ -284,7 +284,7 @@ static const struct file_operations romfs_dir_operations = { .readdir = romfs_readdir, }; -static struct inode_operations romfs_dir_inode_operations = { +static const struct inode_operations romfs_dir_inode_operations = { .lookup = romfs_lookup, };
fs/ubifs/xattr.c +1 -1
@@ -78,7 +78,7 @@ enum { SECURITY_XATTR, }; -static struct inode_operations none_inode_operations; +static const struct inode_operations none_inode_operations;static const struct address_space_operations none_address_operations;static struct file_operations none_file_operations;
kernel/cgroup.c +2 -2
@@ -596,7 +596,7 @@ void cgroup_unlock(void)static int cgroup_mkdir (struct inode *dir,struct dentry *dentry,int mode);static int cgroup_rmdir (struct inode *unused_dir,struct dentry *dentry);static int cgroup_populate_dir (struct cgroup *cgrp); -static struct inode_operations cgroup_dir_inode_operations; +static const struct inode_operations cgroup_dir_inode_operations;static struct file_operations proc_cgroupstats_operations;static struct backing_dev_info cgroup_backing_dev_info = {
@@ -1710,7 +1710,7 @@ static struct file_operations cgroup_file_operations = { .release = cgroup_file_release, }; -static struct inode_operations cgroup_dir_inode_operations = { +static const struct inode_operations cgroup_dir_inode_operations = { .lookup = simple_lookup, .mkdir = cgroup_mkdir, .rmdir = cgroup_rmdir,
PATCH 7/9 const: make file_lock_operations const
In reply to Alexey DobriyanSigned-off-by Alexey Dobriyan <[email protected]>
---
fs/afs/flock.c | 2 +- fs/lockd/clntproc.c | 2 +- fs/nfs/nfs4state.c | 2 +- include/linux/fs.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-)
fs/afs/flock.c +1 -1
@@ -21,7 +21,7 @@ static void afs_fl_release_private(struct file_lock *fl);static struct workqueue_struct *afs_lock_manager;static DEFINE_MUTEX (afs_lock_manager_mutex); -static struct file_lock_operations afs_lock_ops = { +static const struct file_lock_operations afs_lock_ops = { .fl_copy_lock = afs_fl_copy_lock, .fl_release_private = afs_fl_release_private, };
fs/lockd/clntproc.c +1 -1
@@ -458,7 +458,7 @@ static void nlmclnt_locks_release_private(struct file_lock *fl)nlm_put_lockowner (fl->fl_u.nfs_fl.owner); } -static struct file_lock_operations nlmclnt_lock_ops = { +static const struct file_lock_operations nlmclnt_lock_ops = { .fl_copy_lock = nlmclnt_locks_copy_lock, .fl_release_private = nlmclnt_locks_release_private, };
fs/nfs/nfs4state.c +1 -1
@@ -638,7 +638,7 @@ static void nfs4_fl_release_lock(struct file_lock *fl)nfs4_put_lock_state (fl->fl_u.nfs4_fl.owner); } -static struct file_lock_operations nfs4_fl_lock_ops = { +static const struct file_lock_operations nfs4_fl_lock_ops = { .fl_copy_lock = nfs4_fl_copy_lock, .fl_release_private = nfs4_fl_release_lock, };
include/linux/fs.h +1 -1
@@ -1067,7 +1067,7 @@ struct file_lock {struct fasync_struct * fl_fasync;/* for lease break notifications */ unsigned long fl_break_time;/* for nonblocking lease breaks */ -struct file_lock_operations *fl_ops;/* Callbacks for filesystems */ +const struct file_lock_operations *fl_ops;/* Callbacks for filesystems */ struct lock_manager_operations *fl_lmops;/* Callbacks for lockmanagers */ union {struct nfs_lock_info nfs_fl;
PATCH 8/9 const: make lock_manager_operations const
In reply to Alexey DobriyanSigned-off-by Alexey Dobriyan <[email protected]>
---
fs/lockd/svclock.c | 2 +- fs/locks.c | 2 +- fs/nfsd/nfs4state.c | 4 ++-- include/linux/fs.h | 2 +- include/linux/lockd/lockd.h | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-)
fs/lockd/svclock.c +1 -1
@@ -705,7 +705,7 @@ static int nlmsvc_same_owner(struct file_lock *fl1, struct file_lock *fl2)return fl1->fl_owner == fl2->fl_owner && fl1->fl_pid == fl2->fl_pid; } -struct lock_manager_operations nlmsvc_lock_operations = { +const struct lock_manager_operations nlmsvc_lock_operations = { .fl_compare_owner = nlmsvc_same_owner, .fl_notify = nlmsvc_notify_blocked, .fl_grant = nlmsvc_grant_deferred,
fs/locks.c +1 -1
@@ -434,7 +434,7 @@ static int lease_mylease_callback(struct file_lock *fl, struct file_lock *try)return fl->fl_file == try->fl_file; } -static struct lock_manager_operations lease_manager_ops = { +static const struct lock_manager_operations lease_manager_ops = { .fl_break = lease_break_callback, .fl_release_private = lease_release_private_callback, .fl_mylease = lease_mylease_callback,
fs/nfsd/nfs4state.c +2 -2
@@ -2163,7 +2163,7 @@ int nfsd_change_deleg_cb(struct file_lock **onlist, int arg)return -EAGAIN ; } -static struct lock_manager_operations nfsd_lease_mng_ops = { +static const struct lock_manager_operations nfsd_lease_mng_ops = { .fl_break = nfsd_break_deleg_cb, .fl_release_private = nfsd_release_deleg_cb, .fl_copy_lock = nfsd_copy_lock_deleg_cb,
@@ -3368,7 +3368,7 @@ nfs4_transform_lock_offset(struct file_lock *lock)/* Hack!: For now, we're defining this just so we can use a pointer to it * as a unique cookie to identify our (NFSv4's) posix locks. */ -static struct lock_manager_operations nfsd_posix_mng_ops = { +static const struct lock_manager_operations nfsd_posix_mng_ops = { }; static inline void
include/linux/fs.h +1 -1
@@ -1068,7 +1068,7 @@ struct file_lock {unsigned long fl_break_time;/* for nonblocking lease breaks */ const struct file_lock_operations *fl_ops;/* Callbacks for filesystems */ -struct lock_manager_operations *fl_lmops;/* Callbacks for lockmanagers */ +const struct lock_manager_operations *fl_lmops;/* Callbacks for lockmanagers */ union {struct nfs_lock_info nfs_fl;struct nfs4_lock_info nfs4_fl;
include/linux/lockd/lockd.h +1 -1
@@ -395,7 +395,7 @@ static inline int nlm_compare_locks(const struct file_lock *fl1, &&(fl1->fl_type == fl2->fl_type || fl2->fl_type == F_UNLCK); } -extern struct lock_manager_operations nlmsvc_lock_operations; +extern const struct lock_manager_operations nlmsvc_lock_operations;#endif /* __KERNEL__ */
PATCH 9/9 const: make block_device_operations const
In reply to Alexey DobriyanSigned-off-by Alexey Dobriyan <[email protected]>
---
arch/powerpc/sysdev/axonram.c | 2 +- arch/um/drivers/ubd_kern.c | 2 +- drivers/block/DAC960.c | 2 +- drivers/block/amiflop.c | 2 +- drivers/block/aoe/aoeblk.c | 2 +- drivers/block/ataflop.c | 2 +- drivers/block/brd.c | 2 +- drivers/block/cciss.c | 2 +- drivers/block/cpqarray.c | 2 +- drivers/block/floppy.c | 2 +- drivers/block/hd.c | 2 +- drivers/block/loop.c | 2 +- drivers/block/mg_disk.c | 2 +- drivers/block/nbd.c | 2 +- drivers/block/osdblk.c | 2 +- drivers/block/paride/pcd.c | 2 +- drivers/block/paride/pd.c | 2 +- drivers/block/paride/pf.c | 2 +- drivers/block/pktcdvd.c | 2 +- drivers/block/ps3disk.c | 2 +- drivers/block/ps3vram.c | 2 +- drivers/block/sunvdc.c | 2 +- drivers/block/swim.c | 2 +- drivers/block/swim3.c | 2 +- drivers/block/sx8.c | 2 +- drivers/block/ub.c | 2 +- drivers/block/umem.c | 3 +-- drivers/block/viodasd.c | 2 +- drivers/block/virtio_blk.c | 2 +- drivers/block/xd.c | 2 +- drivers/block/xen-blkfront.c | 4 ++-- drivers/block/xsysace.c | 2 +- drivers/block/z2ram.c | 3 +-- drivers/cdrom/gdrom.c | 2 +- drivers/cdrom/viocd.c | 2 +- drivers/ide/ide-cd.c | 2 +- drivers/ide/ide-gd.c | 2 +- drivers/ide/ide-tape.c | 2 +- drivers/md/dm.c | 4 ++-- drivers/md/md.c | 4 ++-- drivers/memstick/core/mspro_block.c | 2 +- drivers/message/i2o/i2o_block.c | 2 +- drivers/mmc/card/block.c | 2 +- drivers/mtd/mtd_blkdevs.c | 2 +- drivers/s390/block/dasd.c | 2 +- drivers/s390/block/dasd_int.h | 2 +- drivers/s390/block/dcssblk.c | 2 +- drivers/s390/block/xpram.c | 2 +- drivers/s390/char/tape_block.c | 2 +- drivers/sbus/char/jsflash.c | 2 +- drivers/scsi/sd.c | 2 +- drivers/scsi/sr.c | 2 +- fs/block_dev.c | 2 +- fs/ext2/xip.c | 2 +- fs/partitions/check.c | 2 +- include/linux/genhd.h | 2 +- 56 files changed, 59 insertions(+), 61 deletions(-)
arch/powerpc/sysdev/axonram.c +1 -1
@@ -165,7 +165,7 @@ axon_ram_direct_access(struct block_device *device, sector_t sector,return 0 ; } -static struct block_device_operations axon_ram_devops = { +static const struct block_device_operations axon_ram_devops = { .owner =THIS_MODULE , .direct_access = axon_ram_direct_access };
arch/um/drivers/ubd_kern.c +1 -1
@@ -106,7 +106,7 @@ static int ubd_getgeo(struct block_device *bdev, struct hd_geometry *geo);#define MAX_DEV (16) -static struct block_device_operations ubd_blops = { +static const struct block_device_operations ubd_blops = { .owner =THIS_MODULE , .open = ubd_open, .release = ubd_release,
drivers/block/DAC960.c +1 -1
@@ -152,7 +152,7 @@ static int DAC960_revalidate_disk(struct gendisk *disk)return 0 ; } -static struct block_device_operations DAC960_BlockDeviceOperations = { +static const struct block_device_operations DAC960_BlockDeviceOperations = { .owner =THIS_MODULE , .open = DAC960_open, .getgeo = DAC960_getgeo,
drivers/block/amiflop.c +1 -1
@@ -1632,7 +1632,7 @@ static int amiga_floppy_change(struct gendisk *disk)return 0 ; } -static struct block_device_operations floppy_fops = { +static const struct block_device_operations floppy_fops = { .owner =THIS_MODULE , .open = floppy_open, .release = floppy_release,
drivers/block/aoe/aoeblk.c +1 -1
@@ -234,7 +234,7 @@ aoeblk_getgeo(struct block_device *bdev, struct hd_geometry *geo)return 0 ; } -static struct block_device_operations aoe_bdops = { +static const struct block_device_operations aoe_bdops = { .open = aoeblk_open, .release = aoeblk_release, .getgeo = aoeblk_getgeo,
drivers/block/ataflop.c +1 -1
@@ -1856,7 +1856,7 @@ static int floppy_release(struct gendisk *disk, fmode_t mode)return 0 ; } -static struct block_device_operations floppy_fops = { +static const struct block_device_operations floppy_fops = { .owner =THIS_MODULE , .open = floppy_open, .release = floppy_release,
drivers/block/brd.c +1 -1
@@ -375,7 +375,7 @@ static int brd_ioctl(struct block_device *bdev, fmode_t mode,return error; } -static struct block_device_operations brd_fops = { +static const struct block_device_operations brd_fops = { .owner =THIS_MODULE , .locked_ioctl = brd_ioctl, #ifdef CONFIG_BLK_DEV_XIP
drivers/block/cciss.c +1 -1
@@ -205,7 +205,7 @@ static int cciss_compat_ioctl(struct block_device *, fmode_t, unsigned, unsigned long);#endif -static struct block_device_operations cciss_fops = { +static const struct block_device_operations cciss_fops = { .owner =THIS_MODULE , .open = cciss_open, .release = cciss_release,
drivers/block/cpqarray.c +1 -1
@@ -193,7 +193,7 @@ static inline ctlr_info_t *get_host(struct gendisk *disk) } -static struct block_device_operations ida_fops = { +static const struct block_device_operations ida_fops = { .owner =THIS_MODULE , .open = ida_open, .release = ida_release,
drivers/block/floppy.c +1 -1
@@ -3907,7 +3907,7 @@ static int floppy_revalidate(struct gendisk *disk)return res; } -static struct block_device_operations floppy_fops = { +static const struct block_device_operations floppy_fops = { .owner =THIS_MODULE , .open = floppy_open, .release = floppy_release,
drivers/block/hd.c +1 -1
@@ -692,7 +692,7 @@ static irqreturn_t hd_interrupt(int irq, void *dev_id)return IRQ_HANDLED ; } -static struct block_device_operations hd_fops = { +static const struct block_device_operations hd_fops = { .getgeo = hd_getgeo, };
drivers/block/loop.c +1 -1
@@ -1438,7 +1438,7 @@ out_unlocked:return 0 ; } -static struct block_device_operations lo_fops = { +static const struct block_device_operations lo_fops = { .owner =THIS_MODULE , .open = lo_open, .release = lo_release,
drivers/block/mg_disk.c +1 -1
@@ -775,7 +775,7 @@ static int mg_getgeo(struct block_device *bdev, struct hd_geometry *geo)return 0 ; } -static struct block_device_operations mg_disk_ops = { +static const struct block_device_operations mg_disk_ops = { .getgeo = mg_getgeo };
drivers/block/nbd.c +1 -1
@@ -722,7 +722,7 @@ static int nbd_ioctl(struct block_device *bdev, fmode_t mode,return error; } -static struct block_device_operations nbd_fops = +static const struct block_device_operations nbd_fops = { .owner =THIS_MODULE , .locked_ioctl = nbd_ioctl,
drivers/block/osdblk.c +1 -1
@@ -125,7 +125,7 @@ static struct class *class_osdblk; /* /sys/class/osdblk */static DEFINE_MUTEX (ctl_mutex);/* Serialize open/close/setup/teardown */ static LIST_HEAD (osdblkdev_list); -static struct block_device_operations osdblk_bd_ops = { +static const struct block_device_operations osdblk_bd_ops = { .owner =THIS_MODULE , };
drivers/block/paride/pcd.c +1 -1
@@ -249,7 +249,7 @@ static int pcd_block_media_changed(struct gendisk *disk)return cdrom_media_changed (&cd->info); } -static struct block_device_operations pcd_bdops = { +static const struct block_device_operations pcd_bdops = { .owner =THIS_MODULE , .open = pcd_block_open, .release = pcd_block_release,
drivers/block/paride/pd.c +1 -1
@@ -807,7 +807,7 @@ static int pd_revalidate(struct gendisk *p)return 0 ; } -static struct block_device_operations pd_fops = { +static const struct block_device_operations pd_fops = { .owner =THIS_MODULE , .open = pd_open, .release = pd_release,
drivers/block/paride/pf.c +1 -1
@@ -262,7 +262,7 @@ static char *pf_buf; /* buffer for request in progress *//* kernel glue structures */ -static struct block_device_operations pf_fops = { +static const struct block_device_operations pf_fops = { .owner =THIS_MODULE , .open = pf_open, .release = pf_release,
drivers/block/pktcdvd.c +1 -1
@@ -2849,7 +2849,7 @@ static int pkt_media_changed(struct gendisk *disk)return attached_disk->fops->media_changed (attached_disk); } -static struct block_device_operations pktcdvd_ops = { +static const struct block_device_operations pktcdvd_ops = { .owner =THIS_MODULE , .open = pkt_open, .release = pkt_close,
drivers/block/ps3disk.c +1 -1
@@ -82,7 +82,7 @@ enum lv1_ata_in_out {static int ps3disk_major; -static struct block_device_operations ps3disk_fops = { +static const struct block_device_operations ps3disk_fops = { .owner =THIS_MODULE , };
drivers/block/ps3vram.c +1 -1
@@ -88,7 +88,7 @@ struct ps3vram_priv {static int ps3vram_major; -static struct block_device_operations ps3vram_fops = { +static const struct block_device_operations ps3vram_fops = { .owner =THIS_MODULE , };
drivers/block/sunvdc.c +1 -1
@@ -103,7 +103,7 @@ static int vdc_getgeo(struct block_device *bdev, struct hd_geometry *geo)return 0 ; } -static struct block_device_operations vdc_fops = { +static const struct block_device_operations vdc_fops = { .owner =THIS_MODULE , .getgeo = vdc_getgeo, };
drivers/block/swim.c +1 -1
@@ -748,7 +748,7 @@ static int floppy_revalidate(struct gendisk *disk)return !fs->disk_in; } -static struct block_device_operations floppy_fops = { +static const struct block_device_operations floppy_fops = { .owner =THIS_MODULE , .open = floppy_open, .release = floppy_release,
drivers/block/swim3.c +1 -1
@@ -998,7 +998,7 @@ static int floppy_revalidate(struct gendisk *disk)return ret; } -static struct block_device_operations floppy_fops = { +static const struct block_device_operations floppy_fops = { .open = floppy_open, .release = floppy_release, .locked_ioctl = floppy_ioctl,
drivers/block/sx8.c +1 -1
@@ -423,7 +423,7 @@ static struct pci_driver carm_driver = { .remove = carm_remove_one, }; -static struct block_device_operations carm_bd_ops = { +static const struct block_device_operations carm_bd_ops = { .owner =THIS_MODULE , .getgeo = carm_bdev_getgeo, };
drivers/block/ub.c +1 -1
@@ -1789,7 +1789,7 @@ static int ub_bd_media_changed(struct gendisk *disk)return lun->changed; } -static struct block_device_operations ub_bd_fops = { +static const struct block_device_operations ub_bd_fops = { .owner =THIS_MODULE , .open = ub_bd_open, .release = ub_bd_release,
drivers/block/umem.c +1 -2
@@ -140,7 +140,6 @@ struct cardinfo { };static struct cardinfo cards[MM_MAXCARDS ]; -static struct block_device_operations mm_fops;static struct timer_list battery_timer;static int num_cards;
@@ -789,7 +788,7 @@ static int mm_check_change(struct gendisk *disk)return 0 ; } -static struct block_device_operations mm_fops = { +static const struct block_device_operations mm_fops = { .owner =THIS_MODULE , .getgeo = mm_getgeo, .revalidate_disk = mm_revalidate,
drivers/block/viodasd.c +1 -1
@@ -219,7 +219,7 @@ static int viodasd_getgeo(struct block_device *bdev, struct hd_geometry *geo)/* * Our file operations table */ -static struct block_device_operations viodasd_fops = { +static const struct block_device_operations viodasd_fops = { .owner =THIS_MODULE , .open = viodasd_open, .release = viodasd_release,
drivers/block/virtio_blk.c +1 -1
@@ -243,7 +243,7 @@ static int virtblk_getgeo(struct block_device *bd, struct hd_geometry *geo)return 0 ; } -static struct block_device_operations virtblk_fops = { +static const struct block_device_operations virtblk_fops = { .locked_ioctl = virtblk_ioctl, .owner =THIS_MODULE , .getgeo = virtblk_getgeo,
drivers/block/xd.c +1 -1
@@ -130,7 +130,7 @@ static struct gendisk *xd_gendisk[2];static int xd_getgeo (struct block_device *bdev,struct hd_geometry *geo); -static struct block_device_operations xd_fops = { +static const struct block_device_operations xd_fops = { .owner =THIS_MODULE , .locked_ioctl = xd_ioctl, .getgeo = xd_getgeo,
drivers/block/xen-blkfront.c +2 -2
@@ -65,7 +65,7 @@ struct blk_shadow {unsigned long frame[BLKIF_MAX_SEGMENTS_PER_REQUEST ]; }; -static struct block_device_operations xlvbd_block_fops; +static const struct block_device_operations xlvbd_block_fops;#define BLK_RING_SIZE __RING_SIZE((struct blkif_sring *)0, PAGE_SIZE)
@@ -1039,7 +1039,7 @@ static int blkif_release(struct gendisk *disk, fmode_t mode)return 0 ; } -static struct block_device_operations xlvbd_block_fops = +static const struct block_device_operations xlvbd_block_fops = { .owner =THIS_MODULE , .open = blkif_open,
drivers/block/xsysace.c +1 -1
@@ -941,7 +941,7 @@ static int ace_getgeo(struct block_device *bdev, struct hd_geometry *geo)return 0 ; } -static struct block_device_operations ace_fops = { +static const struct block_device_operations ace_fops = { .owner =THIS_MODULE , .open = ace_open, .release = ace_release,
drivers/block/z2ram.c +1 -2
@@ -64,7 +64,6 @@ static int current_device = -1;static DEFINE_SPINLOCK (z2ram_lock); -static struct block_device_operations z2_fops;static struct gendisk *z2ram_gendisk;static void do_z2_request (struct request_queue *q)
@@ -315,7 +314,7 @@ z2_release(struct gendisk *disk, fmode_t mode)return 0 ; } -static struct block_device_operations z2_fops = +static const struct block_device_operations z2_fops = { .owner =THIS_MODULE , .open = z2_open,
drivers/cdrom/gdrom.c +1 -1
@@ -512,7 +512,7 @@ static int gdrom_bdops_ioctl(struct block_device *bdev, fmode_t mode,return cdrom_ioctl (gd.cd_info, bdev, mode, cmd, arg); } -static struct block_device_operations gdrom_bdops = { +static const struct block_device_operations gdrom_bdops = { .owner =THIS_MODULE , .open = gdrom_bdops_open, .release = gdrom_bdops_release,
drivers/cdrom/viocd.c +1 -1
@@ -177,7 +177,7 @@ static int viocd_blk_media_changed(struct gendisk *disk)return cdrom_media_changed (&di->viocd_info); } -struct block_device_operations viocd_fops = { +static const struct block_device_operations viocd_fops = { .owner =THIS_MODULE , .open = viocd_blk_open, .release = viocd_blk_release,
drivers/ide/ide-cd.c +1 -1
@@ -1674,7 +1674,7 @@ static int idecd_revalidate_disk(struct gendisk *disk)return 0 ; } -static struct block_device_operations idecd_ops = { +static const struct block_device_operations idecd_ops = { .owner =THIS_MODULE , .open = idecd_open, .release = idecd_release,
drivers/ide/ide-gd.c +1 -1
@@ -321,7 +321,7 @@ static int ide_gd_ioctl(struct block_device *bdev, fmode_t mode,return drive->disk_ops->ioctl (drive, bdev, mode, cmd, arg); } -static struct block_device_operations ide_gd_ops = { +static const struct block_device_operations ide_gd_ops = { .owner =THIS_MODULE , .open = ide_gd_open, .release = ide_gd_release,
drivers/ide/ide-tape.c +1 -1
@@ -1919,7 +1919,7 @@ static int idetape_ioctl(struct block_device *bdev, fmode_t mode,return err; } -static struct block_device_operations idetape_block_ops = { +static const struct block_device_operations idetape_block_ops = { .owner =THIS_MODULE , .open = idetape_open, .release = idetape_release,
drivers/md/dm.c +2 -2
@@ -1714,7 +1714,7 @@ out:return r; } -static struct block_device_operations dm_blk_dops; +static const struct block_device_operations dm_blk_dops;static void dm_wq_work (struct work_struct *work);
@@ -2659,7 +2659,7 @@ void dm_free_md_mempools(struct dm_md_mempools *pools)kfree (pools); } -static struct block_device_operations dm_blk_dops = { +static const struct block_device_operations dm_blk_dops = { .open = dm_blk_open, .release = dm_blk_close, .ioctl = dm_blk_ioctl,
drivers/md/md.c +2 -2
@@ -138,7 +138,7 @@ static ctl_table raid_root_table[] = { { .ctl_name = 0 } }; -static struct block_device_operations md_fops; +static const struct block_device_operations md_fops;static int start_readonly;
@@ -5556,7 +5556,7 @@ static int md_revalidate(struct gendisk *disk) mddev->changed =0 ;return 0 ; } -static struct block_device_operations md_fops = +static const struct block_device_operations md_fops = { .owner =THIS_MODULE , .open = md_open,
drivers/memstick/core/mspro_block.c +1 -1
@@ -235,7 +235,7 @@ static int mspro_block_bd_getgeo(struct block_device *bdev,return 0 ; } -static struct block_device_operations ms_block_bdops = { +static const struct block_device_operations ms_block_bdops = { .open = mspro_block_bd_open, .release = mspro_block_bd_release, .getgeo = mspro_block_bd_getgeo,
drivers/message/i2o/i2o_block.c +1 -1
@@ -925,7 +925,7 @@ static void i2o_block_request_fn(struct request_queue *q) };/* I2O Block device operations definition */ -static struct block_device_operations i2o_block_fops = { +static const struct block_device_operations i2o_block_fops = { .owner =THIS_MODULE , .open = i2o_block_open, .release = i2o_block_release,
drivers/mmc/card/block.c +1 -1
@@ -130,7 +130,7 @@ mmc_blk_getgeo(struct block_device *bdev, struct hd_geometry *geo)return 0 ; } -static struct block_device_operations mmc_bdops = { +static const struct block_device_operations mmc_bdops = { .open = mmc_blk_open, .release = mmc_blk_release, .getgeo = mmc_blk_getgeo,
drivers/mtd/mtd_blkdevs.c +1 -1
@@ -210,7 +210,7 @@ static int blktrans_ioctl(struct block_device *bdev, fmode_t mode, } } -static struct block_device_operations mtd_blktrans_ops = { +static const struct block_device_operations mtd_blktrans_ops = { .owner =THIS_MODULE , .open = blktrans_open, .release = blktrans_release,
drivers/s390/block/dasd.c +1 -1
@@ -2148,7 +2148,7 @@ static int dasd_getgeo(struct block_device *bdev, struct hd_geometry *geo)return 0 ; } -struct block_device_operations +const struct block_device_operations dasd_device_operations = { .owner =THIS_MODULE , .open = dasd_open,
drivers/s390/block/dasd_int.h +1 -1
@@ -535,7 +535,7 @@ dasd_check_blocksize(int bsize)extern debug_info_t *dasd_debug_area;extern struct dasd_profile_info_t dasd_global_profile;extern unsigned int dasd_profile_level; -extern struct block_device_operations dasd_device_operations; +extern const struct block_device_operations dasd_device_operations;extern struct kmem_cache *dasd_page_cache;
drivers/s390/block/dcssblk.c +1 -1
@@ -34,7 +34,7 @@ static int dcssblk_direct_access(struct block_device *bdev, sector_t secnum,static char dcssblk_segments[DCSSBLK_PARM_LEN ] ="\0" ;static int dcssblk_major; -static struct block_device_operations dcssblk_devops = { +static const struct block_device_operations dcssblk_devops = { .owner =THIS_MODULE , .open = dcssblk_open, .release = dcssblk_release,
drivers/s390/block/xpram.c +1 -1
@@ -246,7 +246,7 @@ static int xpram_getgeo(struct block_device *bdev, struct hd_geometry *geo)return 0 ; } -static struct block_device_operations xpram_devops = +static const struct block_device_operations xpram_devops = { .owner =THIS_MODULE , .getgeo = xpram_getgeo,
drivers/s390/char/tape_block.c +1 -1
@@ -50,7 +50,7 @@ static int tapeblock_ioctl(struct block_device *, fmode_t, unsigned int,static int tapeblock_medium_changed (struct gendisk *);static int tapeblock_revalidate_disk (struct gendisk *); -static struct block_device_operations tapeblock_fops = { +static const struct block_device_operations tapeblock_fops = { .owner =THIS_MODULE , .open = tapeblock_open, .release = tapeblock_release,
drivers/sbus/char/jsflash.c +1 -1
@@ -452,7 +452,7 @@ static const struct file_operations jsf_fops = {static struct miscdevice jsf_dev = {JSF_MINOR ,"jsflash" , &jsf_fops }; -static struct block_device_operations jsfd_fops = { +static const struct block_device_operations jsfd_fops = { .owner =THIS_MODULE , };
drivers/scsi/sd.c +1 -1
@@ -956,7 +956,7 @@ static int sd_compat_ioctl(struct block_device *bdev, fmode_t mode, }#endif -static struct block_device_operations sd_fops = { +static const struct block_device_operations sd_fops = { .owner =THIS_MODULE , .open = sd_open, .release = sd_release,
drivers/scsi/sr.c +1 -1
@@ -525,7 +525,7 @@ static int sr_block_media_changed(struct gendisk *disk)return cdrom_media_changed (&cd->cdi); } -static struct block_device_operations sr_bdops = +static const struct block_device_operations sr_bdops = { .owner =THIS_MODULE , .open = sr_block_open,
fs/block_dev.c +1 -1
@@ -1115,7 +1115,7 @@ EXPORT_SYMBOL(revalidate_disk);int check_disk_change (struct block_device *bdev) {struct gendisk *disk = bdev->bd_disk; -struct block_device_operations * bdops = disk->fops; +const struct block_device_operations *bdops = disk->fops;if (!bdops->media_changed)return 0 ;
fs/ext2/xip.c +1 -1
@@ -20,7 +20,7 @@ __inode_direct_access(struct inode *inode, sector_t block, void **kaddr, unsigned long *pfn) { struct block_device *bdev = inode->i_sb->s_bdev; -struct block_device_operations *ops = bdev->bd_disk->fops; +const struct block_device_operations *ops = bdev->bd_disk->fops;sector_t sector; sector = block * (PAGE_SIZE /512 );/* ext2 block to bdev sector */
fs/partitions/check.c +1 -1
@@ -571,7 +571,7 @@ try_scan: }if (from + size >get_capacity (disk)) { -struct block_device_operations *bdops = disk->fops; +const struct block_device_operations *bdops = disk->fops;unsigned long long capacity; printk(KERN_WARNING
include/linux/genhd.h +1 -1
@@ -151,7 +151,7 @@ struct gendisk {struct disk_part_tbl *part_tbl;struct hd_struct part0; -struct block_device_operations *fops; +const struct block_device_operations *fops;struct request_queue *queue;void *private_data;