aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulia Lawall <Julia.Lawall@lip6.fr>2016-01-01 02:53:37 -0500
committerJan Kara <jack@suse.cz>2016-01-04 04:58:35 -0500
commitd1b98c23f7547cc37c8f230acbedb26f0d47e9e1 (patch)
tree623c7c98dfcb95e240b59ca21c724263125a295d
parent4f1b1519f7bec44ded3c2c4d46a2594c01446dc8 (diff)
quota: constify qtree_fmt_operations structures
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>
-rw-r--r--fs/ocfs2/quota.h2
-rw-r--r--fs/ocfs2/quota_global.c2
-rw-r--r--fs/quota/quota_v2.c4
-rw-r--r--include/linux/dqblk_qtree.h2
4 files changed, 5 insertions, 5 deletions
diff --git a/fs/ocfs2/quota.h b/fs/ocfs2/quota.h
index b6d51333ad02..d153e6e31529 100644
--- a/fs/ocfs2/quota.h
+++ b/fs/ocfs2/quota.h
@@ -82,7 +82,7 @@ struct ocfs2_quota_chunk {
82extern struct kmem_cache *ocfs2_dquot_cachep; 82extern struct kmem_cache *ocfs2_dquot_cachep;
83extern struct kmem_cache *ocfs2_qf_chunk_cachep; 83extern struct kmem_cache *ocfs2_qf_chunk_cachep;
84 84
85extern struct qtree_fmt_operations ocfs2_global_ops; 85extern const struct qtree_fmt_operations ocfs2_global_ops;
86 86
87struct ocfs2_quota_recovery *ocfs2_begin_quota_recovery( 87struct ocfs2_quota_recovery *ocfs2_begin_quota_recovery(
88 struct ocfs2_super *osb, int slot_num); 88 struct ocfs2_super *osb, int slot_num);
diff --git a/fs/ocfs2/quota_global.c b/fs/ocfs2/quota_global.c
index c93d67220887..fde9ef18cff3 100644
--- a/fs/ocfs2/quota_global.c
+++ b/fs/ocfs2/quota_global.c
@@ -123,7 +123,7 @@ static int ocfs2_global_is_id(void *dp, struct dquot *dquot)
123 dquot->dq_id); 123 dquot->dq_id);
124} 124}
125 125
126struct qtree_fmt_operations ocfs2_global_ops = { 126const struct qtree_fmt_operations ocfs2_global_ops = {
127 .mem2disk_dqblk = ocfs2_global_mem2diskdqb, 127 .mem2disk_dqblk = ocfs2_global_mem2diskdqb,
128 .disk2mem_dqblk = ocfs2_global_disk2memdqb, 128 .disk2mem_dqblk = ocfs2_global_disk2memdqb,
129 .is_id = ocfs2_global_is_id, 129 .is_id = ocfs2_global_is_id,
diff --git a/fs/quota/quota_v2.c b/fs/quota/quota_v2.c
index 2aa012a68e90..ed85d4f35c04 100644
--- a/fs/quota/quota_v2.c
+++ b/fs/quota/quota_v2.c
@@ -30,13 +30,13 @@ static void v2r1_mem2diskdqb(void *dp, struct dquot *dquot);
30static void v2r1_disk2memdqb(struct dquot *dquot, void *dp); 30static void v2r1_disk2memdqb(struct dquot *dquot, void *dp);
31static int v2r1_is_id(void *dp, struct dquot *dquot); 31static int v2r1_is_id(void *dp, struct dquot *dquot);
32 32
33static struct qtree_fmt_operations v2r0_qtree_ops = { 33static const struct qtree_fmt_operations v2r0_qtree_ops = {
34 .mem2disk_dqblk = v2r0_mem2diskdqb, 34 .mem2disk_dqblk = v2r0_mem2diskdqb,
35 .disk2mem_dqblk = v2r0_disk2memdqb, 35 .disk2mem_dqblk = v2r0_disk2memdqb,
36 .is_id = v2r0_is_id, 36 .is_id = v2r0_is_id,
37}; 37};
38 38
39static struct qtree_fmt_operations v2r1_qtree_ops = { 39static const struct qtree_fmt_operations v2r1_qtree_ops = {
40 .mem2disk_dqblk = v2r1_mem2diskdqb, 40 .mem2disk_dqblk = v2r1_mem2diskdqb,
41 .disk2mem_dqblk = v2r1_disk2memdqb, 41 .disk2mem_dqblk = v2r1_disk2memdqb,
42 .is_id = v2r1_is_id, 42 .is_id = v2r1_is_id,
diff --git a/include/linux/dqblk_qtree.h b/include/linux/dqblk_qtree.h
index 82a16527b367..ff8b55359648 100644
--- a/include/linux/dqblk_qtree.h
+++ b/include/linux/dqblk_qtree.h
@@ -34,7 +34,7 @@ struct qtree_mem_dqinfo {
34 unsigned int dqi_entry_size; /* Size of quota entry in quota file */ 34 unsigned int dqi_entry_size; /* Size of quota entry in quota file */
35 unsigned int dqi_usable_bs; /* Space usable in block for quota data */ 35 unsigned int dqi_usable_bs; /* Space usable in block for quota data */
36 unsigned int dqi_qtree_depth; /* Precomputed depth of quota tree */ 36 unsigned int dqi_qtree_depth; /* Precomputed depth of quota tree */
37 struct qtree_fmt_operations *dqi_ops; /* Operations for entry manipulation */ 37 const struct qtree_fmt_operations *dqi_ops; /* Operations for entry manipulation */
38}; 38};
39 39
40int qtree_write_dquot(struct qtree_mem_dqinfo *info, struct dquot *dquot); 40int qtree_write_dquot(struct qtree_mem_dqinfo *info, struct dquot *dquot);