Lines Matching defs:new_ctx

7351 	struct discovery_entry_ctx *new_ctx;
7353 new_ctx = calloc(1, sizeof(*new_ctx));
7354 if (new_ctx == NULL) {
7359 new_ctx->ctx = ctx;
7360 memcpy(&new_ctx->trid, trid, sizeof(*trid));
7361 spdk_nvme_ctrlr_get_default_ctrlr_opts(&new_ctx->drv_opts, sizeof(new_ctx->drv_opts));
7362 snprintf(new_ctx->drv_opts.hostnqn, sizeof(new_ctx->drv_opts.hostnqn), "%s", ctx->hostnqn);
7363 return new_ctx;
7393 struct discovery_entry_ctx *new_ctx;
7397 new_ctx = create_discovery_entry_ctx(ctx, &trid);
7398 if (new_ctx == NULL) {
7403 TAILQ_INSERT_TAIL(&ctx->discovery_entry_ctxs, new_ctx, tailq);
7414 struct discovery_entry_ctx *subnqn_ctx = NULL, *new_ctx;
7429 new_ctx = calloc(1, sizeof(*new_ctx));
7430 if (new_ctx == NULL) {
7435 new_ctx->ctx = ctx;
7436 memcpy(&new_ctx->entry, new_entry, sizeof(*new_entry));
7437 build_trid_from_log_page_entry(&new_ctx->trid, new_entry);
7439 snprintf(new_ctx->name, sizeof(new_ctx->name), "%s", subnqn_ctx->name);
7441 new_ctx->trid.subnqn, new_ctx->trid.traddr, new_ctx->trid.trsvcid,
7442 new_ctx->name);
7444 snprintf(new_ctx->name, sizeof(new_ctx->name), "%s%d", ctx->name, ctx->index++);
7446 new_ctx->trid.subnqn, new_ctx->trid.traddr, new_ctx->trid.trsvcid,
7447 new_ctx->name);
7449 spdk_nvme_ctrlr_get_default_ctrlr_opts(&new_ctx->drv_opts, sizeof(new_ctx->drv_opts));
7450 snprintf(new_ctx->drv_opts.hostnqn, sizeof(new_ctx->drv_opts.hostnqn), "%s", ctx->hostnqn);
7451 rc = spdk_bdev_nvme_create(&new_ctx->trid, new_ctx->name, NULL, 0,
7452 discovery_attach_controller_done, new_ctx,
7453 &new_ctx->drv_opts, &ctx->bdev_opts);
7455 TAILQ_INSERT_TAIL(&ctx->nvm_entry_ctxs, new_ctx, tailq);