aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Biggers2017-03-25 23:15:37 -0500
committerAl Viro2017-04-26 22:54:06 -0500
commitcda37124f4e95ad5ccb11394a5802b0972668b32 (patch)
treea4c51e172c57885b2edf4f74c797aa4918097d76 /include
parenta0c111b49bbe11c3970bc668600e3b61fbbb7fca (diff)
downloadkernel-cda37124f4e95ad5ccb11394a5802b0972668b32.tar.gz
kernel-cda37124f4e95ad5ccb11394a5802b0972668b32.tar.xz
kernel-cda37124f4e95ad5ccb11394a5802b0972668b32.zip
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>
Diffstat (limited to 'include')
-rw-r--r--include/linux/fs.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h
index dee12c171e07..fc1b4faa6272 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -2995,9 +2995,10 @@ extern const struct file_operations simple_dir_operations;
2995extern const struct inode_operations simple_dir_inode_operations; 2995extern const struct inode_operations simple_dir_inode_operations;
2996extern void make_empty_dir_inode(struct inode *inode); 2996extern void make_empty_dir_inode(struct inode *inode);
2997extern bool is_empty_dir_inode(struct inode *inode); 2997extern bool is_empty_dir_inode(struct inode *inode);
2998struct tree_descr { char *name; const struct file_operations *ops; int mode; }; 2998struct tree_descr { const char *name; const struct file_operations *ops; int mode; };
2999struct dentry *d_alloc_name(struct dentry *, const char *); 2999struct dentry *d_alloc_name(struct dentry *, const char *);
3000extern int simple_fill_super(struct super_block *, unsigned long, struct tree_descr *); 3000extern int simple_fill_super(struct super_block *, unsigned long,
3001 const struct tree_descr *);
3001extern int simple_pin_fs(struct file_system_type *, struct vfsmount **mount, int *count); 3002extern int simple_pin_fs(struct file_system_type *, struct vfsmount **mount, int *count);
3002extern void simple_release_fs(struct vfsmount **mount, int *count); 3003extern void simple_release_fs(struct vfsmount **mount, int *count);
3003 3004