module/bdev/nvme: return nvme ns as a module ctx instead nvme ctrlr
It is more flexible now as it is possible to get nvme ns handle to do additional management or queries, however if nvme ctrlr handle is needed there is already public nvme API for that with nvme ns as an input. Signed-off-by: Jacek Kalwas <jacek.kalwas@intel.com> Change-Id: I5493168ad31cc95687962288d57fb5457f2d7dd6 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9357 Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com> Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
This commit is contained in:
parent
5f0ed1cc97
commit
bf22ddc60f
@ -1163,7 +1163,11 @@ bdev_nvme_get_module_ctx(void *ctx)
|
||||
{
|
||||
struct nvme_bdev *nvme_bdev = ctx;
|
||||
|
||||
return bdev_nvme_get_ctrlr(&nvme_bdev->disk);
|
||||
if (!nvme_bdev || nvme_bdev->disk.module != &nvme_if || !nvme_bdev->nvme_ns) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return nvme_bdev->nvme_ns->ns;
|
||||
}
|
||||
|
||||
static const char *
|
||||
|
Loading…
Reference in New Issue
Block a user