mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2024-12-29 17:23:36 +00:00
[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>
This commit is contained in:
parent
754661f143
commit
92e1d5be91
@ -1115,7 +1115,7 @@ static int gfs2_removexattr(struct dentry *dentry, const char *name)
|
||||
return gfs2_ea_remove(GFS2_I(dentry->d_inode), &er);
|
||||
}
|
||||
|
||||
struct inode_operations gfs2_file_iops = {
|
||||
const struct inode_operations gfs2_file_iops = {
|
||||
.permission = gfs2_permission,
|
||||
.setattr = gfs2_setattr,
|
||||
.getattr = gfs2_getattr,
|
||||
@ -1125,7 +1125,7 @@ struct inode_operations gfs2_file_iops = {
|
||||
.removexattr = gfs2_removexattr,
|
||||
};
|
||||
|
||||
struct inode_operations gfs2_dev_iops = {
|
||||
const struct inode_operations gfs2_dev_iops = {
|
||||
.permission = gfs2_permission,
|
||||
.setattr = gfs2_setattr,
|
||||
.getattr = gfs2_getattr,
|
||||
@ -1135,7 +1135,7 @@ struct inode_operations gfs2_dev_iops = {
|
||||
.removexattr = gfs2_removexattr,
|
||||
};
|
||||
|
||||
struct inode_operations gfs2_dir_iops = {
|
||||
const struct inode_operations gfs2_dir_iops = {
|
||||
.create = gfs2_create,
|
||||
.lookup = gfs2_lookup,
|
||||
.link = gfs2_link,
|
||||
@ -1154,7 +1154,7 @@ struct inode_operations gfs2_dir_iops = {
|
||||
.removexattr = gfs2_removexattr,
|
||||
};
|
||||
|
||||
struct inode_operations gfs2_symlink_iops = {
|
||||
const struct inode_operations gfs2_symlink_iops = {
|
||||
.readlink = gfs2_readlink,
|
||||
.follow_link = gfs2_follow_link,
|
||||
.permission = gfs2_permission,
|
||||
|
@ -12,9 +12,9 @@
|
||||
|
||||
#include <linux/fs.h>
|
||||
|
||||
extern struct inode_operations gfs2_file_iops;
|
||||
extern struct inode_operations gfs2_dir_iops;
|
||||
extern struct inode_operations gfs2_symlink_iops;
|
||||
extern struct inode_operations gfs2_dev_iops;
|
||||
extern const struct inode_operations gfs2_file_iops;
|
||||
extern const struct inode_operations gfs2_dir_iops;
|
||||
extern const struct inode_operations gfs2_symlink_iops;
|
||||
extern const struct inode_operations gfs2_dev_iops;
|
||||
|
||||
#endif /* __OPS_INODE_DOT_H__ */
|
||||
|
@ -320,7 +320,7 @@ const struct file_operations hfs_dir_operations = {
|
||||
.release = hfs_dir_release,
|
||||
};
|
||||
|
||||
struct inode_operations hfs_dir_inode_operations = {
|
||||
const struct inode_operations hfs_dir_inode_operations = {
|
||||
.create = hfs_create,
|
||||
.lookup = hfs_lookup,
|
||||
.unlink = hfs_unlink,
|
||||
|
@ -170,7 +170,7 @@ extern void hfs_cat_build_key(struct super_block *, btree_key *, u32, struct qst
|
||||
|
||||
/* dir.c */
|
||||
extern const struct file_operations hfs_dir_operations;
|
||||
extern struct inode_operations hfs_dir_inode_operations;
|
||||
extern const struct inode_operations hfs_dir_inode_operations;
|
||||
|
||||
/* extent.c */
|
||||
extern int hfs_ext_keycmp(const btree_key *, const btree_key *);
|
||||
|
@ -18,7 +18,7 @@
|
||||
#include "btree.h"
|
||||
|
||||
static const struct file_operations hfs_file_operations;
|
||||
static struct inode_operations hfs_file_inode_operations;
|
||||
static const struct inode_operations hfs_file_inode_operations;
|
||||
|
||||
/*================ Variable-like macros ================*/
|
||||
|
||||
@ -612,7 +612,7 @@ static const struct file_operations hfs_file_operations = {
|
||||
.release = hfs_file_release,
|
||||
};
|
||||
|
||||
static struct inode_operations hfs_file_inode_operations = {
|
||||
static const struct inode_operations hfs_file_inode_operations = {
|
||||
.lookup = hfs_file_lookup,
|
||||
.truncate = hfs_file_truncate,
|
||||
.setattr = hfs_inode_setattr,
|
||||
|
@ -471,7 +471,7 @@ static int hfsplus_rename(struct inode *old_dir, struct dentry *old_dentry,
|
||||
return res;
|
||||
}
|
||||
|
||||
struct inode_operations hfsplus_dir_inode_operations = {
|
||||
const struct inode_operations hfsplus_dir_inode_operations = {
|
||||
.lookup = hfsplus_lookup,
|
||||
.create = hfsplus_create,
|
||||
.link = hfsplus_link,
|
||||
|
@ -268,10 +268,10 @@ static int hfsplus_file_release(struct inode *inode, struct file *file)
|
||||
return 0;
|
||||
}
|
||||
|
||||
extern struct inode_operations hfsplus_dir_inode_operations;
|
||||
extern const struct inode_operations hfsplus_dir_inode_operations;
|
||||
extern struct file_operations hfsplus_dir_operations;
|
||||
|
||||
static struct inode_operations hfsplus_file_inode_operations = {
|
||||
static const struct inode_operations hfsplus_file_inode_operations = {
|
||||
.lookup = hfsplus_file_lookup,
|
||||
.truncate = hfsplus_file_truncate,
|
||||
.permission = hfsplus_permission,
|
||||
|
@ -52,8 +52,8 @@ static int append = 0;
|
||||
|
||||
#define HOSTFS_SUPER_MAGIC 0x00c0ffee
|
||||
|
||||
static struct inode_operations hostfs_iops;
|
||||
static struct inode_operations hostfs_dir_iops;
|
||||
static const struct inode_operations hostfs_iops;
|
||||
static const struct inode_operations hostfs_dir_iops;
|
||||
static const struct address_space_operations hostfs_link_aops;
|
||||
|
||||
#ifndef MODULE
|
||||
@ -880,7 +880,7 @@ int hostfs_getattr(struct vfsmount *mnt, struct dentry *dentry,
|
||||
return(0);
|
||||
}
|
||||
|
||||
static struct inode_operations hostfs_iops = {
|
||||
static const struct inode_operations hostfs_iops = {
|
||||
.create = hostfs_create,
|
||||
.link = hostfs_link,
|
||||
.unlink = hostfs_unlink,
|
||||
@ -894,7 +894,7 @@ static struct inode_operations hostfs_iops = {
|
||||
.getattr = hostfs_getattr,
|
||||
};
|
||||
|
||||
static struct inode_operations hostfs_dir_iops = {
|
||||
static const struct inode_operations hostfs_dir_iops = {
|
||||
.create = hostfs_create,
|
||||
.lookup = hostfs_lookup,
|
||||
.link = hostfs_link,
|
||||
|
@ -132,7 +132,7 @@ const struct file_operations hpfs_file_ops =
|
||||
.sendfile = generic_file_sendfile,
|
||||
};
|
||||
|
||||
struct inode_operations hpfs_file_iops =
|
||||
const struct inode_operations hpfs_file_iops =
|
||||
{
|
||||
.truncate = hpfs_truncate,
|
||||
.setattr = hpfs_notify_change,
|
||||
|
@ -266,7 +266,7 @@ void hpfs_set_ea(struct inode *, struct fnode *, char *, char *, int);
|
||||
|
||||
int hpfs_file_fsync(struct file *, struct dentry *, int);
|
||||
extern const struct file_operations hpfs_file_ops;
|
||||
extern struct inode_operations hpfs_file_iops;
|
||||
extern const struct inode_operations hpfs_file_iops;
|
||||
extern const struct address_space_operations hpfs_aops;
|
||||
|
||||
/* inode.c */
|
||||
@ -302,7 +302,7 @@ void hpfs_decide_conv(struct inode *, unsigned char *, unsigned);
|
||||
|
||||
/* namei.c */
|
||||
|
||||
extern struct inode_operations hpfs_dir_iops;
|
||||
extern const struct inode_operations hpfs_dir_iops;
|
||||
extern const struct address_space_operations hpfs_symlink_aops;
|
||||
|
||||
static inline struct hpfs_inode_info *hpfs_i(struct inode *inode)
|
||||
|
@ -659,7 +659,7 @@ static int hpfs_rename(struct inode *old_dir, struct dentry *old_dentry,
|
||||
return err;
|
||||
}
|
||||
|
||||
struct inode_operations hpfs_dir_iops =
|
||||
const struct inode_operations hpfs_dir_iops =
|
||||
{
|
||||
.create = hpfs_create,
|
||||
.lookup = hpfs_lookup,
|
||||
|
@ -212,7 +212,7 @@ static struct dentry *hppfs_lookup(struct inode *ino, struct dentry *dentry,
|
||||
return(ERR_PTR(err));
|
||||
}
|
||||
|
||||
static struct inode_operations hppfs_file_iops = {
|
||||
static const struct inode_operations hppfs_file_iops = {
|
||||
};
|
||||
|
||||
static ssize_t read_proc(struct file *file, char __user *buf, ssize_t count,
|
||||
@ -693,11 +693,11 @@ static void* hppfs_follow_link(struct dentry *dentry, struct nameidata *nd)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static struct inode_operations hppfs_dir_iops = {
|
||||
static const struct inode_operations hppfs_dir_iops = {
|
||||
.lookup = hppfs_lookup,
|
||||
};
|
||||
|
||||
static struct inode_operations hppfs_link_iops = {
|
||||
static const struct inode_operations hppfs_link_iops = {
|
||||
.readlink = hppfs_readlink,
|
||||
.follow_link = hppfs_follow_link,
|
||||
};
|
||||
|
@ -36,8 +36,8 @@
|
||||
static struct super_operations hugetlbfs_ops;
|
||||
static const struct address_space_operations hugetlbfs_aops;
|
||||
const struct file_operations hugetlbfs_file_operations;
|
||||
static struct inode_operations hugetlbfs_dir_inode_operations;
|
||||
static struct inode_operations hugetlbfs_inode_operations;
|
||||
static const struct inode_operations hugetlbfs_dir_inode_operations;
|
||||
static const struct inode_operations hugetlbfs_inode_operations;
|
||||
|
||||
static struct backing_dev_info hugetlbfs_backing_dev_info = {
|
||||
.ra_pages = 0, /* No readahead */
|
||||
@ -563,7 +563,7 @@ const struct file_operations hugetlbfs_file_operations = {
|
||||
.get_unmapped_area = hugetlb_get_unmapped_area,
|
||||
};
|
||||
|
||||
static struct inode_operations hugetlbfs_dir_inode_operations = {
|
||||
static const struct inode_operations hugetlbfs_dir_inode_operations = {
|
||||
.create = hugetlbfs_create,
|
||||
.lookup = simple_lookup,
|
||||
.link = simple_link,
|
||||
@ -576,7 +576,7 @@ static struct inode_operations hugetlbfs_dir_inode_operations = {
|
||||
.setattr = hugetlbfs_setattr,
|
||||
};
|
||||
|
||||
static struct inode_operations hugetlbfs_inode_operations = {
|
||||
static const struct inode_operations hugetlbfs_inode_operations = {
|
||||
.setattr = hugetlbfs_setattr,
|
||||
};
|
||||
|
||||
|
@ -24,7 +24,7 @@ const struct file_operations isofs_dir_operations =
|
||||
/*
|
||||
* directories can handle most operations...
|
||||
*/
|
||||
struct inode_operations isofs_dir_inode_operations =
|
||||
const struct inode_operations isofs_dir_inode_operations =
|
||||
{
|
||||
.lookup = isofs_lookup,
|
||||
};
|
||||
|
@ -174,7 +174,7 @@ isofs_normalize_block_and_offset(struct iso_directory_record* de,
|
||||
}
|
||||
}
|
||||
|
||||
extern struct inode_operations isofs_dir_inode_operations;
|
||||
extern const struct inode_operations isofs_dir_inode_operations;
|
||||
extern const struct file_operations isofs_dir_operations;
|
||||
extern const struct address_space_operations isofs_symlink_aops;
|
||||
extern struct export_operations isofs_export_ops;
|
||||
|
@ -56,9 +56,9 @@ static int jffs_remove(struct inode *dir, struct dentry *dentry, int type);
|
||||
|
||||
static struct super_operations jffs_ops;
|
||||
static const struct file_operations jffs_file_operations;
|
||||
static struct inode_operations jffs_file_inode_operations;
|
||||
static const struct inode_operations jffs_file_inode_operations;
|
||||
static const struct file_operations jffs_dir_operations;
|
||||
static struct inode_operations jffs_dir_inode_operations;
|
||||
static const struct inode_operations jffs_dir_inode_operations;
|
||||
static const struct address_space_operations jffs_address_operations;
|
||||
|
||||
struct kmem_cache *node_cache = NULL;
|
||||
@ -1642,7 +1642,7 @@ static const struct file_operations jffs_file_operations =
|
||||
};
|
||||
|
||||
|
||||
static struct inode_operations jffs_file_inode_operations =
|
||||
static const struct inode_operations jffs_file_inode_operations =
|
||||
{
|
||||
.lookup = jffs_lookup, /* lookup */
|
||||
.setattr = jffs_setattr,
|
||||
@ -1655,7 +1655,7 @@ static const struct file_operations jffs_dir_operations =
|
||||
};
|
||||
|
||||
|
||||
static struct inode_operations jffs_dir_inode_operations =
|
||||
static const struct inode_operations jffs_dir_inode_operations =
|
||||
{
|
||||
.create = jffs_create,
|
||||
.lookup = jffs_lookup,
|
||||
|
@ -46,7 +46,7 @@ const struct file_operations jffs2_dir_operations =
|
||||
};
|
||||
|
||||
|
||||
struct inode_operations jffs2_dir_inode_operations =
|
||||
const struct inode_operations jffs2_dir_inode_operations =
|
||||
{
|
||||
.create = jffs2_create,
|
||||
.lookup = jffs2_lookup,
|
||||
|
@ -54,7 +54,7 @@ const struct file_operations jffs2_file_operations =
|
||||
|
||||
/* jffs2_file_inode_operations */
|
||||
|
||||
struct inode_operations jffs2_file_inode_operations =
|
||||
const struct inode_operations jffs2_file_inode_operations =
|
||||
{
|
||||
.permission = jffs2_permission,
|
||||
.setattr = jffs2_setattr,
|
||||
|
@ -153,11 +153,11 @@ void jffs2_garbage_collect_trigger(struct jffs2_sb_info *c);
|
||||
|
||||
/* dir.c */
|
||||
extern const struct file_operations jffs2_dir_operations;
|
||||
extern struct inode_operations jffs2_dir_inode_operations;
|
||||
extern const struct inode_operations jffs2_dir_inode_operations;
|
||||
|
||||
/* file.c */
|
||||
extern const struct file_operations jffs2_file_operations;
|
||||
extern struct inode_operations jffs2_file_inode_operations;
|
||||
extern const struct inode_operations jffs2_file_inode_operations;
|
||||
extern const struct address_space_operations jffs2_file_address_operations;
|
||||
int jffs2_fsync(struct file *, struct dentry *, int);
|
||||
int jffs2_do_readpage_unlock (struct inode *inode, struct page *pg);
|
||||
@ -166,7 +166,7 @@ int jffs2_do_readpage_unlock (struct inode *inode, struct page *pg);
|
||||
int jffs2_ioctl(struct inode *, struct file *, unsigned int, unsigned long);
|
||||
|
||||
/* symlink.c */
|
||||
extern struct inode_operations jffs2_symlink_inode_operations;
|
||||
extern const struct inode_operations jffs2_symlink_inode_operations;
|
||||
|
||||
/* fs.c */
|
||||
int jffs2_setattr (struct dentry *, struct iattr *);
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
static void *jffs2_follow_link(struct dentry *dentry, struct nameidata *nd);
|
||||
|
||||
struct inode_operations jffs2_symlink_inode_operations =
|
||||
const struct inode_operations jffs2_symlink_inode_operations =
|
||||
{
|
||||
.readlink = generic_readlink,
|
||||
.follow_link = jffs2_follow_link,
|
||||
|
@ -88,7 +88,7 @@ static int jfs_release(struct inode *inode, struct file *file)
|
||||
return 0;
|
||||
}
|
||||
|
||||
struct inode_operations jfs_file_inode_operations = {
|
||||
const struct inode_operations jfs_file_inode_operations = {
|
||||
.truncate = jfs_truncate,
|
||||
.setxattr = jfs_setxattr,
|
||||
.getxattr = jfs_getxattr,
|
||||
|
@ -35,10 +35,10 @@ extern void jfs_set_inode_flags(struct inode *);
|
||||
extern int jfs_get_block(struct inode *, sector_t, struct buffer_head *, int);
|
||||
|
||||
extern const struct address_space_operations jfs_aops;
|
||||
extern struct inode_operations jfs_dir_inode_operations;
|
||||
extern const struct inode_operations jfs_dir_inode_operations;
|
||||
extern const struct file_operations jfs_dir_operations;
|
||||
extern struct inode_operations jfs_file_inode_operations;
|
||||
extern const struct inode_operations jfs_file_inode_operations;
|
||||
extern const struct file_operations jfs_file_operations;
|
||||
extern struct inode_operations jfs_symlink_inode_operations;
|
||||
extern const struct inode_operations jfs_symlink_inode_operations;
|
||||
extern struct dentry_operations jfs_ci_dentry_operations;
|
||||
#endif /* _H_JFS_INODE */
|
||||
|
@ -1503,7 +1503,7 @@ struct dentry *jfs_get_parent(struct dentry *dentry)
|
||||
return parent;
|
||||
}
|
||||
|
||||
struct inode_operations jfs_dir_inode_operations = {
|
||||
const struct inode_operations jfs_dir_inode_operations = {
|
||||
.create = jfs_create,
|
||||
.lookup = jfs_lookup,
|
||||
.link = jfs_link,
|
||||
|
@ -29,7 +29,7 @@ static void *jfs_follow_link(struct dentry *dentry, struct nameidata *nd)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
struct inode_operations jfs_symlink_inode_operations = {
|
||||
const struct inode_operations jfs_symlink_inode_operations = {
|
||||
.readlink = generic_readlink,
|
||||
.follow_link = jfs_follow_link,
|
||||
.setxattr = jfs_setxattr,
|
||||
|
@ -186,7 +186,7 @@ const struct file_operations simple_dir_operations = {
|
||||
.fsync = simple_sync_file,
|
||||
};
|
||||
|
||||
struct inode_operations simple_dir_inode_operations = {
|
||||
const struct inode_operations simple_dir_inode_operations = {
|
||||
.lookup = simple_lookup,
|
||||
};
|
||||
|
||||
|
@ -26,7 +26,7 @@ const struct file_operations minix_file_operations = {
|
||||
.sendfile = generic_file_sendfile,
|
||||
};
|
||||
|
||||
struct inode_operations minix_file_inode_operations = {
|
||||
const struct inode_operations minix_file_inode_operations = {
|
||||
.truncate = minix_truncate,
|
||||
.getattr = minix_getattr,
|
||||
};
|
||||
|
@ -369,7 +369,7 @@ static const struct address_space_operations minix_aops = {
|
||||
.bmap = minix_bmap
|
||||
};
|
||||
|
||||
static struct inode_operations minix_symlink_inode_operations = {
|
||||
static const struct inode_operations minix_symlink_inode_operations = {
|
||||
.readlink = generic_readlink,
|
||||
.follow_link = page_follow_link_light,
|
||||
.put_link = page_put_link,
|
||||
|
@ -75,8 +75,8 @@ extern struct minix_dir_entry *minix_dotdot(struct inode*, struct page**);
|
||||
extern ino_t minix_inode_by_name(struct dentry*);
|
||||
extern int minix_sync_file(struct file *, struct dentry *, int);
|
||||
|
||||
extern struct inode_operations minix_file_inode_operations;
|
||||
extern struct inode_operations minix_dir_inode_operations;
|
||||
extern const struct inode_operations minix_file_inode_operations;
|
||||
extern const struct inode_operations minix_dir_inode_operations;
|
||||
extern const struct file_operations minix_file_operations;
|
||||
extern const struct file_operations minix_dir_operations;
|
||||
extern struct dentry_operations minix_dentry_operations;
|
||||
|
@ -291,7 +291,7 @@ static int minix_rename(struct inode * old_dir, struct dentry *old_dentry,
|
||||
/*
|
||||
* directories can handle most operations...
|
||||
*/
|
||||
struct inode_operations minix_dir_inode_operations = {
|
||||
const struct inode_operations minix_dir_inode_operations = {
|
||||
.create = minix_create,
|
||||
.lookup = minix_lookup,
|
||||
.link = minix_link,
|
||||
|
@ -646,7 +646,7 @@ static int msdos_rename(struct inode *old_dir, struct dentry *old_dentry,
|
||||
return err;
|
||||
}
|
||||
|
||||
static struct inode_operations msdos_dir_inode_operations = {
|
||||
static const struct inode_operations msdos_dir_inode_operations = {
|
||||
.create = msdos_create,
|
||||
.lookup = msdos_lookup,
|
||||
.unlink = msdos_unlink,
|
||||
|
@ -2744,7 +2744,7 @@ int page_symlink(struct inode *inode, const char *symname, int len)
|
||||
mapping_gfp_mask(inode->i_mapping));
|
||||
}
|
||||
|
||||
struct inode_operations page_symlink_inode_operations = {
|
||||
const struct inode_operations page_symlink_inode_operations = {
|
||||
.readlink = generic_readlink,
|
||||
.follow_link = page_follow_link_light,
|
||||
.put_link = page_put_link,
|
||||
|
@ -58,7 +58,7 @@ const struct file_operations ncp_dir_operations =
|
||||
#endif
|
||||
};
|
||||
|
||||
struct inode_operations ncp_dir_inode_operations =
|
||||
const struct inode_operations ncp_dir_inode_operations =
|
||||
{
|
||||
.create = ncp_create,
|
||||
.lookup = ncp_lookup,
|
||||
|
@ -297,7 +297,7 @@ const struct file_operations ncp_file_operations =
|
||||
.fsync = ncp_fsync,
|
||||
};
|
||||
|
||||
struct inode_operations ncp_file_inode_operations =
|
||||
const struct inode_operations ncp_file_inode_operations =
|
||||
{
|
||||
.setattr = ncp_notify_change,
|
||||
};
|
||||
|
@ -229,7 +229,7 @@ static void ncp_set_attr(struct inode *inode, struct ncp_entry_info *nwinfo)
|
||||
}
|
||||
|
||||
#if defined(CONFIG_NCPFS_EXTRAS) || defined(CONFIG_NCPFS_NFS_NS)
|
||||
static struct inode_operations ncp_symlink_inode_operations = {
|
||||
static const struct inode_operations ncp_symlink_inode_operations = {
|
||||
.readlink = generic_readlink,
|
||||
.follow_link = page_follow_link_light,
|
||||
.put_link = page_put_link,
|
||||
|
@ -65,7 +65,7 @@ const struct file_operations nfs_dir_operations = {
|
||||
.fsync = nfs_fsync_dir,
|
||||
};
|
||||
|
||||
struct inode_operations nfs_dir_inode_operations = {
|
||||
const struct inode_operations nfs_dir_inode_operations = {
|
||||
.create = nfs_create,
|
||||
.lookup = nfs_lookup,
|
||||
.link = nfs_link,
|
||||
@ -81,7 +81,7 @@ struct inode_operations nfs_dir_inode_operations = {
|
||||
};
|
||||
|
||||
#ifdef CONFIG_NFS_V3
|
||||
struct inode_operations nfs3_dir_inode_operations = {
|
||||
const struct inode_operations nfs3_dir_inode_operations = {
|
||||
.create = nfs_create,
|
||||
.lookup = nfs_lookup,
|
||||
.link = nfs_link,
|
||||
@ -104,7 +104,7 @@ struct inode_operations nfs3_dir_inode_operations = {
|
||||
#ifdef CONFIG_NFS_V4
|
||||
|
||||
static struct dentry *nfs_atomic_lookup(struct inode *, struct dentry *, struct nameidata *);
|
||||
struct inode_operations nfs4_dir_inode_operations = {
|
||||
const struct inode_operations nfs4_dir_inode_operations = {
|
||||
.create = nfs_create,
|
||||
.lookup = nfs_atomic_lookup,
|
||||
.link = nfs_link,
|
||||
|
@ -68,14 +68,14 @@ const struct file_operations nfs_file_operations = {
|
||||
.check_flags = nfs_check_flags,
|
||||
};
|
||||
|
||||
struct inode_operations nfs_file_inode_operations = {
|
||||
const struct inode_operations nfs_file_inode_operations = {
|
||||
.permission = nfs_permission,
|
||||
.getattr = nfs_getattr,
|
||||
.setattr = nfs_setattr,
|
||||
};
|
||||
|
||||
#ifdef CONFIG_NFS_V3
|
||||
struct inode_operations nfs3_file_inode_operations = {
|
||||
const struct inode_operations nfs3_file_inode_operations = {
|
||||
.permission = nfs_permission,
|
||||
.getattr = nfs_getattr,
|
||||
.setattr = nfs_setattr,
|
||||
|
@ -155,12 +155,12 @@ static void * nfs_follow_mountpoint(struct dentry *dentry, struct nameidata *nd)
|
||||
goto out;
|
||||
}
|
||||
|
||||
struct inode_operations nfs_mountpoint_inode_operations = {
|
||||
const struct inode_operations nfs_mountpoint_inode_operations = {
|
||||
.follow_link = nfs_follow_mountpoint,
|
||||
.getattr = nfs_getattr,
|
||||
};
|
||||
|
||||
struct inode_operations nfs_referral_inode_operations = {
|
||||
const struct inode_operations nfs_referral_inode_operations = {
|
||||
.follow_link = nfs_follow_mountpoint,
|
||||
};
|
||||
|
||||
|
@ -151,7 +151,7 @@ struct nfs4_state_recovery_ops {
|
||||
};
|
||||
|
||||
extern struct dentry_operations nfs4_dentry_operations;
|
||||
extern struct inode_operations nfs4_dir_inode_operations;
|
||||
extern const struct inode_operations nfs4_dir_inode_operations;
|
||||
|
||||
/* inode.c */
|
||||
extern ssize_t nfs4_getxattr(struct dentry *, const char *, void *, size_t);
|
||||
|
@ -3625,7 +3625,7 @@ struct nfs4_state_recovery_ops nfs4_network_partition_recovery_ops = {
|
||||
.recover_lock = nfs4_lock_expired,
|
||||
};
|
||||
|
||||
static struct inode_operations nfs4_file_inode_operations = {
|
||||
static const struct inode_operations nfs4_file_inode_operations = {
|
||||
.permission = nfs_permission,
|
||||
.getattr = nfs_getattr,
|
||||
.setattr = nfs_setattr,
|
||||
|
@ -78,7 +78,7 @@ static void *nfs_follow_link(struct dentry *dentry, struct nameidata *nd)
|
||||
/*
|
||||
* symlinks can't do much...
|
||||
*/
|
||||
struct inode_operations nfs_symlink_inode_operations = {
|
||||
const struct inode_operations nfs_symlink_inode_operations = {
|
||||
.readlink = generic_readlink,
|
||||
.follow_link = nfs_follow_link,
|
||||
.put_link = page_put_link,
|
||||
|
@ -2328,7 +2328,7 @@ const struct file_operations ntfs_file_ops = {
|
||||
the data source. */
|
||||
};
|
||||
|
||||
struct inode_operations ntfs_file_inode_ops = {
|
||||
const struct inode_operations ntfs_file_inode_ops = {
|
||||
#ifdef NTFS_RW
|
||||
.truncate = ntfs_truncate_vfs,
|
||||
.setattr = ntfs_setattr,
|
||||
@ -2337,4 +2337,4 @@ struct inode_operations ntfs_file_inode_ops = {
|
||||
|
||||
const struct file_operations ntfs_empty_file_ops = {};
|
||||
|
||||
struct inode_operations ntfs_empty_inode_ops = {};
|
||||
const struct inode_operations ntfs_empty_inode_ops = {};
|
||||
|
@ -359,7 +359,7 @@ static struct dentry *ntfs_lookup(struct inode *dir_ino, struct dentry *dent,
|
||||
/**
|
||||
* Inode operations for directories.
|
||||
*/
|
||||
struct inode_operations ntfs_dir_inode_ops = {
|
||||
const struct inode_operations ntfs_dir_inode_ops = {
|
||||
.lookup = ntfs_lookup, /* VFS: Lookup directory. */
|
||||
};
|
||||
|
||||
|
@ -61,13 +61,13 @@ extern const struct address_space_operations ntfs_aops;
|
||||
extern const struct address_space_operations ntfs_mst_aops;
|
||||
|
||||
extern const struct file_operations ntfs_file_ops;
|
||||
extern struct inode_operations ntfs_file_inode_ops;
|
||||
extern const struct inode_operations ntfs_file_inode_ops;
|
||||
|
||||
extern const struct file_operations ntfs_dir_ops;
|
||||
extern struct inode_operations ntfs_dir_inode_ops;
|
||||
extern const struct inode_operations ntfs_dir_inode_ops;
|
||||
|
||||
extern const struct file_operations ntfs_empty_file_ops;
|
||||
extern struct inode_operations ntfs_empty_inode_ops;
|
||||
extern const struct inode_operations ntfs_empty_inode_ops;
|
||||
|
||||
extern struct export_operations ntfs_export_ops;
|
||||
|
||||
|
@ -63,9 +63,9 @@
|
||||
|
||||
static struct super_operations dlmfs_ops;
|
||||
static const struct file_operations dlmfs_file_operations;
|
||||
static struct inode_operations dlmfs_dir_inode_operations;
|
||||
static struct inode_operations dlmfs_root_inode_operations;
|
||||
static struct inode_operations dlmfs_file_inode_operations;
|
||||
static const struct inode_operations dlmfs_dir_inode_operations;
|
||||
static const struct inode_operations dlmfs_root_inode_operations;
|
||||
static const struct inode_operations dlmfs_file_inode_operations;
|
||||
static struct kmem_cache *dlmfs_inode_cache;
|
||||
|
||||
struct workqueue_struct *user_dlm_worker;
|
||||
@ -547,14 +547,14 @@ static const struct file_operations dlmfs_file_operations = {
|
||||
.write = dlmfs_file_write,
|
||||
};
|
||||
|
||||
static struct inode_operations dlmfs_dir_inode_operations = {
|
||||
static const struct inode_operations dlmfs_dir_inode_operations = {
|
||||
.create = dlmfs_create,
|
||||
.lookup = simple_lookup,
|
||||
.unlink = dlmfs_unlink,
|
||||
};
|
||||
|
||||
/* this way we can restrict mkdir to only the toplevel of the fs. */
|
||||
static struct inode_operations dlmfs_root_inode_operations = {
|
||||
static const struct inode_operations dlmfs_root_inode_operations = {
|
||||
.lookup = simple_lookup,
|
||||
.mkdir = dlmfs_mkdir,
|
||||
.rmdir = simple_rmdir,
|
||||
@ -568,7 +568,7 @@ static struct super_operations dlmfs_ops = {
|
||||
.drop_inode = generic_delete_inode,
|
||||
};
|
||||
|
||||
static struct inode_operations dlmfs_file_inode_operations = {
|
||||
static const struct inode_operations dlmfs_file_inode_operations = {
|
||||
.getattr = simple_getattr,
|
||||
};
|
||||
|
||||
|
@ -1365,13 +1365,13 @@ static ssize_t ocfs2_file_aio_read(struct kiocb *iocb,
|
||||
return ret;
|
||||
}
|
||||
|
||||
struct inode_operations ocfs2_file_iops = {
|
||||
const struct inode_operations ocfs2_file_iops = {
|
||||
.setattr = ocfs2_setattr,
|
||||
.getattr = ocfs2_getattr,
|
||||
.permission = ocfs2_permission,
|
||||
};
|
||||
|
||||
struct inode_operations ocfs2_special_file_iops = {
|
||||
const struct inode_operations ocfs2_special_file_iops = {
|
||||
.setattr = ocfs2_setattr,
|
||||
.getattr = ocfs2_getattr,
|
||||
.permission = ocfs2_permission,
|
||||
|
@ -28,8 +28,8 @@
|
||||
|
||||
extern const struct file_operations ocfs2_fops;
|
||||
extern const struct file_operations ocfs2_dops;
|
||||
extern struct inode_operations ocfs2_file_iops;
|
||||
extern struct inode_operations ocfs2_special_file_iops;
|
||||
extern const struct inode_operations ocfs2_file_iops;
|
||||
extern const struct inode_operations ocfs2_special_file_iops;
|
||||
struct ocfs2_alloc_context;
|
||||
|
||||
enum ocfs2_alloc_restarted {
|
||||
|
@ -2306,7 +2306,7 @@ int ocfs2_orphan_del(struct ocfs2_super *osb,
|
||||
return status;
|
||||
}
|
||||
|
||||
struct inode_operations ocfs2_dir_iops = {
|
||||
const struct inode_operations ocfs2_dir_iops = {
|
||||
.create = ocfs2_create,
|
||||
.lookup = ocfs2_lookup,
|
||||
.link = ocfs2_link,
|
||||
|
@ -26,7 +26,7 @@
|
||||
#ifndef OCFS2_NAMEI_H
|
||||
#define OCFS2_NAMEI_H
|
||||
|
||||
extern struct inode_operations ocfs2_dir_iops;
|
||||
extern const struct inode_operations ocfs2_dir_iops;
|
||||
|
||||
struct dentry *ocfs2_get_parent(struct dentry *child);
|
||||
|
||||
|
@ -170,12 +170,12 @@ static void *ocfs2_follow_link(struct dentry *dentry,
|
||||
return ERR_PTR(status);
|
||||
}
|
||||
|
||||
struct inode_operations ocfs2_symlink_inode_operations = {
|
||||
const struct inode_operations ocfs2_symlink_inode_operations = {
|
||||
.readlink = page_readlink,
|
||||
.follow_link = ocfs2_follow_link,
|
||||
.getattr = ocfs2_getattr,
|
||||
};
|
||||
struct inode_operations ocfs2_fast_symlink_inode_operations = {
|
||||
const struct inode_operations ocfs2_fast_symlink_inode_operations = {
|
||||
.readlink = ocfs2_readlink,
|
||||
.follow_link = ocfs2_follow_link,
|
||||
.getattr = ocfs2_getattr,
|
||||
|
@ -26,8 +26,8 @@
|
||||
#ifndef OCFS2_SYMLINK_H
|
||||
#define OCFS2_SYMLINK_H
|
||||
|
||||
extern struct inode_operations ocfs2_symlink_inode_operations;
|
||||
extern struct inode_operations ocfs2_fast_symlink_inode_operations;
|
||||
extern const struct inode_operations ocfs2_symlink_inode_operations;
|
||||
extern const struct inode_operations ocfs2_fast_symlink_inode_operations;
|
||||
|
||||
/*
|
||||
* Test whether an inode is a fast symlink.
|
||||
|
@ -169,7 +169,7 @@ static const struct file_operations openprom_operations = {
|
||||
|
||||
static struct dentry *openpromfs_lookup(struct inode *, struct dentry *, struct nameidata *);
|
||||
|
||||
static struct inode_operations openprom_inode_operations = {
|
||||
static const struct inode_operations openprom_inode_operations = {
|
||||
.lookup = openpromfs_lookup,
|
||||
};
|
||||
|
||||
|
@ -84,7 +84,7 @@ struct mqueue_inode_info {
|
||||
unsigned long qsize; /* size of queue in memory (sum of all msgs) */
|
||||
};
|
||||
|
||||
static struct inode_operations mqueue_dir_inode_operations;
|
||||
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 void remove_notification(struct mqueue_inode_info *info);
|
||||
@ -1160,7 +1160,7 @@ asmlinkage long sys_mq_getsetattr(mqd_t mqdes,
|
||||
return ret;
|
||||
}
|
||||
|
||||
static struct inode_operations mqueue_dir_inode_operations = {
|
||||
static const struct inode_operations mqueue_dir_inode_operations = {
|
||||
.lookup = simple_lookup,
|
||||
.create = mqueue_create,
|
||||
.unlink = mqueue_unlink,
|
||||
|
@ -1540,7 +1540,7 @@ static const struct file_operations cpuset_file_operations = {
|
||||
.release = cpuset_file_release,
|
||||
};
|
||||
|
||||
static struct inode_operations cpuset_dir_inode_operations = {
|
||||
static const struct inode_operations cpuset_dir_inode_operations = {
|
||||
.lookup = simple_lookup,
|
||||
.mkdir = cpuset_mkdir,
|
||||
.rmdir = cpuset_rmdir,
|
||||
|
20
mm/shmem.c
20
mm/shmem.c
@ -178,9 +178,9 @@ static inline void shmem_unacct_blocks(unsigned long flags, long pages)
|
||||
static struct super_operations shmem_ops;
|
||||
static const struct address_space_operations shmem_aops;
|
||||
static const struct file_operations shmem_file_operations;
|
||||
static struct inode_operations shmem_inode_operations;
|
||||
static struct inode_operations shmem_dir_inode_operations;
|
||||
static struct inode_operations shmem_special_inode_operations;
|
||||
static const struct inode_operations shmem_inode_operations;
|
||||
static const struct inode_operations shmem_dir_inode_operations;
|
||||
static const struct inode_operations shmem_special_inode_operations;
|
||||
static struct vm_operations_struct shmem_vm_ops;
|
||||
|
||||
static struct backing_dev_info shmem_backing_dev_info __read_mostly = {
|
||||
@ -1410,8 +1410,8 @@ shmem_get_inode(struct super_block *sb, int mode, dev_t dev)
|
||||
}
|
||||
|
||||
#ifdef CONFIG_TMPFS
|
||||
static struct inode_operations shmem_symlink_inode_operations;
|
||||
static struct inode_operations shmem_symlink_inline_operations;
|
||||
static const struct inode_operations shmem_symlink_inode_operations;
|
||||
static const struct inode_operations shmem_symlink_inline_operations;
|
||||
|
||||
/*
|
||||
* Normally tmpfs makes no use of shmem_prepare_write, but it
|
||||
@ -1904,12 +1904,12 @@ static void shmem_put_link(struct dentry *dentry, struct nameidata *nd, void *co
|
||||
}
|
||||
}
|
||||
|
||||
static struct inode_operations shmem_symlink_inline_operations = {
|
||||
static const struct inode_operations shmem_symlink_inline_operations = {
|
||||
.readlink = generic_readlink,
|
||||
.follow_link = shmem_follow_link_inline,
|
||||
};
|
||||
|
||||
static struct inode_operations shmem_symlink_inode_operations = {
|
||||
static const struct inode_operations shmem_symlink_inode_operations = {
|
||||
.truncate = shmem_truncate,
|
||||
.readlink = generic_readlink,
|
||||
.follow_link = shmem_follow_link,
|
||||
@ -2335,7 +2335,7 @@ static const struct file_operations shmem_file_operations = {
|
||||
#endif
|
||||
};
|
||||
|
||||
static struct inode_operations shmem_inode_operations = {
|
||||
static const struct inode_operations shmem_inode_operations = {
|
||||
.truncate = shmem_truncate,
|
||||
.setattr = shmem_notify_change,
|
||||
.truncate_range = shmem_truncate_range,
|
||||
@ -2349,7 +2349,7 @@ static struct inode_operations shmem_inode_operations = {
|
||||
|
||||
};
|
||||
|
||||
static struct inode_operations shmem_dir_inode_operations = {
|
||||
static const struct inode_operations shmem_dir_inode_operations = {
|
||||
#ifdef CONFIG_TMPFS
|
||||
.create = shmem_create,
|
||||
.lookup = simple_lookup,
|
||||
@ -2371,7 +2371,7 @@ static struct inode_operations shmem_dir_inode_operations = {
|
||||
#endif
|
||||
};
|
||||
|
||||
static struct inode_operations shmem_special_inode_operations = {
|
||||
static const struct inode_operations shmem_special_inode_operations = {
|
||||
#ifdef CONFIG_TMPFS_POSIX_ACL
|
||||
.setattr = shmem_notify_change,
|
||||
.setxattr = generic_setxattr,
|
||||
|
Loading…
Reference in New Issue
Block a user