arch/s390/hypfs/hypfs_dbfs.c

Source file repositories/reference/linux-study-clean/arch/s390/hypfs/hypfs_dbfs.c

File Facts

System
Linux kernel
Corpus path
arch/s390/hypfs/hypfs_dbfs.c
Extension
.c
Size
2812 bytes
Lines
129
Domain
Architecture Layer
Bucket
arch/s390
Inferred role
Architecture Layer: operation-table or driver-model contract
Status
pattern implementation candidate

Why This File Exists

CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.

Dependency Surface

Detected Declarations

Annotated Snippet

static const struct file_operations dbfs_ops_ioctl = {
	.read		= dbfs_read,
	.unlocked_ioctl = dbfs_ioctl,
};

static const struct file_operations dbfs_ops = {
	.read		= dbfs_read,
};

void hypfs_dbfs_create_file(struct hypfs_dbfs_file *df)
{
	const struct file_operations *fops = &dbfs_ops;

	if (df->unlocked_ioctl && !security_locked_down(LOCKDOWN_DEBUGFS))
		fops = &dbfs_ops_ioctl;
	df->dentry = debugfs_create_file(df->name, 0400, dbfs_dir, df, fops);
	mutex_init(&df->lock);
}

void hypfs_dbfs_remove_file(struct hypfs_dbfs_file *df)
{
	debugfs_remove(df->dentry);
}

static int __init hypfs_dbfs_init(void)
{
	int rc = -ENODATA;

	dbfs_dir = debugfs_create_dir("s390_hypfs", NULL);
	if (hypfs_diag_init())
		goto fail_dbfs_exit;
	if (hypfs_vm_init())
		goto fail_hypfs_diag_exit;
	hypfs_sprp_init();
	if (hypfs_diag0c_init())
		goto fail_hypfs_sprp_exit;
	rc = hypfs_fs_init();
	if (rc)
		goto fail_hypfs_diag0c_exit;
	return 0;

fail_hypfs_diag0c_exit:
	hypfs_diag0c_exit();
fail_hypfs_sprp_exit:
	hypfs_sprp_exit();
	hypfs_vm_exit();
fail_hypfs_diag_exit:
	hypfs_diag_exit();
	pr_err("Initialization of hypfs failed with rc=%i\n", rc);
fail_dbfs_exit:
	debugfs_remove(dbfs_dir);
	return rc;
}
device_initcall(hypfs_dbfs_init)

Annotation

Implementation Notes