Skip to content

Commit ee9b6d6

Browse files
Josef 'Jeff' SipekLinus Torvalds
authored andcommitted
[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: Josef 'Jeff' Sipek <jsipek@cs.sunysb.edu> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent c5ef1c4 commit ee9b6d6

58 files changed

Lines changed: 75 additions & 75 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎fs/9p/vfs_super.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
#include "fid.h"
4646

4747
static void v9fs_clear_inode(struct inode *);
48-
static struct super_operations v9fs_super_ops;
48+
static const struct super_operations v9fs_super_ops;
4949

5050
/**
5151
* v9fs_clear_inode - release an inode
@@ -263,7 +263,7 @@ v9fs_umount_begin(struct vfsmount *vfsmnt, int flags)
263263
v9fs_session_cancel(v9ses);
264264
}
265265

266-
static struct super_operations v9fs_super_ops = {
266+
static const struct super_operations v9fs_super_ops = {
267267
.statfs = simple_statfs,
268268
.clear_inode = v9fs_clear_inode,
269269
.show_options = v9fs_show_options,

‎fs/adfs/super.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ static void destroy_inodecache(void)
254254
kmem_cache_destroy(adfs_inode_cachep);
255255
}
256256

257-
static struct super_operations adfs_sops = {
257+
static const struct super_operations adfs_sops = {
258258
.alloc_inode = adfs_alloc_inode,
259259
.destroy_inode = adfs_destroy_inode,
260260
.write_inode = adfs_write_inode,

‎fs/affs/super.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ static void destroy_inodecache(void)
112112
kmem_cache_destroy(affs_inode_cachep);
113113
}
114114

115-
static struct super_operations affs_sops = {
115+
static const struct super_operations affs_sops = {
116116
.alloc_inode = affs_alloc_inode,
117117
.destroy_inode = affs_destroy_inode,
118118
.read_inode = affs_read_inode,

‎fs/afs/super.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ struct file_system_type afs_fs_type = {
5656
.fs_flags = FS_BINARY_MOUNTDATA,
5757
};
5858

59-
static struct super_operations afs_super_ops = {
59+
static const struct super_operations afs_super_ops = {
6060
.statfs = simple_statfs,
6161
.alloc_inode = afs_alloc_inode,
6262
.drop_inode = generic_delete_inode,

‎fs/autofs/inode.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ void autofs_kill_sb(struct super_block *sb)
5252

5353
static void autofs_read_inode(struct inode *inode);
5454

55-
static struct super_operations autofs_sops = {
55+
static const struct super_operations autofs_sops = {
5656
.read_inode = autofs_read_inode,
5757
.statfs = simple_statfs,
5858
};

‎fs/autofs4/inode.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ static int autofs4_show_options(struct seq_file *m, struct vfsmount *mnt)
196196
return 0;
197197
}
198198

199-
static struct super_operations autofs4_sops = {
199+
static const struct super_operations autofs4_sops = {
200200
.statfs = simple_statfs,
201201
.show_options = autofs4_show_options,
202202
};

‎fs/bfs/inode.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ static void destroy_inodecache(void)
270270
kmem_cache_destroy(bfs_inode_cachep);
271271
}
272272

273-
static struct super_operations bfs_sops = {
273+
static const struct super_operations bfs_sops = {
274274
.alloc_inode = bfs_alloc_inode,
275275
.destroy_inode = bfs_destroy_inode,
276276
.read_inode = bfs_read_inode,

‎fs/binfmt_misc.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -719,7 +719,7 @@ static const struct file_operations bm_status_operations = {
719719

720720
/* Superblock handling */
721721

722-
static struct super_operations s_ops = {
722+
static const struct super_operations s_ops = {
723723
.statfs = simple_statfs,
724724
.clear_inode = bm_clear_inode,
725725
};

‎fs/block_dev.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ static void bdev_clear_inode(struct inode *inode)
489489
spin_unlock(&bdev_lock);
490490
}
491491

492-
static struct super_operations bdev_sops = {
492+
static const struct super_operations bdev_sops = {
493493
.statfs = simple_statfs,
494494
.alloc_inode = bdev_alloc_inode,
495495
.destroy_inode = bdev_destroy_inode,

‎fs/cifs/cifsfs.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ extern struct task_struct * oplockThread; /* remove sparse warning */
6464
struct task_struct * oplockThread = NULL;
6565
extern struct task_struct * dnotifyThread; /* remove sparse warning */
6666
struct task_struct * dnotifyThread = NULL;
67-
static struct super_operations cifs_super_ops;
67+
static const struct super_operations cifs_super_ops;
6868
unsigned int CIFSMaxBufSize = CIFS_MAX_MSGSIZE;
6969
module_param(CIFSMaxBufSize, int, 0);
7070
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)
453453
return 0;
454454
}
455455

456-
static struct super_operations cifs_super_ops = {
456+
static const struct super_operations cifs_super_ops = {
457457
.read_inode = cifs_read_inode,
458458
.put_super = cifs_put_super,
459459
.statfs = cifs_statfs,

0 commit comments

Comments
 (0)