]> git.karo-electronics.de Git - linux-beck.git/commitdiff
quota: constify qtree_fmt_operations structures
authorJulia Lawall <Julia.Lawall@lip6.fr>
Fri, 1 Jan 2016 07:53:37 +0000 (08:53 +0100)
committerJan Kara <jack@suse.cz>
Mon, 4 Jan 2016 09:58:35 +0000 (10:58 +0100)
The qtree_fmt_operations 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: Jan Kara <jack@suse.cz>
fs/ocfs2/quota.h
fs/ocfs2/quota_global.c
fs/quota/quota_v2.c
include/linux/dqblk_qtree.h

index b6d51333ad026d09d167269a1bbaac836291deda..d153e6e31529a5fce986d382bb699a5d2c27e9b7 100644 (file)
@@ -82,7 +82,7 @@ struct ocfs2_quota_chunk {
 extern struct kmem_cache *ocfs2_dquot_cachep;
 extern struct kmem_cache *ocfs2_qf_chunk_cachep;
 
-extern struct qtree_fmt_operations ocfs2_global_ops;
+extern const struct qtree_fmt_operations ocfs2_global_ops;
 
 struct ocfs2_quota_recovery *ocfs2_begin_quota_recovery(
                                struct ocfs2_super *osb, int slot_num);
index c93d6722088753901c258151de82dc707e6eb71e..fde9ef18cff3c4ba59d7891ab395bc739fdbf81e 100644 (file)
@@ -123,7 +123,7 @@ static int ocfs2_global_is_id(void *dp, struct dquot *dquot)
                      dquot->dq_id);
 }
 
-struct qtree_fmt_operations ocfs2_global_ops = {
+const struct qtree_fmt_operations ocfs2_global_ops = {
        .mem2disk_dqblk = ocfs2_global_mem2diskdqb,
        .disk2mem_dqblk = ocfs2_global_disk2memdqb,
        .is_id = ocfs2_global_is_id,
index 2aa012a68e90e524255fb47e983d121cf9c839b4..ed85d4f35c04b40aab3754ad42e483c4de3a1f1e 100644 (file)
@@ -30,13 +30,13 @@ static void v2r1_mem2diskdqb(void *dp, struct dquot *dquot);
 static void v2r1_disk2memdqb(struct dquot *dquot, void *dp);
 static int v2r1_is_id(void *dp, struct dquot *dquot);
 
-static struct qtree_fmt_operations v2r0_qtree_ops = {
+static const struct qtree_fmt_operations v2r0_qtree_ops = {
        .mem2disk_dqblk = v2r0_mem2diskdqb,
        .disk2mem_dqblk = v2r0_disk2memdqb,
        .is_id = v2r0_is_id,
 };
 
-static struct qtree_fmt_operations v2r1_qtree_ops = {
+static const struct qtree_fmt_operations v2r1_qtree_ops = {
        .mem2disk_dqblk = v2r1_mem2diskdqb,
        .disk2mem_dqblk = v2r1_disk2memdqb,
        .is_id = v2r1_is_id,
index 82a16527b367a26c1fbcf199da8a418540ee1847..ff8b55359648c9cbb91d91cf2c123a5911b806b9 100644 (file)
@@ -34,7 +34,7 @@ struct qtree_mem_dqinfo {
        unsigned int dqi_entry_size;    /* Size of quota entry in quota file */
        unsigned int dqi_usable_bs;     /* Space usable in block for quota data */
        unsigned int dqi_qtree_depth;   /* Precomputed depth of quota tree */
-       struct qtree_fmt_operations *dqi_ops;   /* Operations for entry manipulation */
+       const struct qtree_fmt_operations *dqi_ops; /* Operations for entry manipulation */
 };
 
 int qtree_write_dquot(struct qtree_mem_dqinfo *info, struct dquot *dquot);