|
@@ -2998,31 +2998,7 @@ static void nvme_alloc_ns(struct nvme_ctrl *ctrl, unsigned nsid)
|
|
|
if (nvme_init_ns_head(ns, nsid, id))
|
|
|
goto out_free_id;
|
|
|
nvme_setup_streams_ns(ctrl, ns);
|
|
|
-
|
|
|
-#ifdef CONFIG_NVME_MULTIPATH
|
|
|
- /*
|
|
|
- * If multipathing is enabled we need to always use the subsystem
|
|
|
- * instance number for numbering our devices to avoid conflicts
|
|
|
- * between subsystems that have multiple controllers and thus use
|
|
|
- * the multipath-aware subsystem node and those that have a single
|
|
|
- * controller and use the controller node directly.
|
|
|
- */
|
|
|
- if (ns->head->disk) {
|
|
|
- sprintf(disk_name, "nvme%dc%dn%d", ctrl->subsys->instance,
|
|
|
- ctrl->cntlid, ns->head->instance);
|
|
|
- flags = GENHD_FL_HIDDEN;
|
|
|
- } else {
|
|
|
- sprintf(disk_name, "nvme%dn%d", ctrl->subsys->instance,
|
|
|
- ns->head->instance);
|
|
|
- }
|
|
|
-#else
|
|
|
- /*
|
|
|
- * But without the multipath code enabled, multiple controller per
|
|
|
- * subsystems are visible as devices and thus we cannot use the
|
|
|
- * subsystem instance.
|
|
|
- */
|
|
|
- sprintf(disk_name, "nvme%dn%d", ctrl->instance, ns->head->instance);
|
|
|
-#endif
|
|
|
+ nvme_set_disk_name(disk_name, ns, ctrl, &flags);
|
|
|
|
|
|
if ((ctrl->quirks & NVME_QUIRK_LIGHTNVM) && id->vs[0] == 0x1) {
|
|
|
if (nvme_nvm_register(ns, disk_name, node)) {
|