drivers/s390/block/dasd.c
Source file repositories/reference/linux-study-clean/drivers/s390/block/dasd.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/s390/block/dasd.c- Extension
.c- Size
- 111222 bytes
- Lines
- 4081
- Domain
- Driver Families
- Bucket
- drivers/s390
- Inferred role
- Driver Families: operation-table or driver-model contract
- Status
- pattern 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.
- Defines an operation table; this is where Linux turns generic core objects into subsystem-specific behavior.
- Touches user memory; correctness depends on fault-safe copying and privilege boundary handling.
- 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/export.hlinux/kmod.hlinux/init.hlinux/interrupt.hlinux/ctype.hlinux/major.hlinux/slab.hlinux/hdreg.hlinux/async.hlinux/mutex.hlinux/debugfs.hlinux/seq_file.hlinux/vmalloc.hasm/machine.hasm/ccwdev.hasm/ebcdic.hasm/idals.hasm/itcw.hasm/diag.hdasd_int.h
Detected Declarations
function dasd_free_devicefunction dasd_free_blockfunction dasd_state_new_to_knownfunction dasd_state_known_to_newfunction dasd_state_known_to_basicfunction dasd_state_basic_to_knownfunction donefunction _wait_for_empty_queuesfunction dasd_state_ready_to_basicfunction dasd_state_unfmt_to_basicfunction dasd_state_ready_to_onlinefunction dasd_state_online_to_readyfunction dasd_increase_statefunction dasd_decrease_statefunction dasd_change_statefunction do_kick_devicefunction dasd_kick_devicefunction do_reload_devicefunction dasd_reload_devicefunction dasd_set_target_statefunction _wait_for_devicefunction dasd_enable_devicefunction dasd_profile_startfunction dasd_profile_end_add_datafunction dasd_profile_endfunction dasd_profile_resetfunction dasd_profile_onfunction dasd_profile_offfunction dasd_stats_writefunction dasd_stats_arrayfunction dasd_stats_seq_printfunction dasd_stats_showfunction dasd_stats_openfunction dasd_profile_initfunction dasd_profile_exitfunction dasd_statistics_removerootfunction dasd_statistics_createrootfunction dasd_statistics_createrootfunction dasd_statistics_removerootfunction dasd_profile_initfunction dasd_profile_exitfunction dasd_profile_onfunction dasd_hosts_showfunction dasd_hosts_exitfunction dasd_hosts_initfunction dasd_sfree_requestfunction dasd_ffree_requestfunction dasd_check_cqr
Annotated Snippet
static const struct file_operations dasd_stats_raw_fops = {
.owner = THIS_MODULE,
.open = dasd_stats_open,
.read = seq_read,
.llseek = seq_lseek,
.release = single_release,
.write = dasd_stats_write,
};
static void dasd_profile_init(struct dasd_profile *profile,
struct dentry *base_dentry)
{
profile->data = NULL;
profile->dentry = debugfs_create_file("statistics", 0600, base_dentry,
profile, &dasd_stats_raw_fops);
}
static void dasd_profile_exit(struct dasd_profile *profile)
{
dasd_profile_off(profile);
debugfs_remove(profile->dentry);
profile->dentry = NULL;
}
static void dasd_statistics_removeroot(void)
{
dasd_global_profile_level = DASD_PROFILE_OFF;
dasd_profile_exit(&dasd_global_profile);
debugfs_remove(dasd_debugfs_global_entry);
debugfs_remove(dasd_debugfs_root_entry);
}
static void dasd_statistics_createroot(void)
{
dasd_debugfs_root_entry = debugfs_create_dir("dasd", NULL);
dasd_debugfs_global_entry = debugfs_create_dir("global", dasd_debugfs_root_entry);
dasd_profile_init(&dasd_global_profile, dasd_debugfs_global_entry);
}
#else
#define dasd_profile_start(block, cqr, req) do {} while (0)
#define dasd_profile_end(block, cqr, req) do {} while (0)
static void dasd_statistics_createroot(void)
{
return;
}
static void dasd_statistics_removeroot(void)
{
return;
}
static void dasd_profile_init(struct dasd_profile *profile,
struct dentry *base_dentry)
{
return;
}
static void dasd_profile_exit(struct dasd_profile *profile)
{
return;
}
int dasd_profile_on(struct dasd_profile *profile)
{
return 0;
}
#endif /* CONFIG_DASD_PROFILE */
static int dasd_hosts_show(struct seq_file *m, void *v)
{
struct dasd_device *device;
int rc = -EOPNOTSUPP;
device = m->private;
dasd_get_device(device);
if (device->discipline->hosts_print)
rc = device->discipline->hosts_print(device, m);
dasd_put_device(device);
return rc;
}
DEFINE_SHOW_ATTRIBUTE(dasd_hosts);
static void dasd_hosts_exit(struct dasd_device *device)
{
Annotation
- Immediate include surface: `linux/export.h`, `linux/kmod.h`, `linux/init.h`, `linux/interrupt.h`, `linux/ctype.h`, `linux/major.h`, `linux/slab.h`, `linux/hdreg.h`.
- Detected declarations: `function dasd_free_device`, `function dasd_free_block`, `function dasd_state_new_to_known`, `function dasd_state_known_to_new`, `function dasd_state_known_to_basic`, `function dasd_state_basic_to_known`, `function done`, `function _wait_for_empty_queues`, `function dasd_state_ready_to_basic`, `function dasd_state_unfmt_to_basic`.
- Atlas domain: Driver Families / drivers/s390.
- Implementation status: pattern implementation candidate.
- This snippet crosses the user/kernel memory boundary; validate fault handling and access checks before translating the pattern.
- 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.