diff --git a/src/common/bad_blocks.c b/src/common/bad_blocks.c index a9c0c4d720b..f44ec4848e3 100644 --- a/src/common/bad_blocks.c +++ b/src/common/bad_blocks.c @@ -72,7 +72,7 @@ badblocks_get(const char *file, struct badblocks *bbs) goto exit_delete_source; bb_found = 0; - while ((pmem2_badblock_next_internal(bbctx, &bb)) == 0) { + while ((pmem2_badblock_next(bbctx, &bb)) == 0) { bb_found++; /* * Form a new bad block structure with offset and length @@ -210,7 +210,7 @@ badblocks_clear_all(const char *file) goto exit_delete_source; } - while ((pmem2_badblock_next_internal(bbctx, &bb)) == 0) { + while ((pmem2_badblock_next(bbctx, &bb)) == 0) { ret = pmem2_badblock_clear(bbctx, &bb); if (ret) { CORE_LOG_ERROR("pmem2_badblock_clear -- %s", file); diff --git a/src/common/badblocks.h b/src/common/badblocks.h index 18ebd8493af..d06e81adb28 100644 --- a/src/common/badblocks.h +++ b/src/common/badblocks.h @@ -11,7 +11,6 @@ #include #include #include -#include "libpmem2.h" #ifdef __cplusplus extern "C" { @@ -71,9 +70,6 @@ int badblocks_clear_all(const char *file); int badblocks_check_file(const char *path); -int pmem2_badblock_next_internal(struct pmem2_badblock_context *bbctx, - struct pmem2_badblock *bb); - #ifdef __cplusplus } #endif diff --git a/src/common/set_badblocks.c b/src/common/set_badblocks.c index 542c40a765b..f39ac85966f 100644 --- a/src/common/set_badblocks.c +++ b/src/common/set_badblocks.c @@ -14,7 +14,6 @@ #include "os.h" #include "out.h" #include "set_badblocks.h" -#include "libpmem2.h" #include "badblocks.h" /* helper structure for badblocks_check_file_cb() */ diff --git a/src/libpmem2/badblocks.c b/src/libpmem2/badblocks.c index af21869c352..c702d4f65cd 100644 --- a/src/libpmem2/badblocks.c +++ b/src/libpmem2/badblocks.c @@ -5,7 +5,6 @@ * badblocks.c -- implementation of common bad blocks API */ -#include "libpmem2.h" #include "badblocks.h" #include "alloc.h" #include "out.h" diff --git a/src/libpmem2/badblocks_ndctl.c b/src/libpmem2/badblocks_ndctl.c index 16c352c23dd..35a914e9566 100644 --- a/src/libpmem2/badblocks_ndctl.c +++ b/src/libpmem2/badblocks_ndctl.c @@ -528,10 +528,10 @@ pmem2_badblock_next_region(struct pmem2_badblock_context *bbctx, } /* - * pmem2_badblock_next_internal -- get the next bad block + * pmem2_badblock_next -- get the next bad block */ int -pmem2_badblock_next_internal(struct pmem2_badblock_context *bbctx, +pmem2_badblock_next(struct pmem2_badblock_context *bbctx, struct pmem2_badblock *bb) { LOG(3, "bbctx %p bb %p", bbctx, bb); @@ -674,19 +674,6 @@ pmem2_badblock_next_internal(struct pmem2_badblock_context *bbctx, return 0; } -int -pmem2_badblock_next(struct pmem2_badblock_context *bbctx, - struct pmem2_badblock *bb) -{ - int ret = pmem2_badblock_next_internal(bbctx, bb); - - if (ret == PMEM2_E_NO_BAD_BLOCK_FOUND) { - ERR_WO_ERRNO( - "Cannot find any matching device, no bad blocks found"); - } - return ret; -} - /* * pmem2_badblock_clear_fsdax -- (internal) clear one bad block * in a FSDAX device