Lines Matching full: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()
497 int nvmet_passthru_ctrl_enable(struct nvmet_subsys *subsys) in nvmet_passthru_ctrl_enable() argument
504 mutex_lock(&subsys->lock); in nvmet_passthru_ctrl_enable()
505 if (!subsys->passthru_ctrl_path) in nvmet_passthru_ctrl_enable()
507 if (subsys->passthru_ctrl) in nvmet_passthru_ctrl_enable()
510 if (subsys->nr_namespaces) { in nvmet_passthru_ctrl_enable()
515 file = filp_open(subsys->passthru_ctrl_path, O_RDWR, 0); in nvmet_passthru_ctrl_enable()
524 subsys->passthru_ctrl_path); in nvmet_passthru_ctrl_enable()
530 subsys, GFP_KERNEL); in nvmet_passthru_ctrl_enable()
539 subsys->passthru_ctrl = ctrl; in nvmet_passthru_ctrl_enable()
540 subsys->ver = ctrl->vs; in nvmet_passthru_ctrl_enable()
542 if (subsys->ver < NVME_VS(1, 2, 1)) { in nvmet_passthru_ctrl_enable()
544 NVME_MAJOR(subsys->ver), NVME_MINOR(subsys->ver), in nvmet_passthru_ctrl_enable()
545 NVME_TERTIARY(subsys->ver)); in nvmet_passthru_ctrl_enable()
546 subsys->ver = NVME_VS(1, 2, 1); in nvmet_passthru_ctrl_enable()
549 __module_get(subsys->passthru_ctrl->ops->module); in nvmet_passthru_ctrl_enable()
555 mutex_unlock(&subsys->lock); in nvmet_passthru_ctrl_enable()
559 static void __nvmet_passthru_ctrl_disable(struct nvmet_subsys *subsys) in __nvmet_passthru_ctrl_disable() argument
561 if (subsys->passthru_ctrl) { in __nvmet_passthru_ctrl_disable()
562 xa_erase(&passthru_subsystems, subsys->passthru_ctrl->cntlid); in __nvmet_passthru_ctrl_disable()
563 module_put(subsys->passthru_ctrl->ops->module); in __nvmet_passthru_ctrl_disable()
564 nvme_put_ctrl(subsys->passthru_ctrl); in __nvmet_passthru_ctrl_disable()
566 subsys->passthru_ctrl = NULL; in __nvmet_passthru_ctrl_disable()
567 subsys->ver = NVMET_DEFAULT_VS; in __nvmet_passthru_ctrl_disable()
570 void nvmet_passthru_ctrl_disable(struct nvmet_subsys *subsys) in nvmet_passthru_ctrl_disable() argument
572 mutex_lock(&subsys->lock); in nvmet_passthru_ctrl_disable()
573 __nvmet_passthru_ctrl_disable(subsys); in nvmet_passthru_ctrl_disable()
574 mutex_unlock(&subsys->lock); in nvmet_passthru_ctrl_disable()
577 void nvmet_passthru_subsys_free(struct nvmet_subsys *subsys) in nvmet_passthru_subsys_free() argument
579 mutex_lock(&subsys->lock); in nvmet_passthru_subsys_free()
580 __nvmet_passthru_ctrl_disable(subsys); in nvmet_passthru_subsys_free()
581 mutex_unlock(&subsys->lock); in nvmet_passthru_subsys_free()
582 kfree(subsys->passthru_ctrl_path); in nvmet_passthru_subsys_free()