emubd: Renamed lfs_emubd_copy -> lfs_emubd_cpy

For consistency with strcpy/memcpy/lfsr_bd_cpy, though I realize this is
a bit of a weak argument.
This commit is contained in:
Christopher Haster
2025-01-16 14:42:59 -06:00
parent 66f5fa152a
commit adea19101d
3 changed files with 8 additions and 8 deletions
+6 -6
View File
@@ -1340,15 +1340,15 @@ int lfs_emubd_setpowercycles(const struct lfs_config *cfg,
return 0; return 0;
} }
int lfs_emubd_copy(const struct lfs_config *cfg, lfs_emubd_t *copy) { int lfs_emubd_cpy(const struct lfs_config *cfg, lfs_emubd_t *copy) {
LFS_EMUBD_TRACE("lfs_emubd_copy(%p, %p)", (void*)cfg, (void*)copy); LFS_EMUBD_TRACE("lfs_emubd_cpy(%p, %p)", (void*)cfg, (void*)copy);
lfs_emubd_t *bd = cfg->context; lfs_emubd_t *bd = cfg->context;
// lazily copy over our block array // lazily copy over our block array
copy->blocks = malloc( copy->blocks = malloc(
cfg->block_count * sizeof(lfs_emubd_block_t*)); cfg->block_count * sizeof(lfs_emubd_block_t*));
if (!copy->blocks) { if (!copy->blocks) {
LFS_EMUBD_TRACE("lfs_emubd_copy -> %d", LFS_ERR_NOMEM); LFS_EMUBD_TRACE("lfs_emubd_cpy -> %d", LFS_ERR_NOMEM);
return LFS_ERR_NOMEM; return LFS_ERR_NOMEM;
} }
for (lfs_block_t i = 0; i < cfg->block_count; i++) { for (lfs_block_t i = 0; i < cfg->block_count; i++) {
@@ -1359,7 +1359,7 @@ int lfs_emubd_copy(const struct lfs_config *cfg, lfs_emubd_t *copy) {
copy->ooo_before = malloc( copy->ooo_before = malloc(
cfg->block_count * sizeof(lfs_emubd_block_t*)); cfg->block_count * sizeof(lfs_emubd_block_t*));
if (!copy->ooo_before) { if (!copy->ooo_before) {
LFS_EMUBD_TRACE("lfs_emubd_copy -> %d", LFS_ERR_NOMEM); LFS_EMUBD_TRACE("lfs_emubd_cpy -> %d", LFS_ERR_NOMEM);
return LFS_ERR_NOMEM; return LFS_ERR_NOMEM;
} }
for (lfs_block_t i = 0; i < cfg->block_count; i++) { for (lfs_block_t i = 0; i < cfg->block_count; i++) {
@@ -1369,7 +1369,7 @@ int lfs_emubd_copy(const struct lfs_config *cfg, lfs_emubd_t *copy) {
copy->ooo_after = malloc( copy->ooo_after = malloc(
cfg->block_count * sizeof(lfs_emubd_block_t*)); cfg->block_count * sizeof(lfs_emubd_block_t*));
if (!copy->ooo_after) { if (!copy->ooo_after) {
LFS_EMUBD_TRACE("lfs_emubd_copy -> %d", LFS_ERR_NOMEM); LFS_EMUBD_TRACE("lfs_emubd_cpy -> %d", LFS_ERR_NOMEM);
return LFS_ERR_NOMEM; return LFS_ERR_NOMEM;
} }
for (lfs_block_t i = 0; i < cfg->block_count; i++) { for (lfs_block_t i = 0; i < cfg->block_count; i++) {
@@ -1389,7 +1389,7 @@ int lfs_emubd_copy(const struct lfs_config *cfg, lfs_emubd_t *copy) {
} }
copy->cfg = bd->cfg; copy->cfg = bd->cfg;
LFS_EMUBD_TRACE("lfs_emubd_copy -> %d", 0); LFS_EMUBD_TRACE("lfs_emubd_cpy -> %d", 0);
return 0; return 0;
} }
+1 -1
View File
@@ -261,7 +261,7 @@ int lfs_emubd_setpowercycles(const struct lfs_config *cfg,
lfs_emubd_powercycles_t power_cycles); lfs_emubd_powercycles_t power_cycles);
// Create a copy-on-write copy of the state of this block device // Create a copy-on-write copy of the state of this block device
int lfs_emubd_copy(const struct lfs_config *cfg, lfs_emubd_t *copy); int lfs_emubd_cpy(const struct lfs_config *cfg, lfs_emubd_t *copy);
#ifdef __cplusplus #ifdef __cplusplus
+1 -1
View File
@@ -1609,7 +1609,7 @@ static void powerloss_exhaustive_branch(void *c) {
} }
// create copy-on-write copy // create copy-on-write copy
int err = lfs_emubd_copy(state->cfg, branch); int err = lfs_emubd_cpy(state->cfg, branch);
if (err) { if (err) {
fprintf(stderr, "error: exhaustive: could not create bd copy\n"); fprintf(stderr, "error: exhaustive: could not create bd copy\n");
exit(-1); exit(-1);