Commit 8c5008fa authored by Joe Thornber's avatar Joe Thornber Committed by Alasdair G Kergon

dm cache: replace memcpy with struct assignment

Use struct assignment rather than memcpy in dm cache.
Signed-off-by: default avatarJoe Thornber <ejt@redhat.com>
Signed-off-by: default avatarAlasdair G Kergon <agk@redhat.com>
parent aeed1420
...@@ -1044,7 +1044,7 @@ void dm_cache_metadata_get_stats(struct dm_cache_metadata *cmd, ...@@ -1044,7 +1044,7 @@ void dm_cache_metadata_get_stats(struct dm_cache_metadata *cmd,
struct dm_cache_statistics *stats) struct dm_cache_statistics *stats)
{ {
down_read(&cmd->root_lock); down_read(&cmd->root_lock);
memcpy(stats, &cmd->stats, sizeof(*stats)); *stats = cmd->stats;
up_read(&cmd->root_lock); up_read(&cmd->root_lock);
} }
...@@ -1052,7 +1052,7 @@ void dm_cache_metadata_set_stats(struct dm_cache_metadata *cmd, ...@@ -1052,7 +1052,7 @@ void dm_cache_metadata_set_stats(struct dm_cache_metadata *cmd,
struct dm_cache_statistics *stats) struct dm_cache_statistics *stats)
{ {
down_write(&cmd->root_lock); down_write(&cmd->root_lock);
memcpy(&cmd->stats, stats, sizeof(*stats)); cmd->stats = *stats;
up_write(&cmd->root_lock); up_write(&cmd->root_lock);
} }
......
...@@ -1913,7 +1913,7 @@ static int cache_create(struct cache_args *ca, struct cache **result) ...@@ -1913,7 +1913,7 @@ static int cache_create(struct cache_args *ca, struct cache **result)
ti->discards_supported = true; ti->discards_supported = true;
ti->discard_zeroes_data_unsupported = true; ti->discard_zeroes_data_unsupported = true;
memcpy(&cache->features, &ca->features, sizeof(cache->features)); cache->features = ca->features;
ti->per_bio_data_size = get_per_bio_data_size(cache); ti->per_bio_data_size = get_per_bio_data_size(cache);
cache->callbacks.congested_fn = cache_is_congested; cache->callbacks.congested_fn = cache_is_congested;
......
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