Lines Matching refs:subsys

26 	struct nvme_ctrl *pctrl = ctrl->subsys->passthru_ctrl;  in nvmet_passthru_override_id_ctrl()
41 id->ver = cpu_to_le32(ctrl->subsys->ver); in nvmet_passthru_override_id_ctrl()
498 int nvmet_passthru_ctrl_enable(struct nvmet_subsys *subsys) in nvmet_passthru_ctrl_enable() argument
505 mutex_lock(&subsys->lock); in nvmet_passthru_ctrl_enable()
506 if (!subsys->passthru_ctrl_path) in nvmet_passthru_ctrl_enable()
508 if (subsys->passthru_ctrl) in nvmet_passthru_ctrl_enable()
511 if (subsys->nr_namespaces) { in nvmet_passthru_ctrl_enable()
516 file = filp_open(subsys->passthru_ctrl_path, O_RDWR, 0); in nvmet_passthru_ctrl_enable()
525 subsys->passthru_ctrl_path); in nvmet_passthru_ctrl_enable()
531 subsys, GFP_KERNEL); in nvmet_passthru_ctrl_enable()
540 subsys->passthru_ctrl = ctrl; in nvmet_passthru_ctrl_enable()
541 subsys->ver = ctrl->vs; in nvmet_passthru_ctrl_enable()
543 if (subsys->ver < NVME_VS(1, 2, 1)) { in nvmet_passthru_ctrl_enable()
545 NVME_MAJOR(subsys->ver), NVME_MINOR(subsys->ver), in nvmet_passthru_ctrl_enable()
546 NVME_TERTIARY(subsys->ver)); in nvmet_passthru_ctrl_enable()
547 subsys->ver = NVME_VS(1, 2, 1); in nvmet_passthru_ctrl_enable()
550 __module_get(subsys->passthru_ctrl->ops->module); in nvmet_passthru_ctrl_enable()
556 mutex_unlock(&subsys->lock); in nvmet_passthru_ctrl_enable()
560 static void __nvmet_passthru_ctrl_disable(struct nvmet_subsys *subsys) in __nvmet_passthru_ctrl_disable() argument
562 if (subsys->passthru_ctrl) { in __nvmet_passthru_ctrl_disable()
563 xa_erase(&passthru_subsystems, subsys->passthru_ctrl->cntlid); in __nvmet_passthru_ctrl_disable()
564 module_put(subsys->passthru_ctrl->ops->module); in __nvmet_passthru_ctrl_disable()
565 nvme_put_ctrl(subsys->passthru_ctrl); in __nvmet_passthru_ctrl_disable()
567 subsys->passthru_ctrl = NULL; in __nvmet_passthru_ctrl_disable()
568 subsys->ver = NVMET_DEFAULT_VS; in __nvmet_passthru_ctrl_disable()
571 void nvmet_passthru_ctrl_disable(struct nvmet_subsys *subsys) in nvmet_passthru_ctrl_disable() argument
573 mutex_lock(&subsys->lock); in nvmet_passthru_ctrl_disable()
574 __nvmet_passthru_ctrl_disable(subsys); in nvmet_passthru_ctrl_disable()
575 mutex_unlock(&subsys->lock); in nvmet_passthru_ctrl_disable()
578 void nvmet_passthru_subsys_free(struct nvmet_subsys *subsys) in nvmet_passthru_subsys_free() argument
580 mutex_lock(&subsys->lock); in nvmet_passthru_subsys_free()
581 __nvmet_passthru_ctrl_disable(subsys); in nvmet_passthru_subsys_free()
582 mutex_unlock(&subsys->lock); in nvmet_passthru_subsys_free()
583 kfree(subsys->passthru_ctrl_path); in nvmet_passthru_subsys_free()