Lines Matching refs:subsys

344 	struct nvmet_subsys *subsys = ns->subsys;  in nvmet_ns_device_path_store()  local
348 mutex_lock(&subsys->lock); in nvmet_ns_device_path_store()
364 mutex_unlock(&subsys->lock); in nvmet_ns_device_path_store()
368 mutex_unlock(&subsys->lock); in nvmet_ns_device_path_store()
391 mutex_lock(&ns->subsys->lock); in nvmet_ns_p2pmem_store()
408 mutex_unlock(&ns->subsys->lock); in nvmet_ns_p2pmem_store()
425 struct nvmet_subsys *subsys = ns->subsys; in nvmet_ns_device_uuid_store() local
428 mutex_lock(&subsys->lock); in nvmet_ns_device_uuid_store()
438 mutex_unlock(&subsys->lock); in nvmet_ns_device_uuid_store()
453 struct nvmet_subsys *subsys = ns->subsys; in nvmet_ns_device_nguid_store() local
459 mutex_lock(&subsys->lock); in nvmet_ns_device_nguid_store()
484 mutex_unlock(&subsys->lock); in nvmet_ns_device_nguid_store()
517 nvmet_send_ana_event(ns->subsys, NULL); in nvmet_ns_ana_grpid_store()
562 mutex_lock(&ns->subsys->lock); in nvmet_ns_buffered_io_store()
565 mutex_unlock(&ns->subsys->lock); in nvmet_ns_buffered_io_store()
570 mutex_unlock(&ns->subsys->lock); in nvmet_ns_buffered_io_store()
588 mutex_lock(&ns->subsys->lock); in nvmet_ns_revalidate_size_store()
591 mutex_unlock(&ns->subsys->lock); in nvmet_ns_revalidate_size_store()
595 nvmet_ns_changed(ns->subsys, ns->nsid); in nvmet_ns_revalidate_size_store()
596 mutex_unlock(&ns->subsys->lock); in nvmet_ns_revalidate_size_store()
636 struct nvmet_subsys *subsys = namespaces_to_subsys(&group->cg_item); in nvmet_ns_make() local
652 ns = nvmet_ns_alloc(subsys, nsid); in nvmet_ns_make()
657 pr_info("adding nsid %d to subsystem %s\n", nsid, subsys->subsysnqn); in nvmet_ns_make()
678 struct nvmet_subsys *subsys = to_subsys(item->ci_parent); in nvmet_passthru_device_path_show() local
680 return snprintf(page, PAGE_SIZE, "%s\n", subsys->passthru_ctrl_path); in nvmet_passthru_device_path_show()
686 struct nvmet_subsys *subsys = to_subsys(item->ci_parent); in nvmet_passthru_device_path_store() local
690 mutex_lock(&subsys->lock); in nvmet_passthru_device_path_store()
693 if (subsys->passthru_ctrl) in nvmet_passthru_device_path_store()
701 kfree(subsys->passthru_ctrl_path); in nvmet_passthru_device_path_store()
703 subsys->passthru_ctrl_path = kstrndup(page, len, GFP_KERNEL); in nvmet_passthru_device_path_store()
704 if (!subsys->passthru_ctrl_path) in nvmet_passthru_device_path_store()
707 mutex_unlock(&subsys->lock); in nvmet_passthru_device_path_store()
711 mutex_unlock(&subsys->lock); in nvmet_passthru_device_path_store()
719 struct nvmet_subsys *subsys = to_subsys(item->ci_parent); in nvmet_passthru_enable_show() local
721 return sprintf(page, "%d\n", subsys->passthru_ctrl ? 1 : 0); in nvmet_passthru_enable_show()
727 struct nvmet_subsys *subsys = to_subsys(item->ci_parent); in nvmet_passthru_enable_store() local
735 ret = nvmet_passthru_ctrl_enable(subsys); in nvmet_passthru_enable_store()
737 nvmet_passthru_ctrl_disable(subsys); in nvmet_passthru_enable_store()
752 struct nvmet_subsys *subsys = to_subsys(item->ci_parent); in nvmet_passthru_admin_timeout_store() local
757 subsys->admin_timeout = timeout; in nvmet_passthru_admin_timeout_store()
771 struct nvmet_subsys *subsys = to_subsys(item->ci_parent); in nvmet_passthru_io_timeout_store() local
776 subsys->io_timeout = timeout; in nvmet_passthru_io_timeout_store()
790 struct nvmet_subsys *subsys = to_subsys(item->ci_parent); in nvmet_passthru_clear_ids_store() local
795 subsys->clear_ids = clear_ids; in nvmet_passthru_clear_ids_store()
814 static void nvmet_add_passthru_group(struct nvmet_subsys *subsys) in nvmet_add_passthru_group() argument
816 config_group_init_type_name(&subsys->passthru_group, in nvmet_add_passthru_group()
818 configfs_add_default_group(&subsys->passthru_group, in nvmet_add_passthru_group()
819 &subsys->group); in nvmet_add_passthru_group()
824 static void nvmet_add_passthru_group(struct nvmet_subsys *subsys) in nvmet_add_passthru_group() argument
834 struct nvmet_subsys *subsys; in nvmet_port_subsys_allow_link() local
842 subsys = to_subsys(target); in nvmet_port_subsys_allow_link()
846 link->subsys = subsys; in nvmet_port_subsys_allow_link()
851 if (p->subsys == subsys) in nvmet_port_subsys_allow_link()
862 nvmet_port_disc_changed(port, subsys); in nvmet_port_subsys_allow_link()
877 struct nvmet_subsys *subsys = to_subsys(target); in nvmet_port_subsys_drop_link() local
882 if (p->subsys == subsys) in nvmet_port_subsys_drop_link()
890 nvmet_port_del_ctrls(port, subsys); in nvmet_port_subsys_drop_link()
891 nvmet_port_disc_changed(port, subsys); in nvmet_port_subsys_drop_link()
912 struct nvmet_subsys *subsys = to_subsys(parent->ci_parent); in nvmet_allowed_hosts_allow_link() local
930 if (subsys->allow_any_host) { in nvmet_allowed_hosts_allow_link()
936 list_for_each_entry(p, &subsys->hosts, entry) { in nvmet_allowed_hosts_allow_link()
940 list_add_tail(&link->entry, &subsys->hosts); in nvmet_allowed_hosts_allow_link()
941 nvmet_subsys_disc_changed(subsys, host); in nvmet_allowed_hosts_allow_link()
954 struct nvmet_subsys *subsys = to_subsys(parent->ci_parent); in nvmet_allowed_hosts_drop_link() local
959 list_for_each_entry(p, &subsys->hosts, entry) { in nvmet_allowed_hosts_drop_link()
968 nvmet_subsys_disc_changed(subsys, host); in nvmet_allowed_hosts_drop_link()
994 struct nvmet_subsys *subsys = to_subsys(item); in nvmet_subsys_attr_allow_any_host_store() local
1002 if (allow_any_host && !list_empty(&subsys->hosts)) { in nvmet_subsys_attr_allow_any_host_store()
1008 if (subsys->allow_any_host != allow_any_host) { in nvmet_subsys_attr_allow_any_host_store()
1009 subsys->allow_any_host = allow_any_host; in nvmet_subsys_attr_allow_any_host_store()
1010 nvmet_subsys_disc_changed(subsys, NULL); in nvmet_subsys_attr_allow_any_host_store()
1023 struct nvmet_subsys *subsys = to_subsys(item); in nvmet_subsys_attr_version_show() local
1025 if (NVME_TERTIARY(subsys->ver)) in nvmet_subsys_attr_version_show()
1027 NVME_MAJOR(subsys->ver), in nvmet_subsys_attr_version_show()
1028 NVME_MINOR(subsys->ver), in nvmet_subsys_attr_version_show()
1029 NVME_TERTIARY(subsys->ver)); in nvmet_subsys_attr_version_show()
1032 NVME_MAJOR(subsys->ver), in nvmet_subsys_attr_version_show()
1033 NVME_MINOR(subsys->ver)); in nvmet_subsys_attr_version_show()
1037 nvmet_subsys_attr_version_store_locked(struct nvmet_subsys *subsys, in nvmet_subsys_attr_version_store_locked() argument
1043 if (subsys->subsys_discovered) { in nvmet_subsys_attr_version_store_locked()
1044 if (NVME_TERTIARY(subsys->ver)) in nvmet_subsys_attr_version_store_locked()
1046 NVME_MAJOR(subsys->ver), in nvmet_subsys_attr_version_store_locked()
1047 NVME_MINOR(subsys->ver), in nvmet_subsys_attr_version_store_locked()
1048 NVME_TERTIARY(subsys->ver)); in nvmet_subsys_attr_version_store_locked()
1051 NVME_MAJOR(subsys->ver), in nvmet_subsys_attr_version_store_locked()
1052 NVME_MINOR(subsys->ver)); in nvmet_subsys_attr_version_store_locked()
1057 if (nvmet_is_passthru_subsys(subsys)) in nvmet_subsys_attr_version_store_locked()
1064 subsys->ver = NVME_VS(major, minor, tertiary); in nvmet_subsys_attr_version_store_locked()
1072 struct nvmet_subsys *subsys = to_subsys(item); in nvmet_subsys_attr_version_store() local
1076 mutex_lock(&subsys->lock); in nvmet_subsys_attr_version_store()
1077 ret = nvmet_subsys_attr_version_store_locked(subsys, page, count); in nvmet_subsys_attr_version_store()
1078 mutex_unlock(&subsys->lock); in nvmet_subsys_attr_version_store()
1094 struct nvmet_subsys *subsys = to_subsys(item); in nvmet_subsys_attr_serial_show() local
1097 NVMET_SN_MAX_SIZE, subsys->serial); in nvmet_subsys_attr_serial_show()
1101 nvmet_subsys_attr_serial_store_locked(struct nvmet_subsys *subsys, in nvmet_subsys_attr_serial_store_locked() argument
1106 if (subsys->subsys_discovered) { in nvmet_subsys_attr_serial_store_locked()
1108 subsys->serial); in nvmet_subsys_attr_serial_store_locked()
1125 memcpy_and_pad(subsys->serial, NVMET_SN_MAX_SIZE, page, len, ' '); in nvmet_subsys_attr_serial_store_locked()
1133 struct nvmet_subsys *subsys = to_subsys(item); in nvmet_subsys_attr_serial_store() local
1137 mutex_lock(&subsys->lock); in nvmet_subsys_attr_serial_store()
1138 ret = nvmet_subsys_attr_serial_store_locked(subsys, page, count); in nvmet_subsys_attr_serial_store()
1139 mutex_unlock(&subsys->lock); in nvmet_subsys_attr_serial_store()
1209 struct nvmet_subsys *subsys = to_subsys(item); in nvmet_subsys_attr_model_show() local
1211 return snprintf(page, PAGE_SIZE, "%s\n", subsys->model_number); in nvmet_subsys_attr_model_show()
1214 static ssize_t nvmet_subsys_attr_model_store_locked(struct nvmet_subsys *subsys, in nvmet_subsys_attr_model_store_locked() argument
1220 if (subsys->subsys_discovered) { in nvmet_subsys_attr_model_store_locked()
1222 subsys->model_number); in nvmet_subsys_attr_model_store_locked()
1244 kfree(subsys->model_number); in nvmet_subsys_attr_model_store_locked()
1245 subsys->model_number = val; in nvmet_subsys_attr_model_store_locked()
1252 struct nvmet_subsys *subsys = to_subsys(item); in nvmet_subsys_attr_model_store() local
1256 mutex_lock(&subsys->lock); in nvmet_subsys_attr_model_store()
1257 ret = nvmet_subsys_attr_model_store_locked(subsys, page, count); in nvmet_subsys_attr_model_store()
1258 mutex_unlock(&subsys->lock); in nvmet_subsys_attr_model_store()
1275 struct nvmet_subsys *subsys = to_subsys(item); in nvmet_subsys_attr_pi_enable_store() local
1281 subsys->pi_support = pi_enable; in nvmet_subsys_attr_pi_enable_store()
1330 struct nvmet_subsys *subsys = to_subsys(item); in nvmet_subsys_release() local
1332 nvmet_subsys_del_ctrls(subsys); in nvmet_subsys_release()
1333 nvmet_subsys_put(subsys); in nvmet_subsys_release()
1349 struct nvmet_subsys *subsys; in nvmet_subsys_make() local
1356 subsys = nvmet_subsys_alloc(name, NVME_NQN_NVME); in nvmet_subsys_make()
1357 if (IS_ERR(subsys)) in nvmet_subsys_make()
1358 return ERR_CAST(subsys); in nvmet_subsys_make()
1360 config_group_init_type_name(&subsys->group, name, &nvmet_subsys_type); in nvmet_subsys_make()
1362 config_group_init_type_name(&subsys->namespaces_group, in nvmet_subsys_make()
1364 configfs_add_default_group(&subsys->namespaces_group, &subsys->group); in nvmet_subsys_make()
1366 config_group_init_type_name(&subsys->allowed_hosts_group, in nvmet_subsys_make()
1368 configfs_add_default_group(&subsys->allowed_hosts_group, in nvmet_subsys_make()
1369 &subsys->group); in nvmet_subsys_make()
1371 nvmet_add_passthru_group(subsys); in nvmet_subsys_make()
1373 return &subsys->group; in nvmet_subsys_make()