Commit fa796437 authored by Jim Harris's avatar Jim Harris Committed by Tomasz Zawadzki
Browse files

nvmf: remove struct spdk_bdev definition dependencies



1) use spdk_bdev_get_name() accessor
2) use __SPDK_BDEV_MODULE_ONLY #define

The latter allows nvmf to just get the spdk_bdev_module
definitions and APIs that it needs for claiming bdevs
for purposes of avoiding the same namespace used in
different subsystems.

This also ensures that future changes to structures
like spdk_bdev and spdk_bdev_io will not cause
lib/nvmf so version changes.

Note: we include bdev_module.h explicitly in the
nvmf/subsystem unit tests now, before including
subsystem.c, because the unit tests do depend on
knowing the internal structure of spdk_bdev.

Signed-off-by: default avatarJim Harris <james.r.harris@intel.com>
Change-Id: I2f499a741d19f4749eadb402641f28137245fd23
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7738


Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Reviewed-by: default avatarAnil Veerabhadrappa <anil.veerabhadrappa@broadcom.com>
Reviewed-by: default avatarAleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
parent 2b9ec05b
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -44,6 +44,7 @@
#include "spdk/json.h"
#include "spdk/file.h"

#define __SPDK_BDEV_MODULE_ONLY
#include "spdk/bdev_module.h"
#include "spdk/log.h"
#include "spdk_internal/utf.h"
@@ -1320,7 +1321,7 @@ nvmf_ns_event(enum spdk_bdev_event_type type,
{
	SPDK_DEBUGLOG(nvmf, "Bdev event: type %d, name %s, subsystem_id %d, ns_id %d\n",
		      type,
		      bdev->name,
		      spdk_bdev_get_name(bdev),
		      ((struct spdk_nvmf_ns *)event_ctx)->subsystem->id,
		      ((struct spdk_nvmf_ns *)event_ctx)->nsid);

+1 −0
Original line number Diff line number Diff line
@@ -51,6 +51,7 @@
#include "json/json_write.c"
#include "nvmf/nvmf.c"
#include "nvmf/transport.c"
#include "spdk/bdev_module.h"
#include "nvmf/subsystem.c"
#include "nvmf/fc.c"
#include "nvmf/fc_ls.c"
+1 −0
Original line number Diff line number Diff line
@@ -37,6 +37,7 @@
#include "spdk_cunit.h"
#include "spdk_internal/mock.h"

#include "spdk/bdev_module.h"
#include "nvmf/subsystem.c"

SPDK_LOG_REGISTER_COMPONENT(nvmf)