nvme: initialize namespace capability flags with correct order

The extended LBA format flag should be initialized after namespace
capability flag.

Change-Id: Iad479b454bb4e31120c17d40ae23937a099c6f8f
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
This commit is contained in:
Changpeng Liu 2017-03-11 12:40:17 +08:00 committed by Jim Harris
parent 360d3813b0
commit 8482b47d53

View File

@ -74,6 +74,8 @@ int nvme_ns_identify_update(struct spdk_nvme_ns *ns)
return 0;
}
ns->flags = 0x0000;
ns->sector_size = 1 << nsdata->lbaf[nsdata->flbas.format].lbads;
ns->extended_lba_size = ns->sector_size;
@ -86,8 +88,6 @@ int nvme_ns_identify_update(struct spdk_nvme_ns *ns)
ns->sectors_per_max_io = spdk_nvme_ns_get_max_io_xfer_size(ns) / ns->extended_lba_size;
ns->sectors_per_stripe = ns->stripe_size / ns->sector_size;
ns->flags = 0x0000;
if (ns->ctrlr->cdata.oncs.dsm) {
ns->flags |= SPDK_NVME_NS_DEALLOCATE_SUPPORTED;
}