Lines Matching refs:subsys
29 if (!nvme_multi_css(ctrl->subsys->passthru_ctrl)) in nvmet_passthrough_override_cap()
42 if (!ctrl->subsys->clear_ids) in nvmet_passthru_override_id_descs()
83 struct nvme_ctrl *pctrl = ctrl->subsys->passthru_ctrl; in nvmet_passthru_override_id_ctrl()
98 id->ver = cpu_to_le32(ctrl->subsys->ver); in nvmet_passthru_override_id_ctrl()
202 if (req->sq->ctrl->subsys->clear_ids) { in nvmet_passthru_override_id_ns()
573 int nvmet_passthru_ctrl_enable(struct nvmet_subsys *subsys) in nvmet_passthru_ctrl_enable() argument
580 mutex_lock(&subsys->lock); in nvmet_passthru_ctrl_enable()
581 if (!subsys->passthru_ctrl_path) in nvmet_passthru_ctrl_enable()
583 if (subsys->passthru_ctrl) in nvmet_passthru_ctrl_enable()
586 if (subsys->nr_namespaces) { in nvmet_passthru_ctrl_enable()
591 file = filp_open(subsys->passthru_ctrl_path, O_RDWR, 0); in nvmet_passthru_ctrl_enable()
600 subsys->passthru_ctrl_path); in nvmet_passthru_ctrl_enable()
606 subsys, GFP_KERNEL); in nvmet_passthru_ctrl_enable()
615 subsys->passthru_ctrl = ctrl; in nvmet_passthru_ctrl_enable()
616 subsys->ver = ctrl->vs; in nvmet_passthru_ctrl_enable()
618 if (subsys->ver < NVME_VS(1, 2, 1)) { in nvmet_passthru_ctrl_enable()
620 NVME_MAJOR(subsys->ver), NVME_MINOR(subsys->ver), in nvmet_passthru_ctrl_enable()
621 NVME_TERTIARY(subsys->ver)); in nvmet_passthru_ctrl_enable()
622 subsys->ver = NVME_VS(1, 2, 1); in nvmet_passthru_ctrl_enable()
625 __module_get(subsys->passthru_ctrl->ops->module); in nvmet_passthru_ctrl_enable()
631 mutex_unlock(&subsys->lock); in nvmet_passthru_ctrl_enable()
635 static void __nvmet_passthru_ctrl_disable(struct nvmet_subsys *subsys) in __nvmet_passthru_ctrl_disable() argument
637 if (subsys->passthru_ctrl) { in __nvmet_passthru_ctrl_disable()
638 xa_erase(&passthru_subsystems, subsys->passthru_ctrl->cntlid); in __nvmet_passthru_ctrl_disable()
639 module_put(subsys->passthru_ctrl->ops->module); in __nvmet_passthru_ctrl_disable()
640 nvme_put_ctrl(subsys->passthru_ctrl); in __nvmet_passthru_ctrl_disable()
642 subsys->passthru_ctrl = NULL; in __nvmet_passthru_ctrl_disable()
643 subsys->ver = NVMET_DEFAULT_VS; in __nvmet_passthru_ctrl_disable()
646 void nvmet_passthru_ctrl_disable(struct nvmet_subsys *subsys) in nvmet_passthru_ctrl_disable() argument
648 mutex_lock(&subsys->lock); in nvmet_passthru_ctrl_disable()
649 __nvmet_passthru_ctrl_disable(subsys); in nvmet_passthru_ctrl_disable()
650 mutex_unlock(&subsys->lock); in nvmet_passthru_ctrl_disable()
653 void nvmet_passthru_subsys_free(struct nvmet_subsys *subsys) in nvmet_passthru_subsys_free() argument
655 mutex_lock(&subsys->lock); in nvmet_passthru_subsys_free()
656 __nvmet_passthru_ctrl_disable(subsys); in nvmet_passthru_subsys_free()
657 mutex_unlock(&subsys->lock); in nvmet_passthru_subsys_free()
658 kfree(subsys->passthru_ctrl_path); in nvmet_passthru_subsys_free()