• Home
  • Raw
  • Download

Lines Matching refs:page

63 static ssize_t nvmet_addr_adrfam_show(struct config_item *item, char *page)  in nvmet_addr_adrfam_show()  argument
70 return snprintf(page, PAGE_SIZE, "%s\n", in nvmet_addr_adrfam_show()
74 return snprintf(page, PAGE_SIZE, "\n"); in nvmet_addr_adrfam_show()
78 const char *page, size_t count) in nvmet_addr_adrfam_store() argument
87 if (sysfs_streq(page, nvmet_addr_family[i].name)) in nvmet_addr_adrfam_store()
91 pr_err("Invalid value '%s' for adrfam\n", page); in nvmet_addr_adrfam_store()
102 char *page) in nvmet_addr_portid_show() argument
106 return snprintf(page, PAGE_SIZE, "%d\n", le16_to_cpu(portid)); in nvmet_addr_portid_show()
110 const char *page, size_t count) in nvmet_addr_portid_store() argument
115 if (kstrtou16(page, 0, &portid)) { in nvmet_addr_portid_store()
116 pr_err("Invalid value '%s' for portid\n", page); in nvmet_addr_portid_store()
130 char *page) in nvmet_addr_traddr_show() argument
134 return snprintf(page, PAGE_SIZE, "%s\n", port->disc_addr.traddr); in nvmet_addr_traddr_show()
138 const char *page, size_t count) in nvmet_addr_traddr_store() argument
143 pr_err("Invalid value '%s' for traddr\n", page); in nvmet_addr_traddr_store()
150 if (sscanf(page, "%s\n", port->disc_addr.traddr) != 1) in nvmet_addr_traddr_store()
163 static ssize_t nvmet_addr_treq_show(struct config_item *item, char *page) in nvmet_addr_treq_show() argument
171 return snprintf(page, PAGE_SIZE, "%s\n", in nvmet_addr_treq_show()
175 return snprintf(page, PAGE_SIZE, "\n"); in nvmet_addr_treq_show()
179 const char *page, size_t count) in nvmet_addr_treq_store() argument
189 if (sysfs_streq(page, nvmet_addr_treq[i].name)) in nvmet_addr_treq_store()
193 pr_err("Invalid value '%s' for treq\n", page); in nvmet_addr_treq_store()
205 char *page) in nvmet_addr_trsvcid_show() argument
209 return snprintf(page, PAGE_SIZE, "%s\n", port->disc_addr.trsvcid); in nvmet_addr_trsvcid_show()
213 const char *page, size_t count) in nvmet_addr_trsvcid_store() argument
218 pr_err("Invalid value '%s' for trsvcid\n", page); in nvmet_addr_trsvcid_store()
224 if (sscanf(page, "%s\n", port->disc_addr.trsvcid) != 1) in nvmet_addr_trsvcid_store()
232 char *page) in nvmet_param_inline_data_size_show() argument
236 return snprintf(page, PAGE_SIZE, "%d\n", port->inline_data_size); in nvmet_param_inline_data_size_show()
240 const char *page, size_t count) in nvmet_param_inline_data_size_store() argument
247 ret = kstrtoint(page, 0, &port->inline_data_size); in nvmet_param_inline_data_size_store()
249 pr_err("Invalid value '%s' for inline_data_size\n", page); in nvmet_param_inline_data_size_store()
259 char *page) in nvmet_param_pi_enable_show() argument
263 return snprintf(page, PAGE_SIZE, "%d\n", port->pi_enable); in nvmet_param_pi_enable_show()
267 const char *page, size_t count) in nvmet_param_pi_enable_store() argument
272 if (kstrtobool(page, &val)) in nvmet_param_pi_enable_store()
286 char *page) in nvmet_addr_trtype_show() argument
293 return snprintf(page, PAGE_SIZE, in nvmet_addr_trtype_show()
297 return sprintf(page, "\n"); in nvmet_addr_trtype_show()
308 const char *page, size_t count) in nvmet_addr_trtype_store() argument
317 if (sysfs_streq(page, nvmet_transport[i].name)) in nvmet_addr_trtype_store()
321 pr_err("Invalid value '%s' for trtype\n", page); in nvmet_addr_trtype_store()
337 static ssize_t nvmet_ns_device_path_show(struct config_item *item, char *page) in nvmet_ns_device_path_show() argument
339 return sprintf(page, "%s\n", to_nvmet_ns(item)->device_path); in nvmet_ns_device_path_show()
343 const char *page, size_t count) in nvmet_ns_device_path_store() argument
356 len = strcspn(page, "\n"); in nvmet_ns_device_path_store()
362 ns->device_path = kmemdup_nul(page, len, GFP_KERNEL); in nvmet_ns_device_path_store()
377 static ssize_t nvmet_ns_p2pmem_show(struct config_item *item, char *page) in nvmet_ns_p2pmem_show() argument
381 return pci_p2pdma_enable_show(page, ns->p2p_dev, ns->use_p2pmem); in nvmet_ns_p2pmem_show()
385 const char *page, size_t count) in nvmet_ns_p2pmem_store() argument
399 error = pci_p2pdma_enable_store(page, &p2p_dev, &use_p2pmem); in nvmet_ns_p2pmem_store()
418 static ssize_t nvmet_ns_device_uuid_show(struct config_item *item, char *page) in nvmet_ns_device_uuid_show() argument
420 return sprintf(page, "%pUb\n", &to_nvmet_ns(item)->uuid); in nvmet_ns_device_uuid_show()
424 const char *page, size_t count) in nvmet_ns_device_uuid_store() argument
436 if (uuid_parse(page, &ns->uuid)) in nvmet_ns_device_uuid_store()
446 static ssize_t nvmet_ns_device_nguid_show(struct config_item *item, char *page) in nvmet_ns_device_nguid_show() argument
448 return sprintf(page, "%pUb\n", &to_nvmet_ns(item)->nguid); in nvmet_ns_device_nguid_show()
452 const char *page, size_t count) in nvmet_ns_device_nguid_store() argument
457 const char *p = page; in nvmet_ns_device_nguid_store()
468 if (p + 2 > page + count) { in nvmet_ns_device_nguid_store()
492 static ssize_t nvmet_ns_ana_grpid_show(struct config_item *item, char *page) in nvmet_ns_ana_grpid_show() argument
494 return sprintf(page, "%u\n", to_nvmet_ns(item)->anagrpid); in nvmet_ns_ana_grpid_show()
498 const char *page, size_t count) in nvmet_ns_ana_grpid_store() argument
504 ret = kstrtou32(page, 0, &newgrpid); in nvmet_ns_ana_grpid_store()
526 static ssize_t nvmet_ns_enable_show(struct config_item *item, char *page) in nvmet_ns_enable_show() argument
528 return sprintf(page, "%d\n", to_nvmet_ns(item)->enabled); in nvmet_ns_enable_show()
532 const char *page, size_t count) in nvmet_ns_enable_store() argument
538 if (kstrtobool(page, &enable)) in nvmet_ns_enable_store()
559 static ssize_t nvmet_ns_buffered_io_show(struct config_item *item, char *page) in nvmet_ns_buffered_io_show() argument
561 return sprintf(page, "%d\n", to_nvmet_ns(item)->buffered_io); in nvmet_ns_buffered_io_show()
565 const char *page, size_t count) in nvmet_ns_buffered_io_store() argument
570 if (kstrtobool(page, &val)) in nvmet_ns_buffered_io_store()
588 const char *page, size_t count) in nvmet_ns_revalidate_size_store() argument
593 if (kstrtobool(page, &val)) in nvmet_ns_revalidate_size_store()
699 char *page) in nvmet_passthru_device_path_show() argument
703 return snprintf(page, PAGE_SIZE, "%s\n", subsys->passthru_ctrl_path); in nvmet_passthru_device_path_show()
707 const char *page, size_t count) in nvmet_passthru_device_path_store() argument
720 len = strcspn(page, "\n"); in nvmet_passthru_device_path_store()
726 subsys->passthru_ctrl_path = kstrndup(page, len, GFP_KERNEL); in nvmet_passthru_device_path_store()
740 char *page) in nvmet_passthru_enable_show() argument
744 return sprintf(page, "%d\n", subsys->passthru_ctrl ? 1 : 0); in nvmet_passthru_enable_show()
748 const char *page, size_t count) in nvmet_passthru_enable_store() argument
754 if (kstrtobool(page, &enable)) in nvmet_passthru_enable_store()
767 char *page) in nvmet_passthru_admin_timeout_show() argument
769 return sprintf(page, "%u\n", to_subsys(item->ci_parent)->admin_timeout); in nvmet_passthru_admin_timeout_show()
773 const char *page, size_t count) in nvmet_passthru_admin_timeout_store() argument
778 if (kstrtouint(page, 0, &timeout)) in nvmet_passthru_admin_timeout_store()
786 char *page) in nvmet_passthru_io_timeout_show() argument
788 return sprintf(page, "%u\n", to_subsys(item->ci_parent)->io_timeout); in nvmet_passthru_io_timeout_show()
792 const char *page, size_t count) in nvmet_passthru_io_timeout_store() argument
797 if (kstrtouint(page, 0, &timeout)) in nvmet_passthru_io_timeout_store()
805 char *page) in nvmet_passthru_clear_ids_show() argument
807 return sprintf(page, "%u\n", to_subsys(item->ci_parent)->clear_ids); in nvmet_passthru_clear_ids_show()
811 const char *page, size_t count) in nvmet_passthru_clear_ids_store() argument
816 if (kstrtouint(page, 0, &clear_ids)) in nvmet_passthru_clear_ids_store()
1008 char *page) in nvmet_subsys_attr_allow_any_host_show() argument
1010 return snprintf(page, PAGE_SIZE, "%d\n", in nvmet_subsys_attr_allow_any_host_show()
1015 const char *page, size_t count) in nvmet_subsys_attr_allow_any_host_store() argument
1021 if (kstrtobool(page, &allow_any_host)) in nvmet_subsys_attr_allow_any_host_store()
1044 char *page) in nvmet_subsys_attr_version_show() argument
1049 return snprintf(page, PAGE_SIZE, "%llu.%llu.%llu\n", in nvmet_subsys_attr_version_show()
1054 return snprintf(page, PAGE_SIZE, "%llu.%llu\n", in nvmet_subsys_attr_version_show()
1061 const char *page, size_t count) in nvmet_subsys_attr_version_store_locked() argument
1083 ret = sscanf(page, "%d.%d.%d\n", &major, &minor, &tertiary); in nvmet_subsys_attr_version_store_locked()
1093 const char *page, size_t count) in nvmet_subsys_attr_version_store() argument
1100 ret = nvmet_subsys_attr_version_store_locked(subsys, page, count); in nvmet_subsys_attr_version_store()
1115 char *page) in nvmet_subsys_attr_serial_show() argument
1119 return snprintf(page, PAGE_SIZE, "%.*s\n", in nvmet_subsys_attr_serial_show()
1125 const char *page, size_t count) in nvmet_subsys_attr_serial_store_locked() argument
1127 int pos, len = strcspn(page, "\n"); in nvmet_subsys_attr_serial_store_locked()
1142 if (!nvmet_is_ascii(page[pos])) { 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()
1154 const char *page, size_t count) in nvmet_subsys_attr_serial_store() argument
1161 ret = nvmet_subsys_attr_serial_store_locked(subsys, page, count); in nvmet_subsys_attr_serial_store()
1170 char *page) in nvmet_subsys_attr_cntlid_min_show() argument
1172 return snprintf(page, PAGE_SIZE, "%u\n", to_subsys(item)->cntlid_min); in nvmet_subsys_attr_cntlid_min_show()
1176 const char *page, size_t cnt) in nvmet_subsys_attr_cntlid_min_store() argument
1180 if (sscanf(page, "%hu\n", &cntlid_min) != 1) in nvmet_subsys_attr_cntlid_min_store()
1200 char *page) in nvmet_subsys_attr_cntlid_max_show() argument
1202 return snprintf(page, PAGE_SIZE, "%u\n", to_subsys(item)->cntlid_max); in nvmet_subsys_attr_cntlid_max_show()
1206 const char *page, size_t cnt) in nvmet_subsys_attr_cntlid_max_store() argument
1210 if (sscanf(page, "%hu\n", &cntlid_max) != 1) in nvmet_subsys_attr_cntlid_max_store()
1230 char *page) in nvmet_subsys_attr_model_show() argument
1234 return snprintf(page, PAGE_SIZE, "%s\n", subsys->model_number); in nvmet_subsys_attr_model_show()
1238 const char *page, size_t count) in nvmet_subsys_attr_model_store_locked() argument
1249 len = strcspn(page, "\n"); in nvmet_subsys_attr_model_store_locked()
1260 if (!nvmet_is_ascii(page[pos])) in nvmet_subsys_attr_model_store_locked()
1264 val = kmemdup_nul(page, len, GFP_KERNEL); in nvmet_subsys_attr_model_store_locked()
1273 const char *page, size_t count) in nvmet_subsys_attr_model_store() argument
1280 ret = nvmet_subsys_attr_model_store_locked(subsys, page, count); in nvmet_subsys_attr_model_store()
1289 char *page) in nvmet_subsys_attr_ieee_oui_show() argument
1293 return sysfs_emit(page, "0x%06x\n", subsys->ieee_oui); in nvmet_subsys_attr_ieee_oui_show()
1297 const char *page, size_t count) in nvmet_subsys_attr_ieee_oui_store_locked() argument
1308 ret = kstrtou32(page, 0, &val); in nvmet_subsys_attr_ieee_oui_store_locked()
1321 const char *page, size_t count) in nvmet_subsys_attr_ieee_oui_store() argument
1328 ret = nvmet_subsys_attr_ieee_oui_store_locked(subsys, page, count); in nvmet_subsys_attr_ieee_oui_store()
1337 char *page) in nvmet_subsys_attr_firmware_show() argument
1341 return sysfs_emit(page, "%s\n", subsys->firmware_rev); in nvmet_subsys_attr_firmware_show()
1345 const char *page, size_t count) in nvmet_subsys_attr_firmware_store_locked() argument
1356 len = strcspn(page, "\n"); in nvmet_subsys_attr_firmware_store_locked()
1367 if (!nvmet_is_ascii(page[pos])) in nvmet_subsys_attr_firmware_store_locked()
1371 val = kmemdup_nul(page, len, GFP_KERNEL); in nvmet_subsys_attr_firmware_store_locked()
1383 const char *page, size_t count) in nvmet_subsys_attr_firmware_store() argument
1390 ret = nvmet_subsys_attr_firmware_store_locked(subsys, page, count); in nvmet_subsys_attr_firmware_store()
1400 char *page) in nvmet_subsys_attr_pi_enable_show() argument
1402 return snprintf(page, PAGE_SIZE, "%d\n", to_subsys(item)->pi_support); in nvmet_subsys_attr_pi_enable_show()
1406 const char *page, size_t count) in nvmet_subsys_attr_pi_enable_store() argument
1411 if (kstrtobool(page, &pi_enable)) in nvmet_subsys_attr_pi_enable_store()
1421 char *page) in nvmet_subsys_attr_qid_max_show() argument
1423 return snprintf(page, PAGE_SIZE, "%u\n", to_subsys(item)->max_qid); in nvmet_subsys_attr_qid_max_show()
1427 const char *page, size_t cnt) in nvmet_subsys_attr_qid_max_store() argument
1433 if (sscanf(page, "%hu\n", &qid_max) != 1) in nvmet_subsys_attr_qid_max_store()
1528 char *page) in nvmet_referral_enable_show() argument
1530 return snprintf(page, PAGE_SIZE, "%d\n", to_nvmet_port(item)->enabled); in nvmet_referral_enable_show()
1534 const char *page, size_t count) in nvmet_referral_enable_store() argument
1540 if (kstrtobool(page, &enable)) in nvmet_referral_enable_store()
1550 pr_err("Invalid value '%s' for enable\n", page); in nvmet_referral_enable_store()
1630 char *page) in nvmet_ana_group_ana_state_show() argument
1638 return sprintf(page, "%s\n", nvmet_ana_state[i].name); in nvmet_ana_group_ana_state_show()
1641 return sprintf(page, "\n"); in nvmet_ana_group_ana_state_show()
1645 const char *page, size_t count) in nvmet_ana_group_ana_state_store() argument
1652 if (sysfs_streq(page, nvmet_ana_state[i].name)) in nvmet_ana_group_ana_state_store()
1656 pr_err("Invalid value '%s' for ana_state\n", page); in nvmet_ana_group_ana_state_store()
1861 char *page) in nvmet_host_dhchap_key_show() argument
1866 return sprintf(page, "\n"); in nvmet_host_dhchap_key_show()
1867 return sprintf(page, "%s\n", dhchap_secret); in nvmet_host_dhchap_key_show()
1871 const char *page, size_t count) in nvmet_host_dhchap_key_store() argument
1876 ret = nvmet_auth_set_key(host, page, false); in nvmet_host_dhchap_key_store()
1888 char *page) in nvmet_host_dhchap_ctrl_key_show() argument
1893 return sprintf(page, "\n"); in nvmet_host_dhchap_ctrl_key_show()
1894 return sprintf(page, "%s\n", dhchap_secret); in nvmet_host_dhchap_ctrl_key_show()
1898 const char *page, size_t count) in nvmet_host_dhchap_ctrl_key_store() argument
1903 ret = nvmet_auth_set_key(host, page, true); in nvmet_host_dhchap_ctrl_key_store()
1915 char *page) in nvmet_host_dhchap_hash_show() argument
1920 return sprintf(page, "%s\n", hash_name ? hash_name : "none"); in nvmet_host_dhchap_hash_show()
1924 const char *page, size_t count) in nvmet_host_dhchap_hash_store() argument
1929 hmac_id = nvme_auth_hmac_id(page); in nvmet_host_dhchap_hash_store()
1941 char *page) in nvmet_host_dhchap_dhgroup_show() argument
1946 return sprintf(page, "%s\n", dhgroup ? dhgroup : "none"); in nvmet_host_dhchap_dhgroup_show()
1950 const char *page, size_t count) in nvmet_host_dhchap_dhgroup_store() argument
1955 dhgroup_id = nvme_auth_dhgroup_id(page); in nvmet_host_dhchap_dhgroup_store()