Lines Matching refs:subsys
29 if (!nvme_multi_css(ctrl->subsys->passthru_ctrl)) in nvmet_passthrough_override_cap()
36 struct nvme_ctrl *pctrl = ctrl->subsys->passthru_ctrl; in nvmet_passthru_override_id_ctrl()
51 id->ver = cpu_to_le32(ctrl->subsys->ver); in nvmet_passthru_override_id_ctrl()
510 int nvmet_passthru_ctrl_enable(struct nvmet_subsys *subsys) in nvmet_passthru_ctrl_enable() argument
517 mutex_lock(&subsys->lock); in nvmet_passthru_ctrl_enable()
518 if (!subsys->passthru_ctrl_path) in nvmet_passthru_ctrl_enable()
520 if (subsys->passthru_ctrl) in nvmet_passthru_ctrl_enable()
523 if (subsys->nr_namespaces) { in nvmet_passthru_ctrl_enable()
528 file = filp_open(subsys->passthru_ctrl_path, O_RDWR, 0); in nvmet_passthru_ctrl_enable()
537 subsys->passthru_ctrl_path); in nvmet_passthru_ctrl_enable()
543 subsys, GFP_KERNEL); in nvmet_passthru_ctrl_enable()
552 subsys->passthru_ctrl = ctrl; in nvmet_passthru_ctrl_enable()
553 subsys->ver = ctrl->vs; in nvmet_passthru_ctrl_enable()
555 if (subsys->ver < NVME_VS(1, 2, 1)) { in nvmet_passthru_ctrl_enable()
557 NVME_MAJOR(subsys->ver), NVME_MINOR(subsys->ver), in nvmet_passthru_ctrl_enable()
558 NVME_TERTIARY(subsys->ver)); in nvmet_passthru_ctrl_enable()
559 subsys->ver = NVME_VS(1, 2, 1); in nvmet_passthru_ctrl_enable()
562 __module_get(subsys->passthru_ctrl->ops->module); in nvmet_passthru_ctrl_enable()
568 mutex_unlock(&subsys->lock); in nvmet_passthru_ctrl_enable()
572 static void __nvmet_passthru_ctrl_disable(struct nvmet_subsys *subsys) in __nvmet_passthru_ctrl_disable() argument
574 if (subsys->passthru_ctrl) { in __nvmet_passthru_ctrl_disable()
575 xa_erase(&passthru_subsystems, subsys->passthru_ctrl->cntlid); in __nvmet_passthru_ctrl_disable()
576 module_put(subsys->passthru_ctrl->ops->module); in __nvmet_passthru_ctrl_disable()
577 nvme_put_ctrl(subsys->passthru_ctrl); in __nvmet_passthru_ctrl_disable()
579 subsys->passthru_ctrl = NULL; in __nvmet_passthru_ctrl_disable()
580 subsys->ver = NVMET_DEFAULT_VS; in __nvmet_passthru_ctrl_disable()
583 void nvmet_passthru_ctrl_disable(struct nvmet_subsys *subsys) in nvmet_passthru_ctrl_disable() argument
585 mutex_lock(&subsys->lock); in nvmet_passthru_ctrl_disable()
586 __nvmet_passthru_ctrl_disable(subsys); in nvmet_passthru_ctrl_disable()
587 mutex_unlock(&subsys->lock); in nvmet_passthru_ctrl_disable()
590 void nvmet_passthru_subsys_free(struct nvmet_subsys *subsys) in nvmet_passthru_subsys_free() argument
592 mutex_lock(&subsys->lock); in nvmet_passthru_subsys_free()
593 __nvmet_passthru_ctrl_disable(subsys); in nvmet_passthru_subsys_free()
594 mutex_unlock(&subsys->lock); in nvmet_passthru_subsys_free()
595 kfree(subsys->passthru_ctrl_path); in nvmet_passthru_subsys_free()