bdev/nvme: Remove spdk_bdev_nvme_lookup_ctrlr function
spdk_bdev_nvme_lookup_ctrlr can be replaced with existing nvme_bdev_ctrlr_get_by_name function. Signed-off-by: Maciej Szwed <maciej.szwed@intel.com> Change-Id: Id85243b13099b2976e1368e481201ccf27ce6ddb Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/446437 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Paul Luse <paul.e.luse@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
parent
d5565d6bd4
commit
913bd6b6ef
@ -150,20 +150,6 @@ spdk_bdev_nvme_get_io_qpair(struct spdk_io_channel *ctrlr_io_ch)
|
|||||||
return nvme_ch->qpair;
|
return nvme_ch->qpair;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct nvme_bdev_ctrlr *
|
|
||||||
spdk_bdev_nvme_lookup_ctrlr(const char *ctrlr_name)
|
|
||||||
{
|
|
||||||
struct nvme_bdev_ctrlr *_nvme_ctrlr;
|
|
||||||
|
|
||||||
TAILQ_FOREACH(_nvme_ctrlr, &g_nvme_bdev_ctrlrs, tailq) {
|
|
||||||
if (strcmp(ctrlr_name, _nvme_ctrlr->name) == 0) {
|
|
||||||
return _nvme_ctrlr;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
struct nvme_bdev_ctrlr *
|
struct nvme_bdev_ctrlr *
|
||||||
spdk_bdev_nvme_first_ctrlr(void)
|
spdk_bdev_nvme_first_ctrlr(void)
|
||||||
{
|
{
|
||||||
|
@ -57,7 +57,6 @@ void spdk_bdev_nvme_dump_trid_json(struct spdk_nvme_transport_id *trid,
|
|||||||
struct spdk_json_write_ctx *w);
|
struct spdk_json_write_ctx *w);
|
||||||
|
|
||||||
struct spdk_nvme_qpair *spdk_bdev_nvme_get_io_qpair(struct spdk_io_channel *ctrlr_io_ch);
|
struct spdk_nvme_qpair *spdk_bdev_nvme_get_io_qpair(struct spdk_io_channel *ctrlr_io_ch);
|
||||||
struct nvme_bdev_ctrlr *spdk_bdev_nvme_lookup_ctrlr(const char *ctrlr_name);
|
|
||||||
struct nvme_bdev_ctrlr *spdk_bdev_nvme_first_ctrlr(void);
|
struct nvme_bdev_ctrlr *spdk_bdev_nvme_first_ctrlr(void);
|
||||||
struct nvme_bdev_ctrlr *spdk_bdev_nvme_next_ctrlr(struct nvme_bdev_ctrlr *prev);
|
struct nvme_bdev_ctrlr *spdk_bdev_nvme_next_ctrlr(struct nvme_bdev_ctrlr *prev);
|
||||||
void spdk_bdev_nvme_get_opts(struct spdk_bdev_nvme_opts *opts);
|
void spdk_bdev_nvme_get_opts(struct spdk_bdev_nvme_opts *opts);
|
||||||
|
@ -347,7 +347,7 @@ spdk_rpc_get_nvme_controllers(struct spdk_jsonrpc_request *request,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (req.name) {
|
if (req.name) {
|
||||||
ctrlr = spdk_bdev_nvme_lookup_ctrlr(req.name);
|
ctrlr = nvme_bdev_ctrlr_get_by_name(req.name);
|
||||||
if (ctrlr == NULL) {
|
if (ctrlr == NULL) {
|
||||||
SPDK_ERRLOG("ctrlr '%s' does not exist\n", req.name);
|
SPDK_ERRLOG("ctrlr '%s' does not exist\n", req.name);
|
||||||
goto invalid;
|
goto invalid;
|
||||||
|
@ -461,7 +461,7 @@ spdk_rpc_send_nvme_cmd(struct spdk_jsonrpc_request *request,
|
|||||||
goto invalid;
|
goto invalid;
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx->nvme_bdev_ctrlr = spdk_bdev_nvme_lookup_ctrlr(ctx->req.name);
|
ctx->nvme_bdev_ctrlr = nvme_bdev_ctrlr_get_by_name(ctx->req.name);
|
||||||
if (ctx->nvme_bdev_ctrlr == NULL) {
|
if (ctx->nvme_bdev_ctrlr == NULL) {
|
||||||
SPDK_ERRLOG("Failed at device lookup\n");
|
SPDK_ERRLOG("Failed at device lookup\n");
|
||||||
error_code = SPDK_JSONRPC_ERROR_INVALID_PARAMS;
|
error_code = SPDK_JSONRPC_ERROR_INVALID_PARAMS;
|
||||||
|
Loading…
Reference in New Issue
Block a user