Lines Matching full:subsys

505 	struct nvmet_subsys *subsys = ns->subsys;  in nvmet_ns_device_path_store()  local
509 mutex_lock(&subsys->lock); in nvmet_ns_device_path_store()
525 mutex_unlock(&subsys->lock); in nvmet_ns_device_path_store()
529 mutex_unlock(&subsys->lock); in nvmet_ns_device_path_store()
552 mutex_lock(&ns->subsys->lock); in nvmet_ns_p2pmem_store()
569 mutex_unlock(&ns->subsys->lock); in nvmet_ns_p2pmem_store()
586 struct nvmet_subsys *subsys = ns->subsys; in nvmet_ns_device_uuid_store() local
589 mutex_lock(&subsys->lock); in nvmet_ns_device_uuid_store()
599 mutex_unlock(&subsys->lock); in nvmet_ns_device_uuid_store()
614 struct nvmet_subsys *subsys = ns->subsys; in nvmet_ns_device_nguid_store() local
620 mutex_lock(&subsys->lock); in nvmet_ns_device_nguid_store()
645 mutex_unlock(&subsys->lock); in nvmet_ns_device_nguid_store()
679 nvmet_send_ana_event(ns->subsys, NULL); in nvmet_ns_ana_grpid_store()
702 * window where it releases the subsys-lock, giving a chance to in nvmet_ns_enable_store()
732 mutex_lock(&ns->subsys->lock); in nvmet_ns_buffered_io_store()
735 mutex_unlock(&ns->subsys->lock); in nvmet_ns_buffered_io_store()
740 mutex_unlock(&ns->subsys->lock); in nvmet_ns_buffered_io_store()
758 mutex_lock(&ns->subsys->lock); in nvmet_ns_revalidate_size_store()
761 mutex_unlock(&ns->subsys->lock); in nvmet_ns_revalidate_size_store()
765 nvmet_ns_changed(ns->subsys, ns->nsid); in nvmet_ns_revalidate_size_store()
766 mutex_unlock(&ns->subsys->lock); in nvmet_ns_revalidate_size_store()
786 bool nvmet_subsys_nsid_exists(struct nvmet_subsys *subsys, u32 nsid) in nvmet_subsys_nsid_exists() argument
792 mutex_lock(&subsys->namespaces_group.cg_subsys->su_mutex); in nvmet_subsys_nsid_exists()
793 ns_item = config_group_find_item(&subsys->namespaces_group, name); in nvmet_subsys_nsid_exists()
794 mutex_unlock(&subsys->namespaces_group.cg_subsys->su_mutex); in nvmet_subsys_nsid_exists()
818 struct nvmet_subsys *subsys = namespaces_to_subsys(&group->cg_item); in nvmet_ns_make() local
834 ns = nvmet_ns_alloc(subsys, nsid); in nvmet_ns_make()
839 pr_info("adding nsid %d to subsystem %s\n", nsid, subsys->subsysnqn); in nvmet_ns_make()
860 struct nvmet_subsys *subsys = to_subsys(item->ci_parent); in nvmet_passthru_device_path_show() local
862 return snprintf(page, PAGE_SIZE, "%s\n", subsys->passthru_ctrl_path); in nvmet_passthru_device_path_show()
868 struct nvmet_subsys *subsys = to_subsys(item->ci_parent); in nvmet_passthru_device_path_store() local
872 mutex_lock(&subsys->lock); in nvmet_passthru_device_path_store()
875 if (subsys->passthru_ctrl) in nvmet_passthru_device_path_store()
883 kfree(subsys->passthru_ctrl_path); in nvmet_passthru_device_path_store()
885 subsys->passthru_ctrl_path = kstrndup(page, len, GFP_KERNEL); in nvmet_passthru_device_path_store()
886 if (!subsys->passthru_ctrl_path) in nvmet_passthru_device_path_store()
889 mutex_unlock(&subsys->lock); in nvmet_passthru_device_path_store()
893 mutex_unlock(&subsys->lock); in nvmet_passthru_device_path_store()
901 struct nvmet_subsys *subsys = to_subsys(item->ci_parent); in nvmet_passthru_enable_show() local
903 return sprintf(page, "%d\n", subsys->passthru_ctrl ? 1 : 0); in nvmet_passthru_enable_show()
909 struct nvmet_subsys *subsys = to_subsys(item->ci_parent); in nvmet_passthru_enable_store() local
917 ret = nvmet_passthru_ctrl_enable(subsys); in nvmet_passthru_enable_store()
919 nvmet_passthru_ctrl_disable(subsys); in nvmet_passthru_enable_store()
934 struct nvmet_subsys *subsys = to_subsys(item->ci_parent); in nvmet_passthru_admin_timeout_store() local
939 subsys->admin_timeout = timeout; in nvmet_passthru_admin_timeout_store()
953 struct nvmet_subsys *subsys = to_subsys(item->ci_parent); in nvmet_passthru_io_timeout_store() local
958 subsys->io_timeout = timeout; in nvmet_passthru_io_timeout_store()
972 struct nvmet_subsys *subsys = to_subsys(item->ci_parent); in nvmet_passthru_clear_ids_store() local
977 subsys->clear_ids = clear_ids; in nvmet_passthru_clear_ids_store()
996 static void nvmet_add_passthru_group(struct nvmet_subsys *subsys) in nvmet_add_passthru_group() argument
998 config_group_init_type_name(&subsys->passthru_group, in nvmet_add_passthru_group()
1000 configfs_add_default_group(&subsys->passthru_group, in nvmet_add_passthru_group()
1001 &subsys->group); in nvmet_add_passthru_group()
1006 static void nvmet_add_passthru_group(struct nvmet_subsys *subsys) in nvmet_add_passthru_group() argument
1016 struct nvmet_subsys *subsys; in nvmet_port_subsys_allow_link() local
1024 subsys = to_subsys(target); in nvmet_port_subsys_allow_link()
1028 link->subsys = subsys; in nvmet_port_subsys_allow_link()
1033 if (p->subsys == subsys) in nvmet_port_subsys_allow_link()
1044 nvmet_port_disc_changed(port, subsys); in nvmet_port_subsys_allow_link()
1059 struct nvmet_subsys *subsys = to_subsys(target); in nvmet_port_subsys_drop_link() local
1064 if (p->subsys == subsys) in nvmet_port_subsys_drop_link()
1072 nvmet_port_del_ctrls(port, subsys); in nvmet_port_subsys_drop_link()
1073 nvmet_port_disc_changed(port, subsys); in nvmet_port_subsys_drop_link()
1094 struct nvmet_subsys *subsys = to_subsys(parent->ci_parent); in nvmet_allowed_hosts_allow_link() local
1112 if (subsys->allow_any_host) { in nvmet_allowed_hosts_allow_link()
1118 list_for_each_entry(p, &subsys->hosts, entry) { in nvmet_allowed_hosts_allow_link()
1122 list_add_tail(&link->entry, &subsys->hosts); in nvmet_allowed_hosts_allow_link()
1123 nvmet_subsys_disc_changed(subsys, host); in nvmet_allowed_hosts_allow_link()
1136 struct nvmet_subsys *subsys = to_subsys(parent->ci_parent); in nvmet_allowed_hosts_drop_link() local
1141 list_for_each_entry(p, &subsys->hosts, entry) { in nvmet_allowed_hosts_drop_link()
1150 nvmet_subsys_disc_changed(subsys, host); in nvmet_allowed_hosts_drop_link()
1176 struct nvmet_subsys *subsys = to_subsys(item); in nvmet_subsys_attr_allow_any_host_store() local
1184 if (allow_any_host && !list_empty(&subsys->hosts)) { in nvmet_subsys_attr_allow_any_host_store()
1190 if (subsys->allow_any_host != allow_any_host) { in nvmet_subsys_attr_allow_any_host_store()
1191 subsys->allow_any_host = allow_any_host; in nvmet_subsys_attr_allow_any_host_store()
1192 nvmet_subsys_disc_changed(subsys, NULL); in nvmet_subsys_attr_allow_any_host_store()
1205 struct nvmet_subsys *subsys = to_subsys(item); in nvmet_subsys_attr_version_show() local
1207 if (NVME_TERTIARY(subsys->ver)) in nvmet_subsys_attr_version_show()
1209 NVME_MAJOR(subsys->ver), in nvmet_subsys_attr_version_show()
1210 NVME_MINOR(subsys->ver), in nvmet_subsys_attr_version_show()
1211 NVME_TERTIARY(subsys->ver)); in nvmet_subsys_attr_version_show()
1214 NVME_MAJOR(subsys->ver), in nvmet_subsys_attr_version_show()
1215 NVME_MINOR(subsys->ver)); in nvmet_subsys_attr_version_show()
1219 nvmet_subsys_attr_version_store_locked(struct nvmet_subsys *subsys, in nvmet_subsys_attr_version_store_locked() argument
1225 if (subsys->subsys_discovered) { in nvmet_subsys_attr_version_store_locked()
1226 if (NVME_TERTIARY(subsys->ver)) in nvmet_subsys_attr_version_store_locked()
1228 NVME_MAJOR(subsys->ver), in nvmet_subsys_attr_version_store_locked()
1229 NVME_MINOR(subsys->ver), in nvmet_subsys_attr_version_store_locked()
1230 NVME_TERTIARY(subsys->ver)); in nvmet_subsys_attr_version_store_locked()
1233 NVME_MAJOR(subsys->ver), in nvmet_subsys_attr_version_store_locked()
1234 NVME_MINOR(subsys->ver)); in nvmet_subsys_attr_version_store_locked()
1239 if (nvmet_is_passthru_subsys(subsys)) in nvmet_subsys_attr_version_store_locked()
1246 subsys->ver = NVME_VS(major, minor, tertiary); in nvmet_subsys_attr_version_store_locked()
1254 struct nvmet_subsys *subsys = to_subsys(item); in nvmet_subsys_attr_version_store() local
1258 mutex_lock(&subsys->lock); in nvmet_subsys_attr_version_store()
1259 ret = nvmet_subsys_attr_version_store_locked(subsys, page, count); in nvmet_subsys_attr_version_store()
1260 mutex_unlock(&subsys->lock); in nvmet_subsys_attr_version_store()
1276 struct nvmet_subsys *subsys = to_subsys(item); in nvmet_subsys_attr_serial_show() local
1279 NVMET_SN_MAX_SIZE, subsys->serial); in nvmet_subsys_attr_serial_show()
1283 nvmet_subsys_attr_serial_store_locked(struct nvmet_subsys *subsys, in nvmet_subsys_attr_serial_store_locked() argument
1288 if (subsys->subsys_discovered) { in nvmet_subsys_attr_serial_store_locked()
1290 subsys->serial); in nvmet_subsys_attr_serial_store_locked()
1307 memcpy_and_pad(subsys->serial, NVMET_SN_MAX_SIZE, page, len, ' '); in nvmet_subsys_attr_serial_store_locked()
1315 struct nvmet_subsys *subsys = to_subsys(item); in nvmet_subsys_attr_serial_store() local
1319 mutex_lock(&subsys->lock); in nvmet_subsys_attr_serial_store()
1320 ret = nvmet_subsys_attr_serial_store_locked(subsys, page, count); in nvmet_subsys_attr_serial_store()
1321 mutex_unlock(&subsys->lock); in nvmet_subsys_attr_serial_store()
1391 struct nvmet_subsys *subsys = to_subsys(item); in nvmet_subsys_attr_model_show() local
1393 return snprintf(page, PAGE_SIZE, "%s\n", subsys->model_number); in nvmet_subsys_attr_model_show()
1396 static ssize_t nvmet_subsys_attr_model_store_locked(struct nvmet_subsys *subsys, in nvmet_subsys_attr_model_store_locked() argument
1402 if (subsys->subsys_discovered) { in nvmet_subsys_attr_model_store_locked()
1404 subsys->model_number); in nvmet_subsys_attr_model_store_locked()
1426 kfree(subsys->model_number); in nvmet_subsys_attr_model_store_locked()
1427 subsys->model_number = val; in nvmet_subsys_attr_model_store_locked()
1434 struct nvmet_subsys *subsys = to_subsys(item); in nvmet_subsys_attr_model_store() local
1438 mutex_lock(&subsys->lock); in nvmet_subsys_attr_model_store()
1439 ret = nvmet_subsys_attr_model_store_locked(subsys, page, count); in nvmet_subsys_attr_model_store()
1440 mutex_unlock(&subsys->lock); in nvmet_subsys_attr_model_store()
1450 struct nvmet_subsys *subsys = to_subsys(item); in nvmet_subsys_attr_ieee_oui_show() local
1452 return sysfs_emit(page, "0x%06x\n", subsys->ieee_oui); in nvmet_subsys_attr_ieee_oui_show()
1455 static ssize_t nvmet_subsys_attr_ieee_oui_store_locked(struct nvmet_subsys *subsys, in nvmet_subsys_attr_ieee_oui_store_locked() argument
1461 if (subsys->subsys_discovered) { in nvmet_subsys_attr_ieee_oui_store_locked()
1463 subsys->ieee_oui); in nvmet_subsys_attr_ieee_oui_store_locked()
1474 subsys->ieee_oui = val; in nvmet_subsys_attr_ieee_oui_store_locked()
1482 struct nvmet_subsys *subsys = to_subsys(item); in nvmet_subsys_attr_ieee_oui_store() local
1486 mutex_lock(&subsys->lock); in nvmet_subsys_attr_ieee_oui_store()
1487 ret = nvmet_subsys_attr_ieee_oui_store_locked(subsys, page, count); in nvmet_subsys_attr_ieee_oui_store()
1488 mutex_unlock(&subsys->lock); in nvmet_subsys_attr_ieee_oui_store()
1498 struct nvmet_subsys *subsys = to_subsys(item); in nvmet_subsys_attr_firmware_show() local
1500 return sysfs_emit(page, "%s\n", subsys->firmware_rev); in nvmet_subsys_attr_firmware_show()
1503 static ssize_t nvmet_subsys_attr_firmware_store_locked(struct nvmet_subsys *subsys, in nvmet_subsys_attr_firmware_store_locked() argument
1509 if (subsys->subsys_discovered) { in nvmet_subsys_attr_firmware_store_locked()
1511 subsys->firmware_rev); in nvmet_subsys_attr_firmware_store_locked()
1534 kfree(subsys->firmware_rev); in nvmet_subsys_attr_firmware_store_locked()
1536 subsys->firmware_rev = val; in nvmet_subsys_attr_firmware_store_locked()
1544 struct nvmet_subsys *subsys = to_subsys(item); in nvmet_subsys_attr_firmware_store() local
1548 mutex_lock(&subsys->lock); in nvmet_subsys_attr_firmware_store()
1549 ret = nvmet_subsys_attr_firmware_store_locked(subsys, page, count); in nvmet_subsys_attr_firmware_store()
1550 mutex_unlock(&subsys->lock); in nvmet_subsys_attr_firmware_store()
1567 struct nvmet_subsys *subsys = to_subsys(item); in nvmet_subsys_attr_pi_enable_store() local
1573 subsys->pi_support = pi_enable; in nvmet_subsys_attr_pi_enable_store()
1588 struct nvmet_subsys *subsys = to_subsys(item); in nvmet_subsys_attr_qid_max_store() local
1599 subsys->max_qid = qid_max; in nvmet_subsys_attr_qid_max_store()
1602 list_for_each_entry(ctrl, &subsys->ctrls, subsys_entry) in nvmet_subsys_attr_qid_max_store()
1631 struct nvmet_subsys *subsys = to_subsys(item); in nvmet_subsys_release() local
1633 nvmet_subsys_del_ctrls(subsys); in nvmet_subsys_release()
1634 nvmet_subsys_put(subsys); in nvmet_subsys_release()
1650 struct nvmet_subsys *subsys; in nvmet_subsys_make() local
1662 subsys = nvmet_subsys_alloc(name, NVME_NQN_NVME); in nvmet_subsys_make()
1663 if (IS_ERR(subsys)) in nvmet_subsys_make()
1664 return ERR_CAST(subsys); in nvmet_subsys_make()
1666 config_group_init_type_name(&subsys->group, name, &nvmet_subsys_type); in nvmet_subsys_make()
1668 config_group_init_type_name(&subsys->namespaces_group, in nvmet_subsys_make()
1670 configfs_add_default_group(&subsys->namespaces_group, &subsys->group); in nvmet_subsys_make()
1672 config_group_init_type_name(&subsys->allowed_hosts_group, in nvmet_subsys_make()
1674 configfs_add_default_group(&subsys->allowed_hosts_group, in nvmet_subsys_make()
1675 &subsys->group); in nvmet_subsys_make()
1677 nvmet_add_passthru_group(subsys); in nvmet_subsys_make()
1679 return &subsys->group; in nvmet_subsys_make()