nvmf: save the NSID when adding a new Namespace

The nsid field can be used for per namespace basis
reservation notification.

Change-Id: Ia7212020ec893ea367afe79933e1629895fe41b8
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/439930
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
Changpeng Liu 2019-01-08 01:14:53 -05:00
parent 2ce9296ed2
commit a9c30bcceb
2 changed files with 2 additions and 0 deletions

View File

@ -159,6 +159,7 @@ struct spdk_nvmf_request {
};
struct spdk_nvmf_ns {
uint32_t nsid;
struct spdk_nvmf_subsystem *subsystem;
struct spdk_bdev *bdev;
struct spdk_bdev_desc *desc;

View File

@ -1084,6 +1084,7 @@ spdk_nvmf_subsystem_add_ns(struct spdk_nvmf_subsystem *subsystem, struct spdk_bd
return 0;
}
subsystem->ns[opts.nsid - 1] = ns;
ns->nsid = opts.nsid;
SPDK_DEBUGLOG(SPDK_LOG_NVMF, "Subsystem %s: bdev %s assigned nsid %" PRIu32 "\n",
spdk_nvmf_subsystem_get_nqn(subsystem),