Lines Matching refs:subsys

346 	struct nvmet_subsys *subsys = ns->subsys;  in nvmet_ns_device_path_store()  local
350 mutex_lock(&subsys->lock); in nvmet_ns_device_path_store()
366 mutex_unlock(&subsys->lock); in nvmet_ns_device_path_store()
370 mutex_unlock(&subsys->lock); in nvmet_ns_device_path_store()
393 mutex_lock(&ns->subsys->lock); in nvmet_ns_p2pmem_store()
410 mutex_unlock(&ns->subsys->lock); in nvmet_ns_p2pmem_store()
427 struct nvmet_subsys *subsys = ns->subsys; in nvmet_ns_device_uuid_store() local
430 mutex_lock(&subsys->lock); in nvmet_ns_device_uuid_store()
440 mutex_unlock(&subsys->lock); in nvmet_ns_device_uuid_store()
455 struct nvmet_subsys *subsys = ns->subsys; in nvmet_ns_device_nguid_store() local
461 mutex_lock(&subsys->lock); in nvmet_ns_device_nguid_store()
486 mutex_unlock(&subsys->lock); in nvmet_ns_device_nguid_store()
520 nvmet_send_ana_event(ns->subsys, NULL); in nvmet_ns_ana_grpid_store()
573 mutex_lock(&ns->subsys->lock); in nvmet_ns_buffered_io_store()
576 mutex_unlock(&ns->subsys->lock); in nvmet_ns_buffered_io_store()
581 mutex_unlock(&ns->subsys->lock); in nvmet_ns_buffered_io_store()
599 mutex_lock(&ns->subsys->lock); in nvmet_ns_revalidate_size_store()
602 mutex_unlock(&ns->subsys->lock); in nvmet_ns_revalidate_size_store()
606 nvmet_ns_changed(ns->subsys, ns->nsid); in nvmet_ns_revalidate_size_store()
607 mutex_unlock(&ns->subsys->lock); in nvmet_ns_revalidate_size_store()
627 bool nvmet_subsys_nsid_exists(struct nvmet_subsys *subsys, u32 nsid) in nvmet_subsys_nsid_exists() argument
633 mutex_lock(&subsys->namespaces_group.cg_subsys->su_mutex); in nvmet_subsys_nsid_exists()
634 ns_item = config_group_find_item(&subsys->namespaces_group, name); in nvmet_subsys_nsid_exists()
635 mutex_unlock(&subsys->namespaces_group.cg_subsys->su_mutex); in nvmet_subsys_nsid_exists()
659 struct nvmet_subsys *subsys = namespaces_to_subsys(&group->cg_item); in nvmet_ns_make() local
675 ns = nvmet_ns_alloc(subsys, nsid); in nvmet_ns_make()
680 pr_info("adding nsid %d to subsystem %s\n", nsid, subsys->subsysnqn); in nvmet_ns_make()
701 struct nvmet_subsys *subsys = to_subsys(item->ci_parent); in nvmet_passthru_device_path_show() local
703 return snprintf(page, PAGE_SIZE, "%s\n", subsys->passthru_ctrl_path); in nvmet_passthru_device_path_show()
709 struct nvmet_subsys *subsys = to_subsys(item->ci_parent); in nvmet_passthru_device_path_store() local
713 mutex_lock(&subsys->lock); in nvmet_passthru_device_path_store()
716 if (subsys->passthru_ctrl) in nvmet_passthru_device_path_store()
724 kfree(subsys->passthru_ctrl_path); in nvmet_passthru_device_path_store()
726 subsys->passthru_ctrl_path = kstrndup(page, len, GFP_KERNEL); in nvmet_passthru_device_path_store()
727 if (!subsys->passthru_ctrl_path) in nvmet_passthru_device_path_store()
730 mutex_unlock(&subsys->lock); in nvmet_passthru_device_path_store()
734 mutex_unlock(&subsys->lock); in nvmet_passthru_device_path_store()
742 struct nvmet_subsys *subsys = to_subsys(item->ci_parent); in nvmet_passthru_enable_show() local
744 return sprintf(page, "%d\n", subsys->passthru_ctrl ? 1 : 0); in nvmet_passthru_enable_show()
750 struct nvmet_subsys *subsys = to_subsys(item->ci_parent); in nvmet_passthru_enable_store() local
758 ret = nvmet_passthru_ctrl_enable(subsys); in nvmet_passthru_enable_store()
760 nvmet_passthru_ctrl_disable(subsys); in nvmet_passthru_enable_store()
775 struct nvmet_subsys *subsys = to_subsys(item->ci_parent); in nvmet_passthru_admin_timeout_store() local
780 subsys->admin_timeout = timeout; in nvmet_passthru_admin_timeout_store()
794 struct nvmet_subsys *subsys = to_subsys(item->ci_parent); in nvmet_passthru_io_timeout_store() local
799 subsys->io_timeout = timeout; in nvmet_passthru_io_timeout_store()
813 struct nvmet_subsys *subsys = to_subsys(item->ci_parent); in nvmet_passthru_clear_ids_store() local
818 subsys->clear_ids = clear_ids; in nvmet_passthru_clear_ids_store()
837 static void nvmet_add_passthru_group(struct nvmet_subsys *subsys) in nvmet_add_passthru_group() argument
839 config_group_init_type_name(&subsys->passthru_group, in nvmet_add_passthru_group()
841 configfs_add_default_group(&subsys->passthru_group, in nvmet_add_passthru_group()
842 &subsys->group); in nvmet_add_passthru_group()
847 static void nvmet_add_passthru_group(struct nvmet_subsys *subsys) in nvmet_add_passthru_group() argument
857 struct nvmet_subsys *subsys; in nvmet_port_subsys_allow_link() local
865 subsys = to_subsys(target); in nvmet_port_subsys_allow_link()
869 link->subsys = subsys; in nvmet_port_subsys_allow_link()
874 if (p->subsys == subsys) in nvmet_port_subsys_allow_link()
885 nvmet_port_disc_changed(port, subsys); in nvmet_port_subsys_allow_link()
900 struct nvmet_subsys *subsys = to_subsys(target); in nvmet_port_subsys_drop_link() local
905 if (p->subsys == subsys) in nvmet_port_subsys_drop_link()
913 nvmet_port_del_ctrls(port, subsys); in nvmet_port_subsys_drop_link()
914 nvmet_port_disc_changed(port, subsys); in nvmet_port_subsys_drop_link()
935 struct nvmet_subsys *subsys = to_subsys(parent->ci_parent); in nvmet_allowed_hosts_allow_link() local
953 if (subsys->allow_any_host) { in nvmet_allowed_hosts_allow_link()
959 list_for_each_entry(p, &subsys->hosts, entry) { in nvmet_allowed_hosts_allow_link()
963 list_add_tail(&link->entry, &subsys->hosts); in nvmet_allowed_hosts_allow_link()
964 nvmet_subsys_disc_changed(subsys, host); in nvmet_allowed_hosts_allow_link()
977 struct nvmet_subsys *subsys = to_subsys(parent->ci_parent); in nvmet_allowed_hosts_drop_link() local
982 list_for_each_entry(p, &subsys->hosts, entry) { in nvmet_allowed_hosts_drop_link()
991 nvmet_subsys_disc_changed(subsys, host); in nvmet_allowed_hosts_drop_link()
1017 struct nvmet_subsys *subsys = to_subsys(item); in nvmet_subsys_attr_allow_any_host_store() local
1025 if (allow_any_host && !list_empty(&subsys->hosts)) { in nvmet_subsys_attr_allow_any_host_store()
1031 if (subsys->allow_any_host != allow_any_host) { in nvmet_subsys_attr_allow_any_host_store()
1032 subsys->allow_any_host = allow_any_host; in nvmet_subsys_attr_allow_any_host_store()
1033 nvmet_subsys_disc_changed(subsys, NULL); in nvmet_subsys_attr_allow_any_host_store()
1046 struct nvmet_subsys *subsys = to_subsys(item); in nvmet_subsys_attr_version_show() local
1048 if (NVME_TERTIARY(subsys->ver)) in nvmet_subsys_attr_version_show()
1050 NVME_MAJOR(subsys->ver), in nvmet_subsys_attr_version_show()
1051 NVME_MINOR(subsys->ver), in nvmet_subsys_attr_version_show()
1052 NVME_TERTIARY(subsys->ver)); in nvmet_subsys_attr_version_show()
1055 NVME_MAJOR(subsys->ver), in nvmet_subsys_attr_version_show()
1056 NVME_MINOR(subsys->ver)); in nvmet_subsys_attr_version_show()
1060 nvmet_subsys_attr_version_store_locked(struct nvmet_subsys *subsys, in nvmet_subsys_attr_version_store_locked() argument
1066 if (subsys->subsys_discovered) { in nvmet_subsys_attr_version_store_locked()
1067 if (NVME_TERTIARY(subsys->ver)) in nvmet_subsys_attr_version_store_locked()
1069 NVME_MAJOR(subsys->ver), in nvmet_subsys_attr_version_store_locked()
1070 NVME_MINOR(subsys->ver), in nvmet_subsys_attr_version_store_locked()
1071 NVME_TERTIARY(subsys->ver)); in nvmet_subsys_attr_version_store_locked()
1074 NVME_MAJOR(subsys->ver), in nvmet_subsys_attr_version_store_locked()
1075 NVME_MINOR(subsys->ver)); in nvmet_subsys_attr_version_store_locked()
1080 if (nvmet_is_passthru_subsys(subsys)) in nvmet_subsys_attr_version_store_locked()
1087 subsys->ver = NVME_VS(major, minor, tertiary); in nvmet_subsys_attr_version_store_locked()
1095 struct nvmet_subsys *subsys = to_subsys(item); in nvmet_subsys_attr_version_store() local
1099 mutex_lock(&subsys->lock); in nvmet_subsys_attr_version_store()
1100 ret = nvmet_subsys_attr_version_store_locked(subsys, page, count); in nvmet_subsys_attr_version_store()
1101 mutex_unlock(&subsys->lock); in nvmet_subsys_attr_version_store()
1117 struct nvmet_subsys *subsys = to_subsys(item); in nvmet_subsys_attr_serial_show() local
1120 NVMET_SN_MAX_SIZE, subsys->serial); in nvmet_subsys_attr_serial_show()
1124 nvmet_subsys_attr_serial_store_locked(struct nvmet_subsys *subsys, in nvmet_subsys_attr_serial_store_locked() argument
1129 if (subsys->subsys_discovered) { in nvmet_subsys_attr_serial_store_locked()
1131 subsys->serial); in nvmet_subsys_attr_serial_store_locked()
1148 memcpy_and_pad(subsys->serial, NVMET_SN_MAX_SIZE, page, len, ' '); in nvmet_subsys_attr_serial_store_locked()
1156 struct nvmet_subsys *subsys = to_subsys(item); in nvmet_subsys_attr_serial_store() local
1160 mutex_lock(&subsys->lock); in nvmet_subsys_attr_serial_store()
1161 ret = nvmet_subsys_attr_serial_store_locked(subsys, page, count); in nvmet_subsys_attr_serial_store()
1162 mutex_unlock(&subsys->lock); in nvmet_subsys_attr_serial_store()
1232 struct nvmet_subsys *subsys = to_subsys(item); in nvmet_subsys_attr_model_show() local
1234 return snprintf(page, PAGE_SIZE, "%s\n", subsys->model_number); in nvmet_subsys_attr_model_show()
1237 static ssize_t nvmet_subsys_attr_model_store_locked(struct nvmet_subsys *subsys, in nvmet_subsys_attr_model_store_locked() argument
1243 if (subsys->subsys_discovered) { in nvmet_subsys_attr_model_store_locked()
1245 subsys->model_number); in nvmet_subsys_attr_model_store_locked()
1267 kfree(subsys->model_number); in nvmet_subsys_attr_model_store_locked()
1268 subsys->model_number = val; in nvmet_subsys_attr_model_store_locked()
1275 struct nvmet_subsys *subsys = to_subsys(item); in nvmet_subsys_attr_model_store() local
1279 mutex_lock(&subsys->lock); in nvmet_subsys_attr_model_store()
1280 ret = nvmet_subsys_attr_model_store_locked(subsys, page, count); in nvmet_subsys_attr_model_store()
1281 mutex_unlock(&subsys->lock); in nvmet_subsys_attr_model_store()
1291 struct nvmet_subsys *subsys = to_subsys(item); in nvmet_subsys_attr_ieee_oui_show() local
1293 return sysfs_emit(page, "0x%06x\n", subsys->ieee_oui); in nvmet_subsys_attr_ieee_oui_show()
1296 static ssize_t nvmet_subsys_attr_ieee_oui_store_locked(struct nvmet_subsys *subsys, in nvmet_subsys_attr_ieee_oui_store_locked() argument
1302 if (subsys->subsys_discovered) { in nvmet_subsys_attr_ieee_oui_store_locked()
1304 subsys->ieee_oui); in nvmet_subsys_attr_ieee_oui_store_locked()
1315 subsys->ieee_oui = val; in nvmet_subsys_attr_ieee_oui_store_locked()
1323 struct nvmet_subsys *subsys = to_subsys(item); in nvmet_subsys_attr_ieee_oui_store() local
1327 mutex_lock(&subsys->lock); in nvmet_subsys_attr_ieee_oui_store()
1328 ret = nvmet_subsys_attr_ieee_oui_store_locked(subsys, page, count); in nvmet_subsys_attr_ieee_oui_store()
1329 mutex_unlock(&subsys->lock); in nvmet_subsys_attr_ieee_oui_store()
1339 struct nvmet_subsys *subsys = to_subsys(item); in nvmet_subsys_attr_firmware_show() local
1341 return sysfs_emit(page, "%s\n", subsys->firmware_rev); in nvmet_subsys_attr_firmware_show()
1344 static ssize_t nvmet_subsys_attr_firmware_store_locked(struct nvmet_subsys *subsys, in nvmet_subsys_attr_firmware_store_locked() argument
1350 if (subsys->subsys_discovered) { in nvmet_subsys_attr_firmware_store_locked()
1352 subsys->firmware_rev); in nvmet_subsys_attr_firmware_store_locked()
1375 kfree(subsys->firmware_rev); in nvmet_subsys_attr_firmware_store_locked()
1377 subsys->firmware_rev = val; in nvmet_subsys_attr_firmware_store_locked()
1385 struct nvmet_subsys *subsys = to_subsys(item); in nvmet_subsys_attr_firmware_store() local
1389 mutex_lock(&subsys->lock); in nvmet_subsys_attr_firmware_store()
1390 ret = nvmet_subsys_attr_firmware_store_locked(subsys, page, count); in nvmet_subsys_attr_firmware_store()
1391 mutex_unlock(&subsys->lock); in nvmet_subsys_attr_firmware_store()
1408 struct nvmet_subsys *subsys = to_subsys(item); in nvmet_subsys_attr_pi_enable_store() local
1414 subsys->pi_support = pi_enable; in nvmet_subsys_attr_pi_enable_store()
1429 struct nvmet_subsys *subsys = to_subsys(item); in nvmet_subsys_attr_qid_max_store() local
1440 subsys->max_qid = qid_max; in nvmet_subsys_attr_qid_max_store()
1443 list_for_each_entry(ctrl, &subsys->ctrls, subsys_entry) in nvmet_subsys_attr_qid_max_store()
1472 struct nvmet_subsys *subsys = to_subsys(item); in nvmet_subsys_release() local
1474 nvmet_subsys_del_ctrls(subsys); in nvmet_subsys_release()
1475 nvmet_subsys_put(subsys); in nvmet_subsys_release()
1491 struct nvmet_subsys *subsys; in nvmet_subsys_make() local
1498 subsys = nvmet_subsys_alloc(name, NVME_NQN_NVME); in nvmet_subsys_make()
1499 if (IS_ERR(subsys)) in nvmet_subsys_make()
1500 return ERR_CAST(subsys); in nvmet_subsys_make()
1502 config_group_init_type_name(&subsys->group, name, &nvmet_subsys_type); in nvmet_subsys_make()
1504 config_group_init_type_name(&subsys->namespaces_group, in nvmet_subsys_make()
1506 configfs_add_default_group(&subsys->namespaces_group, &subsys->group); in nvmet_subsys_make()
1508 config_group_init_type_name(&subsys->allowed_hosts_group, in nvmet_subsys_make()
1510 configfs_add_default_group(&subsys->allowed_hosts_group, in nvmet_subsys_make()
1511 &subsys->group); in nvmet_subsys_make()
1513 nvmet_add_passthru_group(subsys); in nvmet_subsys_make()
1515 return &subsys->group; in nvmet_subsys_make()