include/linux/io_uring_types.h
Source file repositories/reference/linux-study-clean/include/linux/io_uring_types.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/io_uring_types.h- Extension
.h- Size
- 22787 bytes
- Lines
- 826
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/blkdev.hlinux/hashtable.hlinux/task_work.hlinux/bitmap.hlinux/llist.huapi/linux/io_uring.h
Detected Declarations
struct iou_loop_paramsstruct io_uring_bpf_opsstruct iou_loop_paramsstruct io_wq_work_nodestruct io_wq_work_liststruct mpscqstruct io_wq_workstruct io_rsrc_datastruct io_file_tablestruct io_hash_bucketstruct io_hash_tablestruct io_mapped_regionstruct io_br_selstruct io_uring_taskstruct iou_vecstruct io_uringstruct io_ringsstruct io_bpf_filterstruct io_bpf_filtersstruct io_restrictionstruct io_submit_linkstruct io_submit_statestruct io_alloc_cachestruct iou_ctxstruct io_ring_ctxstruct io_tw_statestruct io_tw_reqstruct io_task_workstruct io_cqestruct io_cmd_datastruct io_kiocbstruct io_big_cqestruct io_overflow_cqeenum io_uring_cmd_flagsfunction io_kiocb_cmd_sz_check
Annotated Snippet
struct io_wq_work_node {
struct io_wq_work_node *next;
};
struct io_wq_work_list {
struct io_wq_work_node *first;
struct io_wq_work_node *last;
};
/*
* Lockless multi-producer, single-consumer FIFO queue, see
* io_uring/mpscq.h for the implementation and rules. Defined here so
* that it can be embedded in io_ring_ctx. This is the producer side
* only - the consumer cursor is kept separately, on a cacheline that
* isn't dirtied by the producers.
*/
struct mpscq {
struct llist_node *tail; /* producers */
struct llist_node stub;
};
struct io_wq_work {
struct io_wq_work_node list;
atomic_t flags;
/* place it here instead of io_kiocb as it fills padding and saves 4B */
int cancel_seq;
};
struct io_rsrc_data {
unsigned int nr;
struct io_rsrc_node **nodes;
};
struct io_file_table {
struct io_rsrc_data data;
unsigned long *bitmap;
unsigned int alloc_hint;
};
struct io_hash_bucket {
struct hlist_head list;
} ____cacheline_aligned_in_smp;
struct io_hash_table {
struct io_hash_bucket *hbs;
unsigned hash_bits;
};
struct io_mapped_region {
struct page **pages;
void *ptr;
unsigned nr_pages;
unsigned flags;
};
/*
* Return value from io_buffer_list selection, to avoid stashing it in
* struct io_kiocb. For legacy/classic provided buffers, keeping a reference
* across execution contexts are fine. But for ring provided buffers, the
* list may go away as soon as ->uring_lock is dropped. As the io_kiocb
* persists, it's better to just keep the buffer local for those cases.
*/
struct io_br_sel {
struct io_buffer_list *buf_list;
/*
* Some selection parts return the user address, others return an error.
*/
union {
void __user *addr;
ssize_t val;
};
};
/*
* Arbitrary limit, can be raised if need be
*/
#define IO_RINGFD_REG_MAX 16
struct io_uring_task {
/* submission side */
int cached_refs;
const struct io_ring_ctx *last;
struct task_struct *task;
struct io_wq *io_wq;
/*
* Consumer cursor for ->task_list. Only popped by the task itself,
* or by ->fallback_work once the task can no longer run task_work.
*/
struct llist_node *task_head;
Annotation
- Immediate include surface: `linux/blkdev.h`, `linux/hashtable.h`, `linux/task_work.h`, `linux/bitmap.h`, `linux/llist.h`, `uapi/linux/io_uring.h`.
- Detected declarations: `struct iou_loop_params`, `struct io_uring_bpf_ops`, `struct iou_loop_params`, `struct io_wq_work_node`, `struct io_wq_work_list`, `struct mpscq`, `struct io_wq_work`, `struct io_rsrc_data`, `struct io_file_table`, `struct io_hash_bucket`.
- Atlas domain: Core OS / Core Kernel Interface.
- Implementation status: source implementation candidate.
- 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.