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.

Dependency Surface

Detected Declarations

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

Implementation Notes