struct dm_dev dd_copy;
dev_t dev = dd->bdev->bd_dev;
- memcpy(&dd_copy, dd, sizeof(dd_copy));
+ dd_copy = *dd;
dd->mode |= new_mode;
dd->bdev = NULL;
if (!r)
close_dev(&dd_copy);
else
- memcpy(dd, &dd_copy, sizeof(dd_copy));
+ *dd = dd_copy;
return r;
}