From: Joe Thornber Date: Fri, 10 May 2013 13:37:18 +0000 (+0100) Subject: dm cache: replace memcpy with struct assignment X-Git-Tag: MMI-PSA29.97-13-9~14415^2~9 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=8c5008fac4af85c7a597c4e7f2c328ac90652bc2;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git dm cache: replace memcpy with struct assignment Use struct assignment rather than memcpy in dm cache. Signed-off-by: Joe Thornber Signed-off-by: Alasdair G Kergon --- diff --git a/drivers/md/dm-cache-metadata.c b/drivers/md/dm-cache-metadata.c index 83e995fece88..1af7255bbffb 100644 --- a/drivers/md/dm-cache-metadata.c +++ b/drivers/md/dm-cache-metadata.c @@ -1044,7 +1044,7 @@ void dm_cache_metadata_get_stats(struct dm_cache_metadata *cmd, struct dm_cache_statistics *stats) { down_read(&cmd->root_lock); - memcpy(stats, &cmd->stats, sizeof(*stats)); + *stats = cmd->stats; up_read(&cmd->root_lock); } @@ -1052,7 +1052,7 @@ void dm_cache_metadata_set_stats(struct dm_cache_metadata *cmd, struct dm_cache_statistics *stats) { down_write(&cmd->root_lock); - memcpy(&cmd->stats, stats, sizeof(*stats)); + cmd->stats = *stats; up_write(&cmd->root_lock); } diff --git a/drivers/md/dm-cache-target.c b/drivers/md/dm-cache-target.c index 004d7053a5b1..2f3348c76267 100644 --- a/drivers/md/dm-cache-target.c +++ b/drivers/md/dm-cache-target.c @@ -1913,7 +1913,7 @@ static int cache_create(struct cache_args *ca, struct cache **result) ti->discards_supported = 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); cache->callbacks.congested_fn = cache_is_congested;