Skip to content

Commit b79af13

Browse files
goyalbhumikasnitm
authored andcommitted
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>
1 parent 7f1b215 commit b79af13

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎drivers/md/persistent-data/dm-space-map-metadata.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,7 @@ static int sm_metadata_copy_root(struct dm_space_map *sm, void *where_le, size_t
544544

545545
static int sm_metadata_extend(struct dm_space_map *sm, dm_block_t extra_blocks);
546546

547-
static struct dm_space_map ops = {
547+
static const struct dm_space_map ops = {
548548
.destroy = sm_metadata_destroy,
549549
.extend = sm_metadata_extend,
550550
.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,
671671
return -EINVAL;
672672
}
673673

674-
static struct dm_space_map bootstrap_ops = {
674+
static const struct dm_space_map bootstrap_ops = {
675675
.destroy = sm_bootstrap_destroy,
676676
.extend = sm_bootstrap_extend,
677677
.get_nr_blocks = sm_bootstrap_get_nr_blocks,

0 commit comments

Comments
 (0)