Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[PATCH] mark struct inode_operations const 2

Many struct inode_operations in the kernel can be "const". Marking them const
moves these to the .rodata section, which avoids false sharing with potential
dirty data. In addition it'll catch accidental writes at compile time to
these shared resources.

Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Arjan van de Ven and committed by
Linus Torvalds
92e1d5be 754661f1

+105 -105
+4 -4
fs/gfs2/ops_inode.c
··· 1115 1115 return gfs2_ea_remove(GFS2_I(dentry->d_inode), &er); 1116 1116 } 1117 1117 1118 - struct inode_operations gfs2_file_iops = { 1118 + const struct inode_operations gfs2_file_iops = { 1119 1119 .permission = gfs2_permission, 1120 1120 .setattr = gfs2_setattr, 1121 1121 .getattr = gfs2_getattr, ··· 1125 1125 .removexattr = gfs2_removexattr, 1126 1126 }; 1127 1127 1128 - struct inode_operations gfs2_dev_iops = { 1128 + const struct inode_operations gfs2_dev_iops = { 1129 1129 .permission = gfs2_permission, 1130 1130 .setattr = gfs2_setattr, 1131 1131 .getattr = gfs2_getattr, ··· 1135 1135 .removexattr = gfs2_removexattr, 1136 1136 }; 1137 1137 1138 - struct inode_operations gfs2_dir_iops = { 1138 + const struct inode_operations gfs2_dir_iops = { 1139 1139 .create = gfs2_create, 1140 1140 .lookup = gfs2_lookup, 1141 1141 .link = gfs2_link, ··· 1154 1154 .removexattr = gfs2_removexattr, 1155 1155 }; 1156 1156 1157 - struct inode_operations gfs2_symlink_iops = { 1157 + const struct inode_operations gfs2_symlink_iops = { 1158 1158 .readlink = gfs2_readlink, 1159 1159 .follow_link = gfs2_follow_link, 1160 1160 .permission = gfs2_permission,
+4 -4
fs/gfs2/ops_inode.h
··· 12 12 13 13 #include <linux/fs.h> 14 14 15 - extern struct inode_operations gfs2_file_iops; 16 - extern struct inode_operations gfs2_dir_iops; 17 - extern struct inode_operations gfs2_symlink_iops; 18 - extern struct inode_operations gfs2_dev_iops; 15 + extern const struct inode_operations gfs2_file_iops; 16 + extern const struct inode_operations gfs2_dir_iops; 17 + extern const struct inode_operations gfs2_symlink_iops; 18 + extern const struct inode_operations gfs2_dev_iops; 19 19 20 20 #endif /* __OPS_INODE_DOT_H__ */
+1 -1
fs/hfs/dir.c
··· 320 320 .release = hfs_dir_release, 321 321 }; 322 322 323 - struct inode_operations hfs_dir_inode_operations = { 323 + const struct inode_operations hfs_dir_inode_operations = { 324 324 .create = hfs_create, 325 325 .lookup = hfs_lookup, 326 326 .unlink = hfs_unlink,
+1 -1
fs/hfs/hfs_fs.h
··· 170 170 171 171 /* dir.c */ 172 172 extern const struct file_operations hfs_dir_operations; 173 - extern struct inode_operations hfs_dir_inode_operations; 173 + extern const struct inode_operations hfs_dir_inode_operations; 174 174 175 175 /* extent.c */ 176 176 extern int hfs_ext_keycmp(const btree_key *, const btree_key *);
+2 -2
fs/hfs/inode.c
··· 18 18 #include "btree.h" 19 19 20 20 static const struct file_operations hfs_file_operations; 21 - static struct inode_operations hfs_file_inode_operations; 21 + static const struct inode_operations hfs_file_inode_operations; 22 22 23 23 /*================ Variable-like macros ================*/ 24 24 ··· 612 612 .release = hfs_file_release, 613 613 }; 614 614 615 - static struct inode_operations hfs_file_inode_operations = { 615 + static const struct inode_operations hfs_file_inode_operations = { 616 616 .lookup = hfs_file_lookup, 617 617 .truncate = hfs_file_truncate, 618 618 .setattr = hfs_inode_setattr,
+1 -1
fs/hfsplus/dir.c
··· 471 471 return res; 472 472 } 473 473 474 - struct inode_operations hfsplus_dir_inode_operations = { 474 + const struct inode_operations hfsplus_dir_inode_operations = { 475 475 .lookup = hfsplus_lookup, 476 476 .create = hfsplus_create, 477 477 .link = hfsplus_link,
+2 -2
fs/hfsplus/inode.c
··· 268 268 return 0; 269 269 } 270 270 271 - extern struct inode_operations hfsplus_dir_inode_operations; 271 + extern const struct inode_operations hfsplus_dir_inode_operations; 272 272 extern struct file_operations hfsplus_dir_operations; 273 273 274 - static struct inode_operations hfsplus_file_inode_operations = { 274 + static const struct inode_operations hfsplus_file_inode_operations = { 275 275 .lookup = hfsplus_file_lookup, 276 276 .truncate = hfsplus_file_truncate, 277 277 .permission = hfsplus_permission,
+4 -4
fs/hostfs/hostfs_kern.c
··· 52 52 53 53 #define HOSTFS_SUPER_MAGIC 0x00c0ffee 54 54 55 - static struct inode_operations hostfs_iops; 56 - static struct inode_operations hostfs_dir_iops; 55 + static const struct inode_operations hostfs_iops; 56 + static const struct inode_operations hostfs_dir_iops; 57 57 static const struct address_space_operations hostfs_link_aops; 58 58 59 59 #ifndef MODULE ··· 880 880 return(0); 881 881 } 882 882 883 - static struct inode_operations hostfs_iops = { 883 + static const struct inode_operations hostfs_iops = { 884 884 .create = hostfs_create, 885 885 .link = hostfs_link, 886 886 .unlink = hostfs_unlink, ··· 894 894 .getattr = hostfs_getattr, 895 895 }; 896 896 897 - static struct inode_operations hostfs_dir_iops = { 897 + static const struct inode_operations hostfs_dir_iops = { 898 898 .create = hostfs_create, 899 899 .lookup = hostfs_lookup, 900 900 .link = hostfs_link,
+1 -1
fs/hpfs/file.c
··· 132 132 .sendfile = generic_file_sendfile, 133 133 }; 134 134 135 - struct inode_operations hpfs_file_iops = 135 + const struct inode_operations hpfs_file_iops = 136 136 { 137 137 .truncate = hpfs_truncate, 138 138 .setattr = hpfs_notify_change,
+2 -2
fs/hpfs/hpfs_fn.h
··· 266 266 267 267 int hpfs_file_fsync(struct file *, struct dentry *, int); 268 268 extern const struct file_operations hpfs_file_ops; 269 - extern struct inode_operations hpfs_file_iops; 269 + extern const struct inode_operations hpfs_file_iops; 270 270 extern const struct address_space_operations hpfs_aops; 271 271 272 272 /* inode.c */ ··· 302 302 303 303 /* namei.c */ 304 304 305 - extern struct inode_operations hpfs_dir_iops; 305 + extern const struct inode_operations hpfs_dir_iops; 306 306 extern const struct address_space_operations hpfs_symlink_aops; 307 307 308 308 static inline struct hpfs_inode_info *hpfs_i(struct inode *inode)
+1 -1
fs/hpfs/namei.c
··· 659 659 return err; 660 660 } 661 661 662 - struct inode_operations hpfs_dir_iops = 662 + const struct inode_operations hpfs_dir_iops = 663 663 { 664 664 .create = hpfs_create, 665 665 .lookup = hpfs_lookup,
+3 -3
fs/hppfs/hppfs_kern.c
··· 212 212 return(ERR_PTR(err)); 213 213 } 214 214 215 - static struct inode_operations hppfs_file_iops = { 215 + static const struct inode_operations hppfs_file_iops = { 216 216 }; 217 217 218 218 static ssize_t read_proc(struct file *file, char __user *buf, ssize_t count, ··· 693 693 return ret; 694 694 } 695 695 696 - static struct inode_operations hppfs_dir_iops = { 696 + static const struct inode_operations hppfs_dir_iops = { 697 697 .lookup = hppfs_lookup, 698 698 }; 699 699 700 - static struct inode_operations hppfs_link_iops = { 700 + static const struct inode_operations hppfs_link_iops = { 701 701 .readlink = hppfs_readlink, 702 702 .follow_link = hppfs_follow_link, 703 703 };
+4 -4
fs/hugetlbfs/inode.c
··· 36 36 static struct super_operations hugetlbfs_ops; 37 37 static const struct address_space_operations hugetlbfs_aops; 38 38 const struct file_operations hugetlbfs_file_operations; 39 - static struct inode_operations hugetlbfs_dir_inode_operations; 40 - static struct inode_operations hugetlbfs_inode_operations; 39 + static const struct inode_operations hugetlbfs_dir_inode_operations; 40 + static const struct inode_operations hugetlbfs_inode_operations; 41 41 42 42 static struct backing_dev_info hugetlbfs_backing_dev_info = { 43 43 .ra_pages = 0, /* No readahead */ ··· 563 563 .get_unmapped_area = hugetlb_get_unmapped_area, 564 564 }; 565 565 566 - static struct inode_operations hugetlbfs_dir_inode_operations = { 566 + static const struct inode_operations hugetlbfs_dir_inode_operations = { 567 567 .create = hugetlbfs_create, 568 568 .lookup = simple_lookup, 569 569 .link = simple_link, ··· 576 576 .setattr = hugetlbfs_setattr, 577 577 }; 578 578 579 - static struct inode_operations hugetlbfs_inode_operations = { 579 + static const struct inode_operations hugetlbfs_inode_operations = { 580 580 .setattr = hugetlbfs_setattr, 581 581 }; 582 582
+1 -1
fs/isofs/dir.c
··· 24 24 /* 25 25 * directories can handle most operations... 26 26 */ 27 - struct inode_operations isofs_dir_inode_operations = 27 + const struct inode_operations isofs_dir_inode_operations = 28 28 { 29 29 .lookup = isofs_lookup, 30 30 };
+1 -1
fs/isofs/isofs.h
··· 174 174 } 175 175 } 176 176 177 - extern struct inode_operations isofs_dir_inode_operations; 177 + extern const struct inode_operations isofs_dir_inode_operations; 178 178 extern const struct file_operations isofs_dir_operations; 179 179 extern const struct address_space_operations isofs_symlink_aops; 180 180 extern struct export_operations isofs_export_ops;
+4 -4
fs/jffs/inode-v23.c
··· 56 56 57 57 static struct super_operations jffs_ops; 58 58 static const struct file_operations jffs_file_operations; 59 - static struct inode_operations jffs_file_inode_operations; 59 + static const struct inode_operations jffs_file_inode_operations; 60 60 static const struct file_operations jffs_dir_operations; 61 - static struct inode_operations jffs_dir_inode_operations; 61 + static const struct inode_operations jffs_dir_inode_operations; 62 62 static const struct address_space_operations jffs_address_operations; 63 63 64 64 struct kmem_cache *node_cache = NULL; ··· 1642 1642 }; 1643 1643 1644 1644 1645 - static struct inode_operations jffs_file_inode_operations = 1645 + static const struct inode_operations jffs_file_inode_operations = 1646 1646 { 1647 1647 .lookup = jffs_lookup, /* lookup */ 1648 1648 .setattr = jffs_setattr, ··· 1655 1655 }; 1656 1656 1657 1657 1658 - static struct inode_operations jffs_dir_inode_operations = 1658 + static const struct inode_operations jffs_dir_inode_operations = 1659 1659 { 1660 1660 .create = jffs_create, 1661 1661 .lookup = jffs_lookup,
+1 -1
fs/jffs2/dir.c
··· 46 46 }; 47 47 48 48 49 - struct inode_operations jffs2_dir_inode_operations = 49 + const struct inode_operations jffs2_dir_inode_operations = 50 50 { 51 51 .create = jffs2_create, 52 52 .lookup = jffs2_lookup,
+1 -1
fs/jffs2/file.c
··· 54 54 55 55 /* jffs2_file_inode_operations */ 56 56 57 - struct inode_operations jffs2_file_inode_operations = 57 + const struct inode_operations jffs2_file_inode_operations = 58 58 { 59 59 .permission = jffs2_permission, 60 60 .setattr = jffs2_setattr,
+3 -3
fs/jffs2/os-linux.h
··· 153 153 154 154 /* dir.c */ 155 155 extern const struct file_operations jffs2_dir_operations; 156 - extern struct inode_operations jffs2_dir_inode_operations; 156 + extern const struct inode_operations jffs2_dir_inode_operations; 157 157 158 158 /* file.c */ 159 159 extern const struct file_operations jffs2_file_operations; 160 - extern struct inode_operations jffs2_file_inode_operations; 160 + extern const struct inode_operations jffs2_file_inode_operations; 161 161 extern const struct address_space_operations jffs2_file_address_operations; 162 162 int jffs2_fsync(struct file *, struct dentry *, int); 163 163 int jffs2_do_readpage_unlock (struct inode *inode, struct page *pg); ··· 166 166 int jffs2_ioctl(struct inode *, struct file *, unsigned int, unsigned long); 167 167 168 168 /* symlink.c */ 169 - extern struct inode_operations jffs2_symlink_inode_operations; 169 + extern const struct inode_operations jffs2_symlink_inode_operations; 170 170 171 171 /* fs.c */ 172 172 int jffs2_setattr (struct dentry *, struct iattr *);
+1 -1
fs/jffs2/symlink.c
··· 20 20 21 21 static void *jffs2_follow_link(struct dentry *dentry, struct nameidata *nd); 22 22 23 - struct inode_operations jffs2_symlink_inode_operations = 23 + const struct inode_operations jffs2_symlink_inode_operations = 24 24 { 25 25 .readlink = generic_readlink, 26 26 .follow_link = jffs2_follow_link,
+1 -1
fs/jfs/file.c
··· 88 88 return 0; 89 89 } 90 90 91 - struct inode_operations jfs_file_inode_operations = { 91 + const struct inode_operations jfs_file_inode_operations = { 92 92 .truncate = jfs_truncate, 93 93 .setxattr = jfs_setxattr, 94 94 .getxattr = jfs_getxattr,
+3 -3
fs/jfs/jfs_inode.h
··· 35 35 extern int jfs_get_block(struct inode *, sector_t, struct buffer_head *, int); 36 36 37 37 extern const struct address_space_operations jfs_aops; 38 - extern struct inode_operations jfs_dir_inode_operations; 38 + extern const struct inode_operations jfs_dir_inode_operations; 39 39 extern const struct file_operations jfs_dir_operations; 40 - extern struct inode_operations jfs_file_inode_operations; 40 + extern const struct inode_operations jfs_file_inode_operations; 41 41 extern const struct file_operations jfs_file_operations; 42 - extern struct inode_operations jfs_symlink_inode_operations; 42 + extern const struct inode_operations jfs_symlink_inode_operations; 43 43 extern struct dentry_operations jfs_ci_dentry_operations; 44 44 #endif /* _H_JFS_INODE */
+1 -1
fs/jfs/namei.c
··· 1503 1503 return parent; 1504 1504 } 1505 1505 1506 - struct inode_operations jfs_dir_inode_operations = { 1506 + const struct inode_operations jfs_dir_inode_operations = { 1507 1507 .create = jfs_create, 1508 1508 .lookup = jfs_lookup, 1509 1509 .link = jfs_link,
+1 -1
fs/jfs/symlink.c
··· 29 29 return NULL; 30 30 } 31 31 32 - struct inode_operations jfs_symlink_inode_operations = { 32 + const struct inode_operations jfs_symlink_inode_operations = { 33 33 .readlink = generic_readlink, 34 34 .follow_link = jfs_follow_link, 35 35 .setxattr = jfs_setxattr,
+1 -1
fs/libfs.c
··· 186 186 .fsync = simple_sync_file, 187 187 }; 188 188 189 - struct inode_operations simple_dir_inode_operations = { 189 + const struct inode_operations simple_dir_inode_operations = { 190 190 .lookup = simple_lookup, 191 191 }; 192 192
+1 -1
fs/minix/file.c
··· 26 26 .sendfile = generic_file_sendfile, 27 27 }; 28 28 29 - struct inode_operations minix_file_inode_operations = { 29 + const struct inode_operations minix_file_inode_operations = { 30 30 .truncate = minix_truncate, 31 31 .getattr = minix_getattr, 32 32 };
+1 -1
fs/minix/inode.c
··· 369 369 .bmap = minix_bmap 370 370 }; 371 371 372 - static struct inode_operations minix_symlink_inode_operations = { 372 + static const struct inode_operations minix_symlink_inode_operations = { 373 373 .readlink = generic_readlink, 374 374 .follow_link = page_follow_link_light, 375 375 .put_link = page_put_link,
+2 -2
fs/minix/minix.h
··· 75 75 extern ino_t minix_inode_by_name(struct dentry*); 76 76 extern int minix_sync_file(struct file *, struct dentry *, int); 77 77 78 - extern struct inode_operations minix_file_inode_operations; 79 - extern struct inode_operations minix_dir_inode_operations; 78 + extern const struct inode_operations minix_file_inode_operations; 79 + extern const struct inode_operations minix_dir_inode_operations; 80 80 extern const struct file_operations minix_file_operations; 81 81 extern const struct file_operations minix_dir_operations; 82 82 extern struct dentry_operations minix_dentry_operations;
+1 -1
fs/minix/namei.c
··· 291 291 /* 292 292 * directories can handle most operations... 293 293 */ 294 - struct inode_operations minix_dir_inode_operations = { 294 + const struct inode_operations minix_dir_inode_operations = { 295 295 .create = minix_create, 296 296 .lookup = minix_lookup, 297 297 .link = minix_link,
+1 -1
fs/msdos/namei.c
··· 646 646 return err; 647 647 } 648 648 649 - static struct inode_operations msdos_dir_inode_operations = { 649 + static const struct inode_operations msdos_dir_inode_operations = { 650 650 .create = msdos_create, 651 651 .lookup = msdos_lookup, 652 652 .unlink = msdos_unlink,
+1 -1
fs/namei.c
··· 2744 2744 mapping_gfp_mask(inode->i_mapping)); 2745 2745 } 2746 2746 2747 - struct inode_operations page_symlink_inode_operations = { 2747 + const struct inode_operations page_symlink_inode_operations = { 2748 2748 .readlink = generic_readlink, 2749 2749 .follow_link = page_follow_link_light, 2750 2750 .put_link = page_put_link,
+1 -1
fs/ncpfs/dir.c
··· 58 58 #endif 59 59 }; 60 60 61 - struct inode_operations ncp_dir_inode_operations = 61 + const struct inode_operations ncp_dir_inode_operations = 62 62 { 63 63 .create = ncp_create, 64 64 .lookup = ncp_lookup,
+1 -1
fs/ncpfs/file.c
··· 297 297 .fsync = ncp_fsync, 298 298 }; 299 299 300 - struct inode_operations ncp_file_inode_operations = 300 + const struct inode_operations ncp_file_inode_operations = 301 301 { 302 302 .setattr = ncp_notify_change, 303 303 };
+1 -1
fs/ncpfs/inode.c
··· 229 229 } 230 230 231 231 #if defined(CONFIG_NCPFS_EXTRAS) || defined(CONFIG_NCPFS_NFS_NS) 232 - static struct inode_operations ncp_symlink_inode_operations = { 232 + static const struct inode_operations ncp_symlink_inode_operations = { 233 233 .readlink = generic_readlink, 234 234 .follow_link = page_follow_link_light, 235 235 .put_link = page_put_link,
+3 -3
fs/nfs/dir.c
··· 65 65 .fsync = nfs_fsync_dir, 66 66 }; 67 67 68 - struct inode_operations nfs_dir_inode_operations = { 68 + const struct inode_operations nfs_dir_inode_operations = { 69 69 .create = nfs_create, 70 70 .lookup = nfs_lookup, 71 71 .link = nfs_link, ··· 81 81 }; 82 82 83 83 #ifdef CONFIG_NFS_V3 84 - struct inode_operations nfs3_dir_inode_operations = { 84 + const struct inode_operations nfs3_dir_inode_operations = { 85 85 .create = nfs_create, 86 86 .lookup = nfs_lookup, 87 87 .link = nfs_link, ··· 104 104 #ifdef CONFIG_NFS_V4 105 105 106 106 static struct dentry *nfs_atomic_lookup(struct inode *, struct dentry *, struct nameidata *); 107 - struct inode_operations nfs4_dir_inode_operations = { 107 + const struct inode_operations nfs4_dir_inode_operations = { 108 108 .create = nfs_create, 109 109 .lookup = nfs_atomic_lookup, 110 110 .link = nfs_link,
+2 -2
fs/nfs/file.c
··· 68 68 .check_flags = nfs_check_flags, 69 69 }; 70 70 71 - struct inode_operations nfs_file_inode_operations = { 71 + const struct inode_operations nfs_file_inode_operations = { 72 72 .permission = nfs_permission, 73 73 .getattr = nfs_getattr, 74 74 .setattr = nfs_setattr, 75 75 }; 76 76 77 77 #ifdef CONFIG_NFS_V3 78 - struct inode_operations nfs3_file_inode_operations = { 78 + const struct inode_operations nfs3_file_inode_operations = { 79 79 .permission = nfs_permission, 80 80 .getattr = nfs_getattr, 81 81 .setattr = nfs_setattr,
+2 -2
fs/nfs/namespace.c
··· 155 155 goto out; 156 156 } 157 157 158 - struct inode_operations nfs_mountpoint_inode_operations = { 158 + const struct inode_operations nfs_mountpoint_inode_operations = { 159 159 .follow_link = nfs_follow_mountpoint, 160 160 .getattr = nfs_getattr, 161 161 }; 162 162 163 - struct inode_operations nfs_referral_inode_operations = { 163 + const struct inode_operations nfs_referral_inode_operations = { 164 164 .follow_link = nfs_follow_mountpoint, 165 165 }; 166 166
+1 -1
fs/nfs/nfs4_fs.h
··· 151 151 }; 152 152 153 153 extern struct dentry_operations nfs4_dentry_operations; 154 - extern struct inode_operations nfs4_dir_inode_operations; 154 + extern const struct inode_operations nfs4_dir_inode_operations; 155 155 156 156 /* inode.c */ 157 157 extern ssize_t nfs4_getxattr(struct dentry *, const char *, void *, size_t);
+1 -1
fs/nfs/nfs4proc.c
··· 3625 3625 .recover_lock = nfs4_lock_expired, 3626 3626 }; 3627 3627 3628 - static struct inode_operations nfs4_file_inode_operations = { 3628 + static const struct inode_operations nfs4_file_inode_operations = { 3629 3629 .permission = nfs_permission, 3630 3630 .getattr = nfs_getattr, 3631 3631 .setattr = nfs_setattr,
+1 -1
fs/nfs/symlink.c
··· 78 78 /* 79 79 * symlinks can't do much... 80 80 */ 81 - struct inode_operations nfs_symlink_inode_operations = { 81 + const struct inode_operations nfs_symlink_inode_operations = { 82 82 .readlink = generic_readlink, 83 83 .follow_link = nfs_follow_link, 84 84 .put_link = page_put_link,
+2 -2
fs/ntfs/file.c
··· 2328 2328 the data source. */ 2329 2329 }; 2330 2330 2331 - struct inode_operations ntfs_file_inode_ops = { 2331 + const struct inode_operations ntfs_file_inode_ops = { 2332 2332 #ifdef NTFS_RW 2333 2333 .truncate = ntfs_truncate_vfs, 2334 2334 .setattr = ntfs_setattr, ··· 2337 2337 2338 2338 const struct file_operations ntfs_empty_file_ops = {}; 2339 2339 2340 - struct inode_operations ntfs_empty_inode_ops = {}; 2340 + const struct inode_operations ntfs_empty_inode_ops = {};
+1 -1
fs/ntfs/namei.c
··· 359 359 /** 360 360 * Inode operations for directories. 361 361 */ 362 - struct inode_operations ntfs_dir_inode_ops = { 362 + const struct inode_operations ntfs_dir_inode_ops = { 363 363 .lookup = ntfs_lookup, /* VFS: Lookup directory. */ 364 364 }; 365 365
+3 -3
fs/ntfs/ntfs.h
··· 61 61 extern const struct address_space_operations ntfs_mst_aops; 62 62 63 63 extern const struct file_operations ntfs_file_ops; 64 - extern struct inode_operations ntfs_file_inode_ops; 64 + extern const struct inode_operations ntfs_file_inode_ops; 65 65 66 66 extern const struct file_operations ntfs_dir_ops; 67 - extern struct inode_operations ntfs_dir_inode_ops; 67 + extern const struct inode_operations ntfs_dir_inode_ops; 68 68 69 69 extern const struct file_operations ntfs_empty_file_ops; 70 - extern struct inode_operations ntfs_empty_inode_ops; 70 + extern const struct inode_operations ntfs_empty_inode_ops; 71 71 72 72 extern struct export_operations ntfs_export_ops; 73 73
+6 -6
fs/ocfs2/dlm/dlmfs.c
··· 63 63 64 64 static struct super_operations dlmfs_ops; 65 65 static const struct file_operations dlmfs_file_operations; 66 - static struct inode_operations dlmfs_dir_inode_operations; 67 - static struct inode_operations dlmfs_root_inode_operations; 68 - static struct inode_operations dlmfs_file_inode_operations; 66 + static const struct inode_operations dlmfs_dir_inode_operations; 67 + static const struct inode_operations dlmfs_root_inode_operations; 68 + static const struct inode_operations dlmfs_file_inode_operations; 69 69 static struct kmem_cache *dlmfs_inode_cache; 70 70 71 71 struct workqueue_struct *user_dlm_worker; ··· 547 547 .write = dlmfs_file_write, 548 548 }; 549 549 550 - static struct inode_operations dlmfs_dir_inode_operations = { 550 + static const struct inode_operations dlmfs_dir_inode_operations = { 551 551 .create = dlmfs_create, 552 552 .lookup = simple_lookup, 553 553 .unlink = dlmfs_unlink, 554 554 }; 555 555 556 556 /* this way we can restrict mkdir to only the toplevel of the fs. */ 557 - static struct inode_operations dlmfs_root_inode_operations = { 557 + static const struct inode_operations dlmfs_root_inode_operations = { 558 558 .lookup = simple_lookup, 559 559 .mkdir = dlmfs_mkdir, 560 560 .rmdir = simple_rmdir, ··· 568 568 .drop_inode = generic_delete_inode, 569 569 }; 570 570 571 - static struct inode_operations dlmfs_file_inode_operations = { 571 + static const struct inode_operations dlmfs_file_inode_operations = { 572 572 .getattr = simple_getattr, 573 573 }; 574 574
+2 -2
fs/ocfs2/file.c
··· 1365 1365 return ret; 1366 1366 } 1367 1367 1368 - struct inode_operations ocfs2_file_iops = { 1368 + const struct inode_operations ocfs2_file_iops = { 1369 1369 .setattr = ocfs2_setattr, 1370 1370 .getattr = ocfs2_getattr, 1371 1371 .permission = ocfs2_permission, 1372 1372 }; 1373 1373 1374 - struct inode_operations ocfs2_special_file_iops = { 1374 + const struct inode_operations ocfs2_special_file_iops = { 1375 1375 .setattr = ocfs2_setattr, 1376 1376 .getattr = ocfs2_getattr, 1377 1377 .permission = ocfs2_permission,
+2 -2
fs/ocfs2/file.h
··· 28 28 29 29 extern const struct file_operations ocfs2_fops; 30 30 extern const struct file_operations ocfs2_dops; 31 - extern struct inode_operations ocfs2_file_iops; 32 - extern struct inode_operations ocfs2_special_file_iops; 31 + extern const struct inode_operations ocfs2_file_iops; 32 + extern const struct inode_operations ocfs2_special_file_iops; 33 33 struct ocfs2_alloc_context; 34 34 35 35 enum ocfs2_alloc_restarted {
+1 -1
fs/ocfs2/namei.c
··· 2306 2306 return status; 2307 2307 } 2308 2308 2309 - struct inode_operations ocfs2_dir_iops = { 2309 + const struct inode_operations ocfs2_dir_iops = { 2310 2310 .create = ocfs2_create, 2311 2311 .lookup = ocfs2_lookup, 2312 2312 .link = ocfs2_link,
+1 -1
fs/ocfs2/namei.h
··· 26 26 #ifndef OCFS2_NAMEI_H 27 27 #define OCFS2_NAMEI_H 28 28 29 - extern struct inode_operations ocfs2_dir_iops; 29 + extern const struct inode_operations ocfs2_dir_iops; 30 30 31 31 struct dentry *ocfs2_get_parent(struct dentry *child); 32 32
+2 -2
fs/ocfs2/symlink.c
··· 170 170 return ERR_PTR(status); 171 171 } 172 172 173 - struct inode_operations ocfs2_symlink_inode_operations = { 173 + const struct inode_operations ocfs2_symlink_inode_operations = { 174 174 .readlink = page_readlink, 175 175 .follow_link = ocfs2_follow_link, 176 176 .getattr = ocfs2_getattr, 177 177 }; 178 - struct inode_operations ocfs2_fast_symlink_inode_operations = { 178 + const struct inode_operations ocfs2_fast_symlink_inode_operations = { 179 179 .readlink = ocfs2_readlink, 180 180 .follow_link = ocfs2_follow_link, 181 181 .getattr = ocfs2_getattr,
+2 -2
fs/ocfs2/symlink.h
··· 26 26 #ifndef OCFS2_SYMLINK_H 27 27 #define OCFS2_SYMLINK_H 28 28 29 - extern struct inode_operations ocfs2_symlink_inode_operations; 30 - extern struct inode_operations ocfs2_fast_symlink_inode_operations; 29 + extern const struct inode_operations ocfs2_symlink_inode_operations; 30 + extern const struct inode_operations ocfs2_fast_symlink_inode_operations; 31 31 32 32 /* 33 33 * Test whether an inode is a fast symlink.
+1 -1
fs/openpromfs/inode.c
··· 169 169 170 170 static struct dentry *openpromfs_lookup(struct inode *, struct dentry *, struct nameidata *); 171 171 172 - static struct inode_operations openprom_inode_operations = { 172 + static const struct inode_operations openprom_inode_operations = { 173 173 .lookup = openpromfs_lookup, 174 174 }; 175 175
+2 -2
ipc/mqueue.c
··· 84 84 unsigned long qsize; /* size of queue in memory (sum of all msgs) */ 85 85 }; 86 86 87 - static struct inode_operations mqueue_dir_inode_operations; 87 + static const struct inode_operations mqueue_dir_inode_operations; 88 88 static const struct file_operations mqueue_file_operations; 89 89 static struct super_operations mqueue_super_ops; 90 90 static void remove_notification(struct mqueue_inode_info *info); ··· 1160 1160 return ret; 1161 1161 } 1162 1162 1163 - static struct inode_operations mqueue_dir_inode_operations = { 1163 + static const struct inode_operations mqueue_dir_inode_operations = { 1164 1164 .lookup = simple_lookup, 1165 1165 .create = mqueue_create, 1166 1166 .unlink = mqueue_unlink,
+1 -1
kernel/cpuset.c
··· 1540 1540 .release = cpuset_file_release, 1541 1541 }; 1542 1542 1543 - static struct inode_operations cpuset_dir_inode_operations = { 1543 + static const struct inode_operations cpuset_dir_inode_operations = { 1544 1544 .lookup = simple_lookup, 1545 1545 .mkdir = cpuset_mkdir, 1546 1546 .rmdir = cpuset_rmdir,
+10 -10
mm/shmem.c
··· 178 178 static struct super_operations shmem_ops; 179 179 static const struct address_space_operations shmem_aops; 180 180 static const struct file_operations shmem_file_operations; 181 - static struct inode_operations shmem_inode_operations; 182 - static struct inode_operations shmem_dir_inode_operations; 183 - static struct inode_operations shmem_special_inode_operations; 181 + static const struct inode_operations shmem_inode_operations; 182 + static const struct inode_operations shmem_dir_inode_operations; 183 + static const struct inode_operations shmem_special_inode_operations; 184 184 static struct vm_operations_struct shmem_vm_ops; 185 185 186 186 static struct backing_dev_info shmem_backing_dev_info __read_mostly = { ··· 1410 1410 } 1411 1411 1412 1412 #ifdef CONFIG_TMPFS 1413 - static struct inode_operations shmem_symlink_inode_operations; 1414 - static struct inode_operations shmem_symlink_inline_operations; 1413 + static const struct inode_operations shmem_symlink_inode_operations; 1414 + static const struct inode_operations shmem_symlink_inline_operations; 1415 1415 1416 1416 /* 1417 1417 * Normally tmpfs makes no use of shmem_prepare_write, but it ··· 1904 1904 } 1905 1905 } 1906 1906 1907 - static struct inode_operations shmem_symlink_inline_operations = { 1907 + static const struct inode_operations shmem_symlink_inline_operations = { 1908 1908 .readlink = generic_readlink, 1909 1909 .follow_link = shmem_follow_link_inline, 1910 1910 }; 1911 1911 1912 - static struct inode_operations shmem_symlink_inode_operations = { 1912 + static const struct inode_operations shmem_symlink_inode_operations = { 1913 1913 .truncate = shmem_truncate, 1914 1914 .readlink = generic_readlink, 1915 1915 .follow_link = shmem_follow_link, ··· 2335 2335 #endif 2336 2336 }; 2337 2337 2338 - static struct inode_operations shmem_inode_operations = { 2338 + static const struct inode_operations shmem_inode_operations = { 2339 2339 .truncate = shmem_truncate, 2340 2340 .setattr = shmem_notify_change, 2341 2341 .truncate_range = shmem_truncate_range, ··· 2349 2349 2350 2350 }; 2351 2351 2352 - static struct inode_operations shmem_dir_inode_operations = { 2352 + static const struct inode_operations shmem_dir_inode_operations = { 2353 2353 #ifdef CONFIG_TMPFS 2354 2354 .create = shmem_create, 2355 2355 .lookup = simple_lookup, ··· 2371 2371 #endif 2372 2372 }; 2373 2373 2374 - static struct inode_operations shmem_special_inode_operations = { 2374 + static const struct inode_operations shmem_special_inode_operations = { 2375 2375 #ifdef CONFIG_TMPFS_POSIX_ACL 2376 2376 .setattr = shmem_notify_change, 2377 2377 .setxattr = generic_setxattr,