summaryrefslogtreecommitdiffstats
path: root/sys/dev/nvd
diff options
context:
space:
mode:
authorjimharris <jimharris@FreeBSD.org>2013-07-19 21:30:53 +0000
committerjimharris <jimharris@FreeBSD.org>2013-07-19 21:30:53 +0000
commit7018faf19c888299676f60070ea1df0ebe309711 (patch)
treeb3f21e34299eceb005f4e97c632ab1b963a6192e /sys/dev/nvd
parent9f5ff4a4a0217eb6b74d258a31ac9e0495d1fea9 (diff)
downloadFreeBSD-src-7018faf19c888299676f60070ea1df0ebe309711.zip
FreeBSD-src-7018faf19c888299676f60070ea1df0ebe309711.tar.gz
Do not call disk_create() until we have completed all initialization of our
internal disk structure. Sponsored by: Intel Reviewed by: carl MFC after: 3 days
Diffstat (limited to 'sys/dev/nvd')
-rw-r--r--sys/dev/nvd/nvd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/nvd/nvd.c b/sys/dev/nvd/nvd.c
index 868a238..1bde1ca 100644
--- a/sys/dev/nvd/nvd.c
+++ b/sys/dev/nvd/nvd.c
@@ -318,8 +318,6 @@ nvd_new_disk(struct nvme_namespace *ns, void *ctrlr_arg)
min(sizeof(disk->d_descr), NVME_MODEL_NUMBER_LENGTH));
#endif
- disk_create(disk, DISK_VERSION);
-
ndisk->ns = ns;
ndisk->disk = disk;
ndisk->cur_depth = 0;
@@ -335,6 +333,8 @@ nvd_new_disk(struct nvme_namespace *ns, void *ctrlr_arg)
TAILQ_INSERT_TAIL(&disk_head, ndisk, global_tailq);
TAILQ_INSERT_TAIL(&ctrlr->disk_head, ndisk, ctrlr_tailq);
+ disk_create(disk, DISK_VERSION);
+
return (NULL);
}
OpenPOWER on IntegriCloud