drivers/target/iscsi/iscsi_target_configfs.c
Source file repositories/reference/linux-study-clean/drivers/target/iscsi/iscsi_target_configfs.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/target/iscsi/iscsi_target_configfs.c- Extension
.c- Size
- 46318 bytes
- Lines
- 1598
- Domain
- Driver Families
- Bucket
- drivers/target
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/configfs.hlinux/ctype.hlinux/export.hlinux/inet.hlinux/module.hnet/ipv6.htarget/target_core_base.htarget/target_core_fabric.htarget/iscsi/iscsi_transport.htarget/iscsi/iscsi_target_core.hiscsi_target_parameters.hiscsi_target_device.hiscsi_target_erl0.hiscsi_target_nodeattrib.hiscsi_target_tpg.hiscsi_target_util.hiscsi_target.htarget/iscsi/iscsi_target_stat.h
Detected Declarations
function lio_target_np_driver_showfunction lio_target_np_driver_storefunction lio_target_np_iser_showfunction lio_target_np_iser_storefunction lio_target_np_cxgbit_showfunction lio_target_np_cxgbit_storefunction lio_target_call_delnpfromtpgfunction iscsi_nacl_attrib_authentication_showfunction iscsi_nacl_attrib_authentication_storefunction lio_target_nacl_info_showfunction list_for_each_entryfunction lio_target_nacl_cmdsn_depth_showfunction lio_target_nacl_cmdsn_depth_storefunction lio_target_nacl_tag_showfunction lio_target_nacl_tag_storefunction lio_target_init_nodeaclfunction lio_target_tpg_dynamic_sessions_showfunction lio_target_tiqn_enabletpgfunction lio_target_tiqn_deltpgfunction lio_target_wwn_lio_version_showfunction lio_target_wwn_cpus_allowed_list_showfunction lio_target_wwn_cpus_allowed_list_storefunction lio_target_add_wwn_groupsfunction lio_target_call_coredeltiqnfunction iscsi_disc_enforce_discovery_auth_showfunction iscsi_disc_enforce_discovery_auth_storefunction iscsi_get_cmd_statefunction lio_sess_get_indexfunction lio_sess_get_initiator_sidfunction lio_queue_data_infunction lio_write_pendingfunction lio_queue_statusfunction lio_queue_tm_rspfunction lio_aborted_taskfunction lio_tpg_get_tagfunction lio_tpg_get_default_depthfunction lio_tpg_check_demo_modefunction lio_tpg_check_demo_mode_cachefunction lio_tpg_check_demo_mode_write_protectfunction lio_tpg_check_prod_mode_write_protectfunction lio_tpg_check_prot_fabric_onlyfunction iscsit_inc_session_usage_countfunction atomic_readfunction lio_tpg_get_inst_indexfunction lio_set_default_node_attributesfunction lio_check_stop_freefunction lio_release_cmd
Annotated Snippet
if (strlen(mod_name)) {
rc = request_module(mod_name);
if (rc != 0) {
pr_warn("Unable to request_module for %s\n",
mod_name);
rc = 0;
}
}
tpg_np_new = iscsit_tpg_add_network_portal(tpg,
&np->np_sockaddr, tpg_np, type);
if (IS_ERR(tpg_np_new)) {
rc = PTR_ERR(tpg_np_new);
goto out;
}
} else {
tpg_np_new = iscsit_tpg_locate_child_np(tpg_np, type);
if (tpg_np_new) {
rc = iscsit_tpg_del_network_portal(tpg, tpg_np_new);
if (rc < 0)
goto out;
}
}
iscsit_put_tpg(tpg);
return count;
out:
iscsit_put_tpg(tpg);
return rc;
}
static ssize_t lio_target_np_iser_show(struct config_item *item, char *page)
{
return lio_target_np_driver_show(item, page, ISCSI_INFINIBAND);
}
static ssize_t lio_target_np_iser_store(struct config_item *item,
const char *page, size_t count)
{
return lio_target_np_driver_store(item, page, count,
ISCSI_INFINIBAND, "ib_isert");
}
CONFIGFS_ATTR(lio_target_np_, iser);
static ssize_t lio_target_np_cxgbit_show(struct config_item *item, char *page)
{
return lio_target_np_driver_show(item, page, ISCSI_CXGBIT);
}
static ssize_t lio_target_np_cxgbit_store(struct config_item *item,
const char *page, size_t count)
{
return lio_target_np_driver_store(item, page, count,
ISCSI_CXGBIT, "cxgbit");
}
CONFIGFS_ATTR(lio_target_np_, cxgbit);
static struct configfs_attribute *lio_target_portal_attrs[] = {
&lio_target_np_attr_iser,
&lio_target_np_attr_cxgbit,
NULL,
};
/* Stop items for lio_target_portal_cit */
/* Start items for lio_target_np_cit */
#define MAX_PORTAL_LEN 256
static struct se_tpg_np *lio_target_call_addnptotpg(
struct se_portal_group *se_tpg,
struct config_group *group,
const char *name)
{
struct iscsi_portal_group *tpg;
struct iscsi_tpg_np *tpg_np;
char *str, *str2, *ip_str, *port_str;
struct sockaddr_storage sockaddr = { };
int ret;
char buf[MAX_PORTAL_LEN + 1] = { };
if (strlen(name) > MAX_PORTAL_LEN) {
pr_err("strlen(name): %d exceeds MAX_PORTAL_LEN: %d\n",
(int)strlen(name), MAX_PORTAL_LEN);
return ERR_PTR(-EOVERFLOW);
}
snprintf(buf, MAX_PORTAL_LEN + 1, "%s", name);
str = strstr(buf, "[");
if (str) {
Annotation
- Immediate include surface: `linux/configfs.h`, `linux/ctype.h`, `linux/export.h`, `linux/inet.h`, `linux/module.h`, `net/ipv6.h`, `target/target_core_base.h`, `target/target_core_fabric.h`.
- Detected declarations: `function lio_target_np_driver_show`, `function lio_target_np_driver_store`, `function lio_target_np_iser_show`, `function lio_target_np_iser_store`, `function lio_target_np_cxgbit_show`, `function lio_target_np_cxgbit_store`, `function lio_target_call_delnpfromtpg`, `function iscsi_nacl_attrib_authentication_show`, `function iscsi_nacl_attrib_authentication_store`, `function lio_target_nacl_info_show`.
- Atlas domain: Driver Families / drivers/target.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.