From adea19101ddbdf180e2fb7e2ac05ce8d022b04c7 Mon Sep 17 00:00:00 2001 From: Christopher Haster Date: Thu, 16 Jan 2025 14:42:59 -0600 Subject: [PATCH] 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. --- bd/lfs_emubd.c | 12 ++++++------ bd/lfs_emubd.h | 2 +- runners/test_runner.c | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/bd/lfs_emubd.c b/bd/lfs_emubd.c index a300a5c3..ae29d4db 100644 --- a/bd/lfs_emubd.c +++ b/bd/lfs_emubd.c @@ -1340,15 +1340,15 @@ int lfs_emubd_setpowercycles(const struct lfs_config *cfg, return 0; } -int lfs_emubd_copy(const struct lfs_config *cfg, lfs_emubd_t *copy) { - LFS_EMUBD_TRACE("lfs_emubd_copy(%p, %p)", (void*)cfg, (void*)copy); +int lfs_emubd_cpy(const struct lfs_config *cfg, lfs_emubd_t *copy) { + LFS_EMUBD_TRACE("lfs_emubd_cpy(%p, %p)", (void*)cfg, (void*)copy); lfs_emubd_t *bd = cfg->context; // lazily copy over our block array copy->blocks = malloc( cfg->block_count * sizeof(lfs_emubd_block_t*)); 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; } 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( cfg->block_count * sizeof(lfs_emubd_block_t*)); 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; } 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( cfg->block_count * sizeof(lfs_emubd_block_t*)); 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; } 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; - LFS_EMUBD_TRACE("lfs_emubd_copy -> %d", 0); + LFS_EMUBD_TRACE("lfs_emubd_cpy -> %d", 0); return 0; } diff --git a/bd/lfs_emubd.h b/bd/lfs_emubd.h index 42e1989a..893ddaa4 100644 --- a/bd/lfs_emubd.h +++ b/bd/lfs_emubd.h @@ -261,7 +261,7 @@ int lfs_emubd_setpowercycles(const struct lfs_config *cfg, lfs_emubd_powercycles_t power_cycles); // 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 diff --git a/runners/test_runner.c b/runners/test_runner.c index 968914bd..f5752860 100644 --- a/runners/test_runner.c +++ b/runners/test_runner.c @@ -1609,7 +1609,7 @@ static void powerloss_exhaustive_branch(void *c) { } // create copy-on-write copy - int err = lfs_emubd_copy(state->cfg, branch); + int err = lfs_emubd_cpy(state->cfg, branch); if (err) { fprintf(stderr, "error: exhaustive: could not create bd copy\n"); exit(-1);