lib/bdev: move to spdk_bdev_part_base_construct_ext()
spdk_bdev_part_base_construct() is deprecated so this patch moves remaining instances to spdk_bdev_part_base_construct_ext(). Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com> Change-Id: Iccd4b15933bec41885adfaf4fc4ce2abedd2d6c7 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6627 Community-CI: Broadcom CI Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
This commit is contained in:
parent
a6b1e2c57d
commit
99935996f2
@ -122,6 +122,7 @@ gpt_base_bdev_init(struct spdk_bdev *bdev)
|
||||
{
|
||||
struct gpt_base *gpt_base;
|
||||
struct spdk_gpt *gpt;
|
||||
int rc;
|
||||
|
||||
gpt_base = calloc(1, sizeof(*gpt_base));
|
||||
if (!gpt_base) {
|
||||
@ -130,12 +131,12 @@ gpt_base_bdev_init(struct spdk_bdev *bdev)
|
||||
}
|
||||
|
||||
TAILQ_INIT(&gpt_base->parts);
|
||||
gpt_base->part_base = spdk_bdev_part_base_construct(bdev,
|
||||
gpt_base_bdev_hotremove_cb,
|
||||
&gpt_if, &vbdev_gpt_fn_table,
|
||||
&gpt_base->parts, gpt_base_free, gpt_base,
|
||||
sizeof(struct gpt_channel), NULL, NULL);
|
||||
if (!gpt_base->part_base) {
|
||||
rc = spdk_bdev_part_base_construct_ext(spdk_bdev_get_name(bdev),
|
||||
gpt_base_bdev_hotremove_cb,
|
||||
&gpt_if, &vbdev_gpt_fn_table,
|
||||
&gpt_base->parts, gpt_base_free, gpt_base,
|
||||
sizeof(struct gpt_channel), NULL, NULL, &gpt_base->part_base);
|
||||
if (rc != 0) {
|
||||
free(gpt_base);
|
||||
SPDK_ERRLOG("cannot construct gpt_base");
|
||||
return NULL;
|
||||
|
@ -117,10 +117,11 @@ part_test(void)
|
||||
bdev_base.module = &bdev_ut_if;
|
||||
rc = spdk_bdev_register(&bdev_base);
|
||||
CU_ASSERT(rc == 0);
|
||||
base = spdk_bdev_part_base_construct(&bdev_base, NULL, &vbdev_ut_if,
|
||||
&part_fn_table, &tailq, NULL,
|
||||
NULL, 0, NULL, NULL);
|
||||
rc = spdk_bdev_part_base_construct_ext("base", NULL, &vbdev_ut_if,
|
||||
&part_fn_table, &tailq, NULL,
|
||||
NULL, 0, NULL, NULL, &base);
|
||||
|
||||
CU_ASSERT(rc == 0);
|
||||
SPDK_CU_ASSERT_FATAL(base != NULL);
|
||||
|
||||
rc = spdk_bdev_part_construct(&part1, base, "test1", 0, 100, "test");
|
||||
|
Loading…
x
Reference in New Issue
Block a user