nvme: Remove nvme_attach

Change-Id: Ia688e49574d8d80f1473f93f127586ca5aaa7d91
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
Ben Walker 2016-11-30 15:33:32 -07:00
parent 4af9f06c73
commit a2f35bcc16
3 changed files with 3 additions and 20 deletions

View File

@ -43,19 +43,6 @@ int32_t spdk_nvme_retry_count;
static int hotplug_fd = -1; static int hotplug_fd = -1;
struct spdk_nvme_ctrlr *
nvme_attach(enum spdk_nvme_transport_type trtype,
const struct spdk_nvme_ctrlr_opts *opts,
const struct spdk_nvme_probe_info *probe_info,
void *devhandle)
{
struct spdk_nvme_ctrlr *ctrlr;
ctrlr = nvme_transport_ctrlr_construct(trtype, opts, probe_info, devhandle);
return ctrlr;
}
int int
spdk_nvme_detach(struct spdk_nvme_ctrlr *ctrlr) spdk_nvme_detach(struct spdk_nvme_ctrlr *ctrlr)
{ {
@ -324,9 +311,9 @@ nvme_probe_one(enum spdk_nvme_transport_type trtype, spdk_nvme_probe_cb probe_cb
spdk_nvme_ctrlr_opts_set_defaults(&opts); spdk_nvme_ctrlr_opts_set_defaults(&opts);
if (probe_cb(cb_ctx, probe_info, &opts)) { if (probe_cb(cb_ctx, probe_info, &opts)) {
ctrlr = nvme_attach(trtype, &opts, probe_info, devhandle); ctrlr = nvme_transport_ctrlr_construct(trtype, &opts, probe_info, devhandle);
if (ctrlr == NULL) { if (ctrlr == NULL) {
SPDK_ERRLOG("nvme_attach() failed\n"); SPDK_ERRLOG("Failed to construct NVMe controller\n");
return -1; return -1;
} }

View File

@ -552,10 +552,6 @@ int nvme_robust_mutex_init_recursive_shared(pthread_mutex_t *mtx);
bool nvme_completion_is_retry(const struct spdk_nvme_cpl *cpl); bool nvme_completion_is_retry(const struct spdk_nvme_cpl *cpl);
void nvme_qpair_print_command(struct spdk_nvme_qpair *qpair, struct spdk_nvme_cmd *cmd); void nvme_qpair_print_command(struct spdk_nvme_qpair *qpair, struct spdk_nvme_cmd *cmd);
void nvme_qpair_print_completion(struct spdk_nvme_qpair *qpair, struct spdk_nvme_cpl *cpl); void nvme_qpair_print_completion(struct spdk_nvme_qpair *qpair, struct spdk_nvme_cpl *cpl);
struct spdk_nvme_ctrlr *nvme_attach(enum spdk_nvme_transport_type trtype,
const struct spdk_nvme_ctrlr_opts *opts,
const struct spdk_nvme_probe_info *probe_info,
void *devhandle);
/* Transport specific functions */ /* Transport specific functions */
#define DECLARE_TRANSPORT(name) \ #define DECLARE_TRANSPORT(name) \

View File

@ -1068,7 +1068,7 @@ nvme_rdma_ctrlr_scan(enum spdk_nvme_transport_type trtype,
snprintf(probe_info.trsvcid, sizeof(probe_info.trsvcid), "%s", trid->trsvcid); snprintf(probe_info.trsvcid, sizeof(probe_info.trsvcid), "%s", trid->trsvcid);
memset(buffer, 0x0, 4096); memset(buffer, 0x0, 4096);
discovery_ctrlr = nvme_attach(trtype, &discovery_opts, &probe_info, NULL); discovery_ctrlr = nvme_rdma_ctrlr_construct(trtype, &discovery_opts, &probe_info, devhandle);
if (discovery_ctrlr == NULL) { if (discovery_ctrlr == NULL) {
return -1; return -1;
} }