]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
adfs: constify adfs_dir_ops structures
authorJulia Lawall <Julia.Lawall@lip6.fr>
Sat, 21 Nov 2015 15:15:37 +0000 (16:15 +0100)
committerAl Viro <viro@zeniv.linux.org.uk>
Mon, 7 Dec 2015 02:17:16 +0000 (21:17 -0500)
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>
fs/adfs/adfs.h
fs/adfs/dir.c
fs/adfs/dir_f.c
fs/adfs/dir_fplus.c

index 24575d9d882d99e790f97d351ddfac369c616603..ea4aba56f29d69dc26192a2b76e14e1d03747e2d 100644 (file)
@@ -45,7 +45,7 @@ struct adfs_dir_ops;
 struct adfs_sb_info {
        union { struct {
                struct adfs_discmap *s_map;     /* bh list containing map        */
-               struct adfs_dir_ops *s_dir;     /* directory operations          */
+               const struct adfs_dir_ops *s_dir; /* directory operations        */
                };
                struct rcu_head rcu;            /* used only at shutdown time    */
        };
@@ -168,8 +168,8 @@ void __adfs_error(struct super_block *sb, const char *function,
 extern const struct inode_operations adfs_dir_inode_operations;
 extern const struct file_operations adfs_dir_operations;
 extern const struct dentry_operations adfs_dentry_operations;
-extern struct adfs_dir_ops adfs_f_dir_ops;
-extern struct adfs_dir_ops adfs_fplus_dir_ops;
+extern const struct adfs_dir_ops adfs_f_dir_ops;
+extern const struct adfs_dir_ops adfs_fplus_dir_ops;
 
 extern int adfs_dir_update(struct super_block *sb, struct object_info *obj,
                           int wait);
index 51c279a29845e6870125469b18fd06ccdd99f64f..fd4cf2c48e48e3d16b3fc525373a65ecb5cad6cc 100644 (file)
@@ -21,7 +21,7 @@ adfs_readdir(struct file *file, struct dir_context *ctx)
 {
        struct inode *inode = file_inode(file);
        struct super_block *sb = inode->i_sb;
-       struct adfs_dir_ops *ops = ADFS_SB(sb)->s_dir;
+       const struct adfs_dir_ops *ops = ADFS_SB(sb)->s_dir;
        struct object_info obj;
        struct adfs_dir dir;
        int ret = 0;
@@ -69,7 +69,7 @@ adfs_dir_update(struct super_block *sb, struct object_info *obj, int wait)
 {
        int ret = -EINVAL;
 #ifdef CONFIG_ADFS_FS_RW
-       struct adfs_dir_ops *ops = ADFS_SB(sb)->s_dir;
+       const struct adfs_dir_ops *ops = ADFS_SB(sb)->s_dir;
        struct adfs_dir dir;
 
        printk(KERN_INFO "adfs_dir_update: object %06X in dir %06X\n",
@@ -129,7 +129,7 @@ static int
 adfs_dir_lookup_byname(struct inode *inode, struct qstr *name, struct object_info *obj)
 {
        struct super_block *sb = inode->i_sb;
-       struct adfs_dir_ops *ops = ADFS_SB(sb)->s_dir;
+       const struct adfs_dir_ops *ops = ADFS_SB(sb)->s_dir;
        struct adfs_dir dir;
        int ret;
 
index 4bbe853ee50a1ee8931470802a6581139f16257f..0fbfd0b04ae09abca52a420f8d6754ce83f1781e 100644 (file)
@@ -476,7 +476,7 @@ adfs_f_free(struct adfs_dir *dir)
        dir->sb = NULL;
 }
 
-struct adfs_dir_ops adfs_f_dir_ops = {
+const struct adfs_dir_ops adfs_f_dir_ops = {
        .read           = adfs_f_read,
        .setpos         = adfs_f_setpos,
        .getnext        = adfs_f_getnext,
index 82d14cdf70f9d02448944a456cba29a01c785105..c92cfb638c18324a5c2e7af17cafb7b3db6982a7 100644 (file)
@@ -256,7 +256,7 @@ adfs_fplus_free(struct adfs_dir *dir)
        dir->sb = NULL;
 }
 
-struct adfs_dir_ops adfs_fplus_dir_ops = {
+const struct adfs_dir_ops adfs_fplus_dir_ops = {
        .read           = adfs_fplus_read,
        .setpos         = adfs_fplus_setpos,
        .getnext        = adfs_fplus_getnext,