From b93e62f3e668c9e23c573e2f7a6ad4c6620d9f8d Mon Sep 17 00:00:00 2001 From: jimharris Date: Fri, 30 Oct 2015 16:35:18 +0000 Subject: nvd, nvme: report stripesize through GEOM disk layer MFC after: 3 days Sponsored by: Intel --- sys/dev/nvd/nvd.c | 1 + sys/dev/nvme/nvme.h | 1 + sys/dev/nvme/nvme_ns.c | 7 +++++++ 3 files changed, 9 insertions(+) (limited to 'sys/dev') diff --git a/sys/dev/nvd/nvd.c b/sys/dev/nvd/nvd.c index 016d728..5d75876 100644 --- a/sys/dev/nvd/nvd.c +++ b/sys/dev/nvd/nvd.c @@ -279,6 +279,7 @@ nvd_new_disk(struct nvme_namespace *ns, void *ctrlr_arg) disk->d_sectorsize = nvme_ns_get_sector_size(ns); disk->d_mediasize = (off_t)nvme_ns_get_size(ns); disk->d_delmaxsize = (off_t)nvme_ns_get_size(ns); + disk->d_stripesize = nvme_ns_get_stripesize(ns); if (TAILQ_EMPTY(&disk_head)) disk->d_unit = 0; diff --git a/sys/dev/nvme/nvme.h b/sys/dev/nvme/nvme.h index 111a932..7e41e77 100644 --- a/sys/dev/nvme/nvme.h +++ b/sys/dev/nvme/nvme.h @@ -870,6 +870,7 @@ const char * nvme_ns_get_serial_number(struct nvme_namespace *ns); const char * nvme_ns_get_model_number(struct nvme_namespace *ns); const struct nvme_namespace_data * nvme_ns_get_data(struct nvme_namespace *ns); +uint32_t nvme_ns_get_stripesize(struct nvme_namespace *ns); int nvme_ns_bio_process(struct nvme_namespace *ns, struct bio *bp, nvme_cb_fn_t cb_fn); diff --git a/sys/dev/nvme/nvme_ns.c b/sys/dev/nvme/nvme_ns.c index c6a00df..754d074 100644 --- a/sys/dev/nvme/nvme_ns.c +++ b/sys/dev/nvme/nvme_ns.c @@ -210,6 +210,13 @@ nvme_ns_get_data(struct nvme_namespace *ns) return (&ns->data); } +uint32_t +nvme_ns_get_stripesize(struct nvme_namespace *ns) +{ + + return (ns->stripesize); +} + static void nvme_ns_bio_done(void *arg, const struct nvme_completion *status) { -- cgit v1.1