aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/persistent-data
diff options
context:
space:
mode:
authorBhumika Goyal <bhumirks@gmail.com>2017-02-15 13:13:28 -0500
committerMike Snitzer <snitzer@redhat.com>2017-02-16 14:14:36 -0500
commitb79af13efd98ca2908f2df1120e79a7ff70faa0d (patch)
treed1f3359b0158aac5d5a886b01a52774f54f35bd2 /drivers/md/persistent-data
parent7f1b21591a632c6caefd9aa53b630808f4f477e1 (diff)
dm space map metadata: constify dm_space_map structures
Declare dm_space_map structures as const as they are only passed as an argument to the function memcpy. This argument is of type const void *, so dm_space_map structures having this property can be declared as const. File size before: text data bss dec hex filename 4889 240 0 5129 1409 dm-space-map-metadata.o File size after: text data bss dec hex filename 5139 0 0 5139 1413 dm-space-map-metadata.o Signed-off-by: Bhumika Goyal <bhumirks@gmail.com> Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Diffstat (limited to 'drivers/md/persistent-data')
-rw-r--r--drivers/md/persistent-data/dm-space-map-metadata.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/md/persistent-data/dm-space-map-metadata.c b/drivers/md/persistent-data/dm-space-map-metadata.c
index 20557e2c60c6..4aed69d9dd17 100644
--- a/drivers/md/persistent-data/dm-space-map-metadata.c
+++ b/drivers/md/persistent-data/dm-space-map-metadata.c
@@ -544,7 +544,7 @@ static int sm_metadata_copy_root(struct dm_space_map *sm, void *where_le, size_t
544 544
545static int sm_metadata_extend(struct dm_space_map *sm, dm_block_t extra_blocks); 545static int sm_metadata_extend(struct dm_space_map *sm, dm_block_t extra_blocks);
546 546
547static struct dm_space_map ops = { 547static const struct dm_space_map ops = {
548 .destroy = sm_metadata_destroy, 548 .destroy = sm_metadata_destroy,
549 .extend = sm_metadata_extend, 549 .extend = sm_metadata_extend,
550 .get_nr_blocks = sm_metadata_get_nr_blocks, 550 .get_nr_blocks = sm_metadata_get_nr_blocks,
@@ -671,7 +671,7 @@ static int sm_bootstrap_copy_root(struct dm_space_map *sm, void *where,
671 return -EINVAL; 671 return -EINVAL;
672} 672}
673 673
674static struct dm_space_map bootstrap_ops = { 674static const struct dm_space_map bootstrap_ops = {
675 .destroy = sm_bootstrap_destroy, 675 .destroy = sm_bootstrap_destroy,
676 .extend = sm_bootstrap_extend, 676 .extend = sm_bootstrap_extend,
677 .get_nr_blocks = sm_bootstrap_get_nr_blocks, 677 .get_nr_blocks = sm_bootstrap_get_nr_blocks,