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