drivers/target/target_core_fabric_configfs.c
Source file repositories/reference/linux-study-clean/drivers/target/target_core_fabric_configfs.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/target/target_core_fabric_configfs.c- Extension
.c- Size
- 33669 bytes
- Lines
- 1212
- 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/kstrtox.hlinux/module.hlinux/moduleparam.hlinux/utsname.hlinux/init.hlinux/fs.hlinux/namei.hlinux/slab.hlinux/types.hlinux/delay.hlinux/unistd.hlinux/string.hlinux/syscalls.hlinux/configfs.htarget/target_core_base.htarget/target_core_backend.htarget/target_core_fabric.htarget_core_internal.htarget_core_alua.htarget_core_pr.h
Detected Declarations
function target_fabric_mappedlun_linkfunction target_fabric_mappedlun_unlinkfunction target_fabric_mappedlun_write_protect_showfunction target_fabric_mappedlun_write_protect_storefunction target_fabric_mappedlun_releasefunction target_core_mappedlun_stat_rmdirfunction target_fabric_drop_mappedlunfunction target_fabric_nacl_base_releasefunction target_fabric_drop_nodeaclfunction target_fabric_np_base_releasefunction target_fabric_drop_npfunction target_fabric_port_alua_tg_pt_gp_showfunction target_fabric_port_alua_tg_pt_gp_storefunction target_fabric_port_alua_tg_pt_offline_showfunction target_fabric_port_alua_tg_pt_offline_storefunction target_fabric_port_alua_tg_pt_status_showfunction target_fabric_port_alua_tg_pt_status_storefunction target_fabric_port_alua_tg_pt_write_md_showfunction target_fabric_port_alua_tg_pt_write_md_storefunction target_fabric_port_linkfunction target_fabric_port_unlinkfunction target_fabric_port_releasefunction target_core_port_stat_rmdirfunction target_fabric_drop_lunfunction target_fabric_tpg_releasefunction target_fabric_tpg_base_enable_showfunction target_fabric_tpg_base_enable_storefunction target_fabric_tpg_base_rtpi_showfunction target_fabric_tpg_base_rtpi_storefunction target_fabric_setup_tpg_base_citfunction target_fabric_drop_tpgfunction target_fabric_release_wwnfunction target_fabric_wwn_cmd_completion_affinity_showfunction target_fabric_wwn_cmd_completion_affinity_storefunction target_fabric_wwn_default_complete_type_showfunction target_fabric_wwn_direct_complete_supported_showfunction target_fabric_wwn_default_submit_type_showfunction target_fabric_wwn_direct_submit_supported_showfunction target_fabric_drop_wwnfunction target_fabric_setup_cits
Annotated Snippet
if (ret) {
configfs_remove_default_groups(&se_nacl->acl_fabric_stat_group);
core_tpg_del_initiator_node_acl(se_nacl);
return ERR_PTR(ret);
}
}
return &se_nacl->acl_group;
}
static void target_fabric_drop_nodeacl(
struct config_group *group,
struct config_item *item)
{
struct se_node_acl *se_nacl = container_of(to_config_group(item),
struct se_node_acl, acl_group);
configfs_remove_default_groups(&se_nacl->acl_group);
/*
* struct se_node_acl free is done in target_fabric_nacl_base_release()
*/
config_item_put(item);
}
static const struct configfs_group_operations target_fabric_nacl_group_ops = {
.make_group = target_fabric_make_nodeacl,
.drop_item = target_fabric_drop_nodeacl,
};
TF_CIT_SETUP(tpg_nacl, NULL, &target_fabric_nacl_group_ops, NULL);
/* End of tfc_tpg_nacl_cit */
/* Start of tfc_tpg_np_base_cit */
static void target_fabric_np_base_release(struct config_item *item)
{
struct se_tpg_np *se_tpg_np = container_of(to_config_group(item),
struct se_tpg_np, tpg_np_group);
struct se_portal_group *se_tpg = se_tpg_np->tpg_np_parent;
struct target_fabric_configfs *tf = se_tpg->se_tpg_wwn->wwn_tf;
tf->tf_ops->fabric_drop_np(se_tpg_np);
}
static const struct configfs_item_operations target_fabric_np_base_item_ops = {
.release = target_fabric_np_base_release,
};
TF_CIT_SETUP_DRV(tpg_np_base, &target_fabric_np_base_item_ops, NULL);
/* End of tfc_tpg_np_base_cit */
/* Start of tfc_tpg_np_cit */
static struct config_group *target_fabric_make_np(
struct config_group *group,
const char *name)
{
struct se_portal_group *se_tpg = container_of(group,
struct se_portal_group, tpg_np_group);
struct target_fabric_configfs *tf = se_tpg->se_tpg_wwn->wwn_tf;
struct se_tpg_np *se_tpg_np;
if (!tf->tf_ops->fabric_make_np) {
pr_err("tf->tf_ops.fabric_make_np is NULL\n");
return ERR_PTR(-ENOSYS);
}
se_tpg_np = tf->tf_ops->fabric_make_np(se_tpg, group, name);
if (!se_tpg_np || IS_ERR(se_tpg_np))
return ERR_PTR(-EINVAL);
se_tpg_np->tpg_np_parent = se_tpg;
config_group_init_type_name(&se_tpg_np->tpg_np_group, name,
&tf->tf_tpg_np_base_cit);
return &se_tpg_np->tpg_np_group;
}
static void target_fabric_drop_np(
struct config_group *group,
struct config_item *item)
{
/*
* struct se_tpg_np is released via target_fabric_np_base_release()
*/
config_item_put(item);
}
Annotation
- Immediate include surface: `linux/kstrtox.h`, `linux/module.h`, `linux/moduleparam.h`, `linux/utsname.h`, `linux/init.h`, `linux/fs.h`, `linux/namei.h`, `linux/slab.h`.
- Detected declarations: `function target_fabric_mappedlun_link`, `function target_fabric_mappedlun_unlink`, `function target_fabric_mappedlun_write_protect_show`, `function target_fabric_mappedlun_write_protect_store`, `function target_fabric_mappedlun_release`, `function target_core_mappedlun_stat_rmdir`, `function target_fabric_drop_mappedlun`, `function target_fabric_nacl_base_release`, `function target_fabric_drop_nodeacl`, `function target_fabric_np_base_release`.
- 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.