fs: constify tree_descr arrays passed to simple_fill_super()
simple_fill_super() is passed an array of tree_descr structures which describe the files to create in the filesystem's root directory. Since these arrays are never modified intentionally, they should be 'const' so that they are placed in .rodata and benefit from memory protection. This patch updates the function signature and all users, and also constifies tree_descr.name. Signed-off-by: Eric Biggers <ebiggers@google.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
@@ -2995,9 +2995,10 @@ extern const struct file_operations simple_dir_operations;
|
||||
extern const struct inode_operations simple_dir_inode_operations;
|
||||
extern void make_empty_dir_inode(struct inode *inode);
|
||||
extern bool is_empty_dir_inode(struct inode *inode);
|
||||
struct tree_descr { char *name; const struct file_operations *ops; int mode; };
|
||||
struct tree_descr { const char *name; const struct file_operations *ops; int mode; };
|
||||
struct dentry *d_alloc_name(struct dentry *, const char *);
|
||||
extern int simple_fill_super(struct super_block *, unsigned long, struct tree_descr *);
|
||||
extern int simple_fill_super(struct super_block *, unsigned long,
|
||||
const struct tree_descr *);
|
||||
extern int simple_pin_fs(struct file_system_type *, struct vfsmount **mount, int *count);
|
||||
extern void simple_release_fs(struct vfsmount **mount, int *count);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user