include/uapi/linux/virtio_blk.h
Source file repositories/reference/linux-study-clean/include/uapi/linux/virtio_blk.h
File Facts
- System
- Linux kernel
- Corpus path
include/uapi/linux/virtio_blk.h- Extension
.h- Size
- 10005 bytes
- Lines
- 328
- Domain
- Core OS
- Bucket
- Core Kernel Interface
- Inferred role
- Core OS: implementation source
- Status
- source implementation candidate
Why This File Exists
Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/types.hlinux/virtio_ids.hlinux/virtio_config.hlinux/virtio_types.h
Detected Declarations
struct virtio_blk_configstruct virtio_blk_geometrystruct virtio_blk_zoned_characteristicsstruct virtio_blk_outhdrstruct virtio_blk_zone_descriptorstruct virtio_blk_zone_reportstruct virtio_blk_discard_write_zeroesstruct virtio_scsi_inhdr
Annotated Snippet
struct virtio_blk_config {
/* The capacity (in 512-byte sectors). */
__virtio64 capacity;
/* The maximum segment size (if VIRTIO_BLK_F_SIZE_MAX) */
__virtio32 size_max;
/* The maximum number of segments (if VIRTIO_BLK_F_SEG_MAX) */
__virtio32 seg_max;
/* geometry of the device (if VIRTIO_BLK_F_GEOMETRY) */
struct virtio_blk_geometry {
__virtio16 cylinders;
__u8 heads;
__u8 sectors;
} geometry;
/* block size of device (if VIRTIO_BLK_F_BLK_SIZE) */
__virtio32 blk_size;
/* the next 4 entries are guarded by VIRTIO_BLK_F_TOPOLOGY */
/* exponent for physical block per logical block. */
__u8 physical_block_exp;
/* alignment offset in logical blocks. */
__u8 alignment_offset;
/* minimum I/O size without performance penalty in logical blocks. */
__virtio16 min_io_size;
/* optimal sustained I/O size in logical blocks. */
__virtio32 opt_io_size;
/* writeback mode (if VIRTIO_BLK_F_CONFIG_WCE) */
__u8 wce;
__u8 unused;
/* number of vqs, only available when VIRTIO_BLK_F_MQ is set */
__virtio16 num_queues;
/* the next 3 entries are guarded by VIRTIO_BLK_F_DISCARD */
/*
* The maximum discard sectors (in 512-byte sectors) for
* one segment.
*/
__virtio32 max_discard_sectors;
/*
* The maximum number of discard segments in a
* discard command.
*/
__virtio32 max_discard_seg;
/* Discard commands must be aligned to this number of sectors. */
__virtio32 discard_sector_alignment;
/* the next 3 entries are guarded by VIRTIO_BLK_F_WRITE_ZEROES */
/*
* The maximum number of write zeroes sectors (in 512-byte sectors) in
* one segment.
*/
__virtio32 max_write_zeroes_sectors;
/*
* The maximum number of segments in a write zeroes
* command.
*/
__virtio32 max_write_zeroes_seg;
/*
* Set if a VIRTIO_BLK_T_WRITE_ZEROES request may result in the
* deallocation of one or more of the sectors.
*/
__u8 write_zeroes_may_unmap;
__u8 unused1[3];
/* the next 3 entries are guarded by VIRTIO_BLK_F_SECURE_ERASE */
/*
* The maximum secure erase sectors (in 512-byte sectors) for
* one segment.
*/
__virtio32 max_secure_erase_sectors;
/*
* The maximum number of secure erase segments in a
* secure erase command.
*/
__virtio32 max_secure_erase_seg;
/* Secure erase commands must be aligned to this number of sectors. */
__virtio32 secure_erase_sector_alignment;
/* Zoned block device characteristics (if VIRTIO_BLK_F_ZONED) */
struct virtio_blk_zoned_characteristics {
__virtio32 zone_sectors;
__virtio32 max_open_zones;
__virtio32 max_active_zones;
__virtio32 max_append_sectors;
__virtio32 write_granularity;
__u8 model;
__u8 unused2[3];
Annotation
- Immediate include surface: `linux/types.h`, `linux/virtio_ids.h`, `linux/virtio_config.h`, `linux/virtio_types.h`.
- Detected declarations: `struct virtio_blk_config`, `struct virtio_blk_geometry`, `struct virtio_blk_zoned_characteristics`, `struct virtio_blk_outhdr`, `struct virtio_blk_zone_descriptor`, `struct virtio_blk_zone_report`, `struct virtio_blk_discard_write_zeroes`, `struct virtio_scsi_inhdr`.
- Atlas domain: Core OS / Core Kernel Interface.
- 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.