Skip to content

Commit

Permalink
pmem2: rename misleading ndctl_* functions to pmem2_*
Browse files Browse the repository at this point in the history
Change the `ndctl_` prefix to the `pmem2_` prefix to avoid
confusion with libndctl API calls.

Signed-off-by: Tomasz Gromadzki <[email protected]>
  • Loading branch information
grom72 committed Oct 30, 2023
1 parent b336e0e commit 265a449
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 33 deletions.
19 changes: 12 additions & 7 deletions src/libpmem2/region_namespace_ndctl.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: BSD-3-Clause
/* Copyright 2020-2022, Intel Corporation */
/* Copyright 2020-2023, Intel Corporation */

/*
* region_namespace_ndctl.c -- common ndctl functions
Expand All @@ -17,13 +17,18 @@
#include "region_namespace.h"
#include "out.h"

#define FOREACH_BUS_REGION_NAMESPACE(ctx, bus, region, ndns) \
ndctl_bus_foreach(ctx, bus) \
ndctl_region_foreach(bus, region) \
ndctl_namespace_foreach(region, ndns)

/*
* ndctl_match_devdax -- (internal) returns 0 if the devdax matches
* pmem2_devdax_match -- (internal) returns 0 if the devdax matches
* with the given file, 1 if it doesn't match,
* and a negative value in case of an error.
*/
static int
ndctl_match_devdax(dev_t st_rdev, const char *devname)
pmem2_devdax_match(dev_t st_rdev, const char *devname)
{
LOG(3, "st_rdev %lu devname %s", st_rdev, devname);

Expand Down Expand Up @@ -56,12 +61,12 @@ ndctl_match_devdax(dev_t st_rdev, const char *devname)
#define BUFF_LENGTH 64

/*
* ndctl_match_fsdax -- (internal) returns 0 if the device matches
* pmem2_fsdax_match -- (internal) returns 0 if the device matches
* with the given file, 1 if it doesn't match,
* and a negative value in case of an error.
*/
static int
ndctl_match_fsdax(dev_t st_dev, const char *devname)
pmem2_fsdax_match(dev_t st_dev, const char *devname)
{
LOG(3, "st_dev %lu devname %s", st_dev, devname);

Expand Down Expand Up @@ -171,7 +176,7 @@ pmem2_region_namespace(struct ndctl_ctx *ctx,
struct daxctl_dev *dev;
daxctl_dev_foreach(dax_region, dev) {
devname = daxctl_dev_get_devname(dev);
int ret = ndctl_match_devdax(src->value.st_rdev,
int ret = pmem2_devdax_match(src->value.st_rdev,
devname);
if (ret < 0)
return ret;
Expand Down Expand Up @@ -200,7 +205,7 @@ pmem2_region_namespace(struct ndctl_ctx *ctx,
ndctl_namespace_get_block_device(ndns);
}

int ret = ndctl_match_fsdax(src->value.st_dev, devname);
int ret = pmem2_fsdax_match(src->value.st_dev, devname);
if (ret < 0)
return ret;

Expand Down
7 changes: 1 addition & 6 deletions src/libpmem2/region_namespace_ndctl.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* SPDX-License-Identifier: BSD-3-Clause */
/* Copyright 2017-2020, Intel Corporation */
/* Copyright 2017-2023, Intel Corporation */

/*
* region_namespace_ndctl.h -- internal definitions for libpmem2
Expand All @@ -15,11 +15,6 @@
extern "C" {
#endif

#define FOREACH_BUS_REGION_NAMESPACE(ctx, bus, region, ndns) \
ndctl_bus_foreach(ctx, bus) \
ndctl_region_foreach(bus, region) \
ndctl_namespace_foreach(region, ndns)

int pmem2_region_namespace(struct ndctl_ctx *ctx,
const struct pmem2_source *src,
struct ndctl_region **pregion,
Expand Down
20 changes: 10 additions & 10 deletions src/stats/stack-usage-debug.txt
Original file line number Diff line number Diff line change
Expand Up @@ -171,17 +171,17 @@
4352 out_init : src/debug/libpmemobj/out.su:out.c dynamic,bounded
4352 out_init : src/debug/libpmem2/out.su:out.c dynamic,bounded
4352 out_init : src/debug/core/out.su:out.c dynamic,bounded
4320 ndctl_match_fsdax : src/debug/libpmem/region_namespace_ndctl.su:region_namespace_ndctl.c dynamic,bounded
4320 ndctl_match_fsdax : src/debug/libpmempool/region_namespace_ndctl.su:region_namespace_ndctl.c dynamic,bounded
4320 ndctl_match_fsdax : src/debug/libpmemobj/region_namespace_ndctl.su:region_namespace_ndctl.c dynamic,bounded
4320 ndctl_match_fsdax : src/debug/libpmem2/region_namespace_ndctl.su:region_namespace_ndctl.c dynamic,bounded
4320 ndctl_match_fsdax : src/debug/common/region_namespace_ndctl.su:region_namespace_ndctl.c dynamic,bounded
4320 pmem2_fsdax_match : src/debug/libpmem/region_namespace_ndctl.su:region_namespace_ndctl.c dynamic,bounded
4320 pmem2_fsdax_match : src/debug/libpmempool/region_namespace_ndctl.su:region_namespace_ndctl.c dynamic,bounded
4320 pmem2_fsdax_match : src/debug/libpmemobj/region_namespace_ndctl.su:region_namespace_ndctl.c dynamic,bounded
4320 pmem2_fsdax_match : src/debug/libpmem2/region_namespace_ndctl.su:region_namespace_ndctl.c dynamic,bounded
4320 pmem2_fsdax_match : src/debug/common/region_namespace_ndctl.su:region_namespace_ndctl.c dynamic,bounded
4288 pool_set_map : src/debug/libpmempool/pool.su:pool.c dynamic,bounded
4288 ndctl_match_devdax : src/debug/libpmem/region_namespace_ndctl.su:region_namespace_ndctl.c dynamic,bounded
4288 ndctl_match_devdax : src/debug/libpmempool/region_namespace_ndctl.su:region_namespace_ndctl.c dynamic,bounded
4288 ndctl_match_devdax : src/debug/libpmemobj/region_namespace_ndctl.su:region_namespace_ndctl.c dynamic,bounded
4288 ndctl_match_devdax : src/debug/libpmem2/region_namespace_ndctl.su:region_namespace_ndctl.c dynamic,bounded
4288 ndctl_match_devdax : src/debug/common/region_namespace_ndctl.su:region_namespace_ndctl.c dynamic,bounded
4288 pmem2_devdax_match : src/debug/libpmem/region_namespace_ndctl.su:region_namespace_ndctl.c dynamic,bounded
4288 pmem2_devdax_match : src/debug/libpmempool/region_namespace_ndctl.su:region_namespace_ndctl.c dynamic,bounded
4288 pmem2_devdax_match : src/debug/libpmemobj/region_namespace_ndctl.su:region_namespace_ndctl.c dynamic,bounded
4288 pmem2_devdax_match : src/debug/libpmem2/region_namespace_ndctl.su:region_namespace_ndctl.c dynamic,bounded
4288 pmem2_devdax_match : src/debug/common/region_namespace_ndctl.su:region_namespace_ndctl.c dynamic,bounded
4208 util_header_check : src/debug/libpmempool/set.su:set.c dynamic,bounded
4208 util_header_check : src/debug/libpmemobj/set.su:set.c dynamic,bounded
4208 util_header_check : src/debug/common/set.su:set.c dynamic,bounded
Expand Down
20 changes: 10 additions & 10 deletions src/stats/stack-usage-nondebug.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@
7424 memmove_mov_avx512f_empty : src/nondebug/libpmem/memcpy_t_avx512f.su:memcpy_t_avx512f.c static
7424 memmove_mov_avx512f_empty : src/nondebug/libpmem2/memcpy_t_avx512f.su:memcpy_t_avx512f.c static
4352 pool_params_parse.isra.2.constprop : src/nondebug/libpmempool/pool.su:pool.c dynamic,bounded
4272 ndctl_match_fsdax : src/nondebug/libpmem/region_namespace_ndctl.su:region_namespace_ndctl.c static
4272 ndctl_match_fsdax : src/nondebug/libpmempool/region_namespace_ndctl.su:region_namespace_ndctl.c static
4272 ndctl_match_fsdax : src/nondebug/libpmemobj/region_namespace_ndctl.su:region_namespace_ndctl.c static
4272 ndctl_match_fsdax : src/nondebug/libpmem2/region_namespace_ndctl.su:region_namespace_ndctl.c static
4272 ndctl_match_fsdax : src/nondebug/common/region_namespace_ndctl.su:region_namespace_ndctl.c static
4272 ndctl_match_devdax : src/nondebug/libpmem/region_namespace_ndctl.su:region_namespace_ndctl.c static
4272 ndctl_match_devdax : src/nondebug/libpmempool/region_namespace_ndctl.su:region_namespace_ndctl.c static
4272 ndctl_match_devdax : src/nondebug/libpmemobj/region_namespace_ndctl.su:region_namespace_ndctl.c static
4272 ndctl_match_devdax : src/nondebug/libpmem2/region_namespace_ndctl.su:region_namespace_ndctl.c static
4272 ndctl_match_devdax : src/nondebug/common/region_namespace_ndctl.su:region_namespace_ndctl.c static
4272 pmem2_fsdax_match : src/nondebug/libpmem/region_namespace_ndctl.su:region_namespace_ndctl.c static
4272 pmem2_fsdax_match : src/nondebug/libpmempool/region_namespace_ndctl.su:region_namespace_ndctl.c static
4272 pmem2_fsdax_match : src/nondebug/libpmemobj/region_namespace_ndctl.su:region_namespace_ndctl.c static
4272 pmem2_fsdax_match : src/nondebug/libpmem2/region_namespace_ndctl.su:region_namespace_ndctl.c static
4272 pmem2_fsdax_match : src/nondebug/common/region_namespace_ndctl.su:region_namespace_ndctl.c static
4272 pmem2_devdax_match : src/nondebug/libpmem/region_namespace_ndctl.su:region_namespace_ndctl.c static
4272 pmem2_devdax_match : src/nondebug/libpmempool/region_namespace_ndctl.su:region_namespace_ndctl.c static
4272 pmem2_devdax_match : src/nondebug/libpmemobj/region_namespace_ndctl.su:region_namespace_ndctl.c static
4272 pmem2_devdax_match : src/nondebug/libpmem2/region_namespace_ndctl.su:region_namespace_ndctl.c static
4272 pmem2_devdax_match : src/nondebug/common/region_namespace_ndctl.su:region_namespace_ndctl.c static
4224 check_domain_in_region : src/nondebug/libpmempool/auto_flush_linux.su:auto_flush_linux.c dynamic,bounded
4224 check_domain_in_region : src/nondebug/libpmemobj/auto_flush_linux.su:auto_flush_linux.c dynamic,bounded
4224 check_domain_in_region : src/nondebug/libpmem/auto_flush_linux.su:auto_flush_linux.c dynamic,bounded
Expand Down

0 comments on commit 265a449

Please sign in to comment.