diff options
author | Julia Lawall <Julia.Lawall@lip6.fr> | 2015-11-21 10:15:37 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2015-12-06 21:17:16 -0500 |
commit | 0125f504ed320826a78b43d636de957d703465a8 (patch) | |
tree | 67ec2fce9e0eaa9e8d5bb3c5b8ea8bab349eeab1 | |
parent | b896fb35ca904fe5b7765fcd81a45f09a62e8d03 (diff) |
adfs: constify adfs_dir_ops structures
The adfs_dir_ops structures are never modified, so declare them as const.
Done with the help of Coccinelle.
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r-- | fs/adfs/adfs.h | 6 | ||||
-rw-r--r-- | fs/adfs/dir.c | 6 | ||||
-rw-r--r-- | fs/adfs/dir_f.c | 2 | ||||
-rw-r--r-- | fs/adfs/dir_fplus.c | 2 |
4 files changed, 8 insertions, 8 deletions
diff --git a/fs/adfs/adfs.h b/fs/adfs/adfs.h index 24575d9d882d..ea4aba56f29d 100644 --- a/fs/adfs/adfs.h +++ b/fs/adfs/adfs.h | |||
@@ -45,7 +45,7 @@ struct adfs_dir_ops; | |||
45 | struct adfs_sb_info { | 45 | struct adfs_sb_info { |
46 | union { struct { | 46 | union { struct { |
47 | struct adfs_discmap *s_map; /* bh list containing map */ | 47 | struct adfs_discmap *s_map; /* bh list containing map */ |
48 | struct adfs_dir_ops *s_dir; /* directory operations */ | 48 | const struct adfs_dir_ops *s_dir; /* directory operations */ |
49 | }; | 49 | }; |
50 | struct rcu_head rcu; /* used only at shutdown time */ | 50 | struct rcu_head rcu; /* used only at shutdown time */ |
51 | }; | 51 | }; |
@@ -168,8 +168,8 @@ void __adfs_error(struct super_block *sb, const char *function, | |||
168 | extern const struct inode_operations adfs_dir_inode_operations; | 168 | extern const struct inode_operations adfs_dir_inode_operations; |
169 | extern const struct file_operations adfs_dir_operations; | 169 | extern const struct file_operations adfs_dir_operations; |
170 | extern const struct dentry_operations adfs_dentry_operations; | 170 | extern const struct dentry_operations adfs_dentry_operations; |
171 | extern struct adfs_dir_ops adfs_f_dir_ops; | 171 | extern const struct adfs_dir_ops adfs_f_dir_ops; |
172 | extern struct adfs_dir_ops adfs_fplus_dir_ops; | 172 | extern const struct adfs_dir_ops adfs_fplus_dir_ops; |
173 | 173 | ||
174 | extern int adfs_dir_update(struct super_block *sb, struct object_info *obj, | 174 | extern int adfs_dir_update(struct super_block *sb, struct object_info *obj, |
175 | int wait); | 175 | int wait); |
diff --git a/fs/adfs/dir.c b/fs/adfs/dir.c index 51c279a29845..fd4cf2c48e48 100644 --- a/fs/adfs/dir.c +++ b/fs/adfs/dir.c | |||
@@ -21,7 +21,7 @@ adfs_readdir(struct file *file, struct dir_context *ctx) | |||
21 | { | 21 | { |
22 | struct inode *inode = file_inode(file); | 22 | struct inode *inode = file_inode(file); |
23 | struct super_block *sb = inode->i_sb; | 23 | struct super_block *sb = inode->i_sb; |
24 | struct adfs_dir_ops *ops = ADFS_SB(sb)->s_dir; | 24 | const struct adfs_dir_ops *ops = ADFS_SB(sb)->s_dir; |
25 | struct object_info obj; | 25 | struct object_info obj; |
26 | struct adfs_dir dir; | 26 | struct adfs_dir dir; |
27 | int ret = 0; | 27 | int ret = 0; |
@@ -69,7 +69,7 @@ adfs_dir_update(struct super_block *sb, struct object_info *obj, int wait) | |||
69 | { | 69 | { |
70 | int ret = -EINVAL; | 70 | int ret = -EINVAL; |
71 | #ifdef CONFIG_ADFS_FS_RW | 71 | #ifdef CONFIG_ADFS_FS_RW |
72 | struct adfs_dir_ops *ops = ADFS_SB(sb)->s_dir; | 72 | const struct adfs_dir_ops *ops = ADFS_SB(sb)->s_dir; |
73 | struct adfs_dir dir; | 73 | struct adfs_dir dir; |
74 | 74 | ||
75 | printk(KERN_INFO "adfs_dir_update: object %06X in dir %06X\n", | 75 | printk(KERN_INFO "adfs_dir_update: object %06X in dir %06X\n", |
@@ -129,7 +129,7 @@ static int | |||
129 | adfs_dir_lookup_byname(struct inode *inode, struct qstr *name, struct object_info *obj) | 129 | adfs_dir_lookup_byname(struct inode *inode, struct qstr *name, struct object_info *obj) |
130 | { | 130 | { |
131 | struct super_block *sb = inode->i_sb; | 131 | struct super_block *sb = inode->i_sb; |
132 | struct adfs_dir_ops *ops = ADFS_SB(sb)->s_dir; | 132 | const struct adfs_dir_ops *ops = ADFS_SB(sb)->s_dir; |
133 | struct adfs_dir dir; | 133 | struct adfs_dir dir; |
134 | int ret; | 134 | int ret; |
135 | 135 | ||
diff --git a/fs/adfs/dir_f.c b/fs/adfs/dir_f.c index 4bbe853ee50a..0fbfd0b04ae0 100644 --- a/fs/adfs/dir_f.c +++ b/fs/adfs/dir_f.c | |||
@@ -476,7 +476,7 @@ adfs_f_free(struct adfs_dir *dir) | |||
476 | dir->sb = NULL; | 476 | dir->sb = NULL; |
477 | } | 477 | } |
478 | 478 | ||
479 | struct adfs_dir_ops adfs_f_dir_ops = { | 479 | const struct adfs_dir_ops adfs_f_dir_ops = { |
480 | .read = adfs_f_read, | 480 | .read = adfs_f_read, |
481 | .setpos = adfs_f_setpos, | 481 | .setpos = adfs_f_setpos, |
482 | .getnext = adfs_f_getnext, | 482 | .getnext = adfs_f_getnext, |
diff --git a/fs/adfs/dir_fplus.c b/fs/adfs/dir_fplus.c index 82d14cdf70f9..c92cfb638c18 100644 --- a/fs/adfs/dir_fplus.c +++ b/fs/adfs/dir_fplus.c | |||
@@ -256,7 +256,7 @@ adfs_fplus_free(struct adfs_dir *dir) | |||
256 | dir->sb = NULL; | 256 | dir->sb = NULL; |
257 | } | 257 | } |
258 | 258 | ||
259 | struct adfs_dir_ops adfs_fplus_dir_ops = { | 259 | const struct adfs_dir_ops adfs_fplus_dir_ops = { |
260 | .read = adfs_fplus_read, | 260 | .read = adfs_fplus_read, |
261 | .setpos = adfs_fplus_setpos, | 261 | .setpos = adfs_fplus_setpos, |
262 | .getnext = adfs_fplus_getnext, | 262 | .getnext = adfs_fplus_getnext, |