lustre: constify inode_operations structures
authorJulia Lawall <Julia.Lawall@lip6.fr>
Sat, 14 Nov 2015 12:30:34 +0000 (13:30 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 21 Dec 2015 23:40:18 +0000 (15:40 -0800)
The inode_operations structures are never modified, so declare them
as const, like all the other inode_operations structures.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lustre/llite/file.c
drivers/staging/lustre/lustre/llite/llite_internal.h
drivers/staging/lustre/lustre/llite/symlink.c

index baffd5281af3513a7479a189601a960566a541f3..c92d58b770ec2bbd3b56c0600a0c2a6aeb8b015e 100644 (file)
@@ -3139,7 +3139,7 @@ struct file_operations ll_file_operations_noflock = {
        .lock      = ll_file_noflock
 };
 
-struct inode_operations ll_file_inode_operations = {
+const struct inode_operations ll_file_inode_operations = {
        .setattr        = ll_setattr,
        .getattr        = ll_getattr,
        .permission     = ll_inode_permission,
index eb8d6a7520fd7ae3f866685ce5b567e866b05f08..ee8a1d67d19119ee034ed5ffa7d64829042aa20d 100644 (file)
@@ -705,7 +705,7 @@ extern const struct address_space_operations ll_aops;
 extern struct file_operations ll_file_operations;
 extern struct file_operations ll_file_operations_flock;
 extern struct file_operations ll_file_operations_noflock;
-extern struct inode_operations ll_file_inode_operations;
+extern const struct inode_operations ll_file_inode_operations;
 int ll_have_md_lock(struct inode *inode, __u64 *bits,
                    ldlm_mode_t l_req_mode);
 ldlm_mode_t ll_take_md_lock(struct inode *inode, __u64 bits,
@@ -805,7 +805,7 @@ struct inode *search_inode_for_lustre(struct super_block *sb,
                                      const struct lu_fid *fid);
 
 /* llite/symlink.c */
-extern struct inode_operations ll_fast_symlink_inode_operations;
+extern const struct inode_operations ll_fast_symlink_inode_operations;
 
 /* llite/llite_close.c */
 struct ll_close_queue {
index 69b203651905e93f77149754a5b9d6a021b6bf32..32c4cf48b318398cbd58fa32c48e309877a8661f 100644 (file)
@@ -146,7 +146,7 @@ static void ll_put_link(struct inode *unused, void *cookie)
        ptlrpc_req_finished(cookie);
 }
 
-struct inode_operations ll_fast_symlink_inode_operations = {
+const struct inode_operations ll_fast_symlink_inode_operations = {
        .readlink       = generic_readlink,
        .setattr        = ll_setattr,
        .follow_link    = ll_follow_link,