arch/s390/hypfs/hypfs_diag.c
Source file repositories/reference/linux-study-clean/arch/s390/hypfs/hypfs_diag.c
File Facts
- System
- Linux kernel
- Corpus path
arch/s390/hypfs/hypfs_diag.c- Extension
.c- Size
- 5759 bytes
- Lines
- 225
- Domain
- Architecture Layer
- Bucket
- arch/s390
- Inferred role
- Architecture Layer: implementation source
- Status
- source 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.
- CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- 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/types.hlinux/errno.hlinux/slab.hlinux/string.hlinux/vmalloc.hlinux/mm.hasm/diag.hasm/ebcdic.hhypfs_diag.hhypfs.h
Detected Declarations
struct dbfs_d204_hdrstruct dbfs_d204function diag204_get_info_typefunction diag204_set_info_typefunction diag204_free_bufferfunction diag204_probefunction diag204_storefunction dbfs_d204_createfunction hypfs_diag_initfunction hypfs_diag_exit
Annotated Snippet
struct dbfs_d204_hdr {
u64 len; /* Length of d204 buffer without header */
u16 version; /* Version of header */
u8 sc; /* Used subcode */
char reserved[53];
} __attribute__ ((packed));
struct dbfs_d204 {
struct dbfs_d204_hdr hdr; /* 64 byte header */
char buf[]; /* d204 buffer */
} __attribute__ ((packed));
static int dbfs_d204_create(void **data, void **data_free_ptr, size_t *size)
{
struct dbfs_d204 *d204;
int rc, buf_size;
void *base;
buf_size = PAGE_SIZE * (diag204_buf_pages + 1) + sizeof(d204->hdr);
base = vzalloc(buf_size);
if (!base)
return -ENOMEM;
d204 = PTR_ALIGN(base + sizeof(d204->hdr), PAGE_SIZE) - sizeof(d204->hdr);
rc = diag204_store(d204->buf, diag204_buf_pages);
if (rc) {
vfree(base);
return rc;
}
d204->hdr.version = DBFS_D204_HDR_VERSION;
d204->hdr.len = PAGE_SIZE * diag204_buf_pages;
d204->hdr.sc = diag204_store_sc;
*data = d204;
*data_free_ptr = base;
*size = d204->hdr.len + sizeof(struct dbfs_d204_hdr);
return 0;
}
static struct hypfs_dbfs_file dbfs_file_d204 = {
.name = "diag_204",
.data_create = dbfs_d204_create,
.data_free = vfree,
};
__init int hypfs_diag_init(void)
{
int rc;
if (diag204_probe()) {
pr_info("The hardware system does not support hypfs\n");
return -ENODATA;
}
if (diag204_get_info_type() == DIAG204_INFO_EXT)
hypfs_dbfs_create_file(&dbfs_file_d204);
rc = hypfs_diag_fs_init();
if (rc)
pr_err("The hardware system does not provide all functions required by hypfs\n");
return rc;
}
void hypfs_diag_exit(void)
{
hypfs_diag_fs_exit();
diag204_free_buffer();
hypfs_dbfs_remove_file(&dbfs_file_d204);
}
Annotation
- Immediate include surface: `linux/types.h`, `linux/errno.h`, `linux/slab.h`, `linux/string.h`, `linux/vmalloc.h`, `linux/mm.h`, `asm/diag.h`, `asm/ebcdic.h`.
- Detected declarations: `struct dbfs_d204_hdr`, `struct dbfs_d204`, `function diag204_get_info_type`, `function diag204_set_info_type`, `function diag204_free_buffer`, `function diag204_probe`, `function diag204_store`, `function dbfs_d204_create`, `function hypfs_diag_init`, `function hypfs_diag_exit`.
- Atlas domain: Architecture Layer / arch/s390.
- Implementation status: source implementation candidate.
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.