Commit dd710e64 authored by Maciej Szwed's avatar Maciej Szwed Committed by Jim Harris
Browse files

bdev/nvme: Move nvme_async_probe_ctx structure to common.h



This is required to use spdk_bdev_nvme_create function
for other NVMe modes.

Signed-off-by: default avatarMaciej Szwed <maciej.szwed@intel.com>
Change-Id: I47dcb41689c7ec696ca6e76c35c81b497655d29a
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/468342


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent cfaa7428
Loading
Loading
Loading
Loading
+0 −14
Original line number Diff line number Diff line
@@ -34,7 +34,6 @@
#include "spdk/stdinc.h"

#include "bdev_nvme.h"
#include "common.h"

#include "spdk/config.h"
#include "spdk/conf.h"
@@ -1231,19 +1230,6 @@ bdev_nvme_create_bdevs(const char **names, size_t *count,
	return 0;
}

struct nvme_async_probe_ctx {
	struct spdk_nvme_probe_ctx *probe_ctx;
	const char *base_name;
	const char **names;
	size_t *count;
	uint32_t prchk_flags;
	struct spdk_poller *poller;
	struct spdk_nvme_transport_id trid;
	struct spdk_nvme_ctrlr_opts opts;
	spdk_bdev_create_nvme_fn cb_fn;
	void *cb_ctx;
};

static void
connect_attach_cb(void *cb_ctx, const struct spdk_nvme_transport_id *trid,
		  struct spdk_nvme_ctrlr *ctrlr, const struct spdk_nvme_ctrlr_opts *opts)
+2 −1
Original line number Diff line number Diff line
@@ -40,6 +40,8 @@
#include "spdk/nvme.h"
#include "spdk/bdev_module.h"

#include "common.h"

enum spdk_bdev_timeout_action {
	SPDK_BDEV_NVME_TIMEOUT_ACTION_NONE = 0,
	SPDK_BDEV_NVME_TIMEOUT_ACTION_RESET,
@@ -59,7 +61,6 @@ struct spdk_bdev_nvme_opts {
	uint32_t io_queue_requests;
};

typedef void (*spdk_bdev_create_nvme_fn)(void *ctx, int rc);
struct spdk_nvme_qpair *spdk_bdev_nvme_get_io_qpair(struct spdk_io_channel *ctrlr_io_ch);
void spdk_bdev_nvme_get_opts(struct spdk_bdev_nvme_opts *opts);
int spdk_bdev_nvme_set_opts(const struct spdk_bdev_nvme_opts *opts);
+15 −0
Original line number Diff line number Diff line
@@ -81,6 +81,21 @@ struct nvme_bdev {
	struct spdk_nvme_ns	*ns;
};

typedef void (*spdk_bdev_create_nvme_fn)(void *ctx, int rc);

struct nvme_async_probe_ctx {
	struct spdk_nvme_probe_ctx *probe_ctx;
	const char *base_name;
	const char **names;
	size_t *count;
	uint32_t prchk_flags;
	struct spdk_poller *poller;
	struct spdk_nvme_transport_id trid;
	struct spdk_nvme_ctrlr_opts opts;
	spdk_bdev_create_nvme_fn cb_fn;
	void *cb_ctx;
};

struct nvme_bdev_ctrlr *nvme_bdev_ctrlr_get(const struct spdk_nvme_transport_id *trid);
struct nvme_bdev_ctrlr *nvme_bdev_ctrlr_get_by_name(const char *name);
struct nvme_bdev_ctrlr *nvme_bdev_first_ctrlr(void);