summaryrefslogtreecommitdiffstats
path: root/hw/block/nvme-ns.h
diff options
context:
space:
mode:
authorKlaus Jensen2021-03-08 09:09:35 +0100
committerKlaus Jensen2021-03-18 12:34:52 +0100
commit397fbb5b32558dd2b5cd35cb4d25126879384079 (patch)
treebf053e66b006947aafb38b7fb8d80a00aa489b24 /hw/block/nvme-ns.h
parenthw/block/nvme: support multiple lba formats (diff)
downloadqemu-397fbb5b32558dd2b5cd35cb4d25126879384079.tar.gz
qemu-397fbb5b32558dd2b5cd35cb4d25126879384079.tar.xz
qemu-397fbb5b32558dd2b5cd35cb4d25126879384079.zip
hw/block/nvme: prefer runtime helpers instead of device parameters
In preparation for Format NVM support, use runtime helpers instead of the constant device parameters when getting lba size information etc. Signed-off-by: Klaus Jensen <k.jensen@samsung.com> Reviewed-by: Minwoo Im <minwoo.im.dev@gmail.com>
Diffstat (limited to 'hw/block/nvme-ns.h')
-rw-r--r--hw/block/nvme-ns.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/block/nvme-ns.h b/hw/block/nvme-ns.h
index e2f53d9996..07e1688080 100644
--- a/hw/block/nvme-ns.h
+++ b/hw/block/nvme-ns.h
@@ -138,7 +138,7 @@ static inline bool nvme_ns_ext(NvmeNamespace *ns)
/* calculate the number of LBAs that the namespace can accomodate */
static inline uint64_t nvme_ns_nlbas(NvmeNamespace *ns)
{
- if (ns->params.ms) {
+ if (nvme_msize(ns)) {
return ns->size / (nvme_lsize(ns) + nvme_msize(ns));
}
return ns->size >> nvme_ns_lbads(ns);