Commit b79af13e authored by Bhumika Goyal's avatar Bhumika Goyal Committed by Mike Snitzer

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: default avatarBhumika Goyal <bhumirks@gmail.com>
Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
parent 7f1b2159
...@@ -544,7 +544,7 @@ static int sm_metadata_copy_root(struct dm_space_map *sm, void *where_le, size_t ...@@ -544,7 +544,7 @@ static int sm_metadata_copy_root(struct dm_space_map *sm, void *where_le, size_t
static int sm_metadata_extend(struct dm_space_map *sm, dm_block_t extra_blocks); static int sm_metadata_extend(struct dm_space_map *sm, dm_block_t extra_blocks);
static struct dm_space_map ops = { static const struct dm_space_map ops = {
.destroy = sm_metadata_destroy, .destroy = sm_metadata_destroy,
.extend = sm_metadata_extend, .extend = sm_metadata_extend,
.get_nr_blocks = sm_metadata_get_nr_blocks, .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,7 +671,7 @@ static int sm_bootstrap_copy_root(struct dm_space_map *sm, void *where,
return -EINVAL; return -EINVAL;
} }
static struct dm_space_map bootstrap_ops = { static const struct dm_space_map bootstrap_ops = {
.destroy = sm_bootstrap_destroy, .destroy = sm_bootstrap_destroy,
.extend = sm_bootstrap_extend, .extend = sm_bootstrap_extend,
.get_nr_blocks = sm_bootstrap_get_nr_blocks, .get_nr_blocks = sm_bootstrap_get_nr_blocks,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment