io_uring/io_uring.h
Source file repositories/reference/linux-study-clean/io_uring/io_uring.h
File Facts
- System
- Linux kernel
- Corpus path
io_uring/io_uring.h- Extension
.h- Size
- 16369 bytes
- Lines
- 586
- Domain
- Kernel Services
- Bucket
- io_uring
- Inferred role
- Kernel Services: implementation source
- Status
- source implementation candidate
Why This File Exists
Shared kernel service surface used by multiple subsystems, including helpers, cryptography, virtualization support, and async I/O infrastructure.
- Shared kernel service surface used by multiple subsystems, including helpers, cryptography, virtualization support, and async I/O infrastructure.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- 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/errno.hlinux/lockdep.hlinux/resume_user_mode.hlinux/poll.hlinux/io_uring_types.huapi/linux/eventpoll.halloc_cache.hio-wq.hslist.htw.hopdef.htrace/events/io_uring.h
Detected Declarations
struct io_rings_layoutstruct io_ctx_configstruct io_defer_entrystruct io_wait_queuefunction io_should_wakefunction io_lockdep_assert_cq_lockedfunction io_is_compatfunction io_submit_flush_completionsfunction io_get_cqe_overflowfunction io_get_cqefunction io_defer_get_uncommited_cqefunction io_fill_cqe_reqfunction req_set_failfunction io_req_set_resfunction ctx_cqe32_flagsfunction io_req_set_res32function req_has_async_datafunction io_req_async_data_clearfunction io_req_async_data_freefunction io_put_filefunction io_ring_submit_unlockfunction io_ring_submit_lockfunction io_commit_cqringfunction __io_wq_wakefunction io_poll_wq_wakefunction io_cqring_wakefunction __io_sqring_fullfunction io_sqring_fullfunction __io_sqring_entriesfunction io_sqring_entriesfunction io_req_complete_deferfunction io_commit_cqring_flushfunction io_get_task_refsfunction io_req_cache_emptyfunction io_alloc_reqfunction io_req_queue_tw_completefunction io_file_can_pollfunction io_is_uring_cmdfunction io_get_timefunction io_has_work
Annotated Snippet
struct io_rings_layout {
/* size of CQ + headers + SQ offset array */
size_t rings_size;
size_t sq_size;
size_t sq_array_offset;
};
struct io_ctx_config {
struct io_uring_params p;
struct io_rings_layout layout;
struct io_uring_params __user *uptr;
};
#define IORING_FEAT_FLAGS (IORING_FEAT_SINGLE_MMAP |\
IORING_FEAT_NODROP |\
IORING_FEAT_SUBMIT_STABLE |\
IORING_FEAT_RW_CUR_POS |\
IORING_FEAT_CUR_PERSONALITY |\
IORING_FEAT_FAST_POLL |\
IORING_FEAT_POLL_32BITS |\
IORING_FEAT_SQPOLL_NONFIXED |\
IORING_FEAT_EXT_ARG |\
IORING_FEAT_NATIVE_WORKERS |\
IORING_FEAT_RSRC_TAGS |\
IORING_FEAT_CQE_SKIP |\
IORING_FEAT_LINKED_FILE |\
IORING_FEAT_REG_REG_RING |\
IORING_FEAT_RECVSEND_BUNDLE |\
IORING_FEAT_MIN_TIMEOUT |\
IORING_FEAT_RW_ATTR |\
IORING_FEAT_NO_IOWAIT)
#define IORING_SETUP_FLAGS (IORING_SETUP_IOPOLL |\
IORING_SETUP_SQPOLL |\
IORING_SETUP_SQ_AFF |\
IORING_SETUP_CQSIZE |\
IORING_SETUP_CLAMP |\
IORING_SETUP_ATTACH_WQ |\
IORING_SETUP_R_DISABLED |\
IORING_SETUP_SUBMIT_ALL |\
IORING_SETUP_COOP_TASKRUN |\
IORING_SETUP_TASKRUN_FLAG |\
IORING_SETUP_SQE128 |\
IORING_SETUP_CQE32 |\
IORING_SETUP_SINGLE_ISSUER |\
IORING_SETUP_DEFER_TASKRUN |\
IORING_SETUP_NO_MMAP |\
IORING_SETUP_REGISTERED_FD_ONLY |\
IORING_SETUP_NO_SQARRAY |\
IORING_SETUP_HYBRID_IOPOLL |\
IORING_SETUP_CQE_MIXED |\
IORING_SETUP_SQE_MIXED |\
IORING_SETUP_SQ_REWIND)
#define IORING_ENTER_FLAGS (IORING_ENTER_GETEVENTS |\
IORING_ENTER_SQ_WAKEUP |\
IORING_ENTER_SQ_WAIT |\
IORING_ENTER_EXT_ARG |\
IORING_ENTER_REGISTERED_RING |\
IORING_ENTER_ABS_TIMER |\
IORING_ENTER_EXT_ARG_REG |\
IORING_ENTER_NO_IOWAIT)
#define SQE_VALID_FLAGS (IOSQE_FIXED_FILE |\
IOSQE_IO_DRAIN |\
IOSQE_IO_LINK |\
IOSQE_IO_HARDLINK |\
IOSQE_ASYNC |\
IOSQE_BUFFER_SELECT |\
IOSQE_CQE_SKIP_SUCCESS)
#define IO_REQ_LINK_FLAGS (REQ_F_LINK | REQ_F_HARDLINK)
/*
* Complaint timeout for io_uring cancelation exits, and for io-wq exit
* worker waiting.
*/
#define IO_URING_EXIT_WAIT_MAX (HZ * 60 * 5)
enum {
IOU_COMPLETE = 0,
IOU_ISSUE_SKIP_COMPLETE = -EIOCBQUEUED,
/*
* The request has more work to do and should be retried. io_uring will
* attempt to wait on the file for eligible opcodes, but otherwise
* it'll be handed to iowq for blocking execution. It works for normal
Annotation
- Immediate include surface: `linux/errno.h`, `linux/lockdep.h`, `linux/resume_user_mode.h`, `linux/poll.h`, `linux/io_uring_types.h`, `uapi/linux/eventpoll.h`, `alloc_cache.h`, `io-wq.h`.
- Detected declarations: `struct io_rings_layout`, `struct io_ctx_config`, `struct io_defer_entry`, `struct io_wait_queue`, `function io_should_wake`, `function io_lockdep_assert_cq_locked`, `function io_is_compat`, `function io_submit_flush_completions`, `function io_get_cqe_overflow`, `function io_get_cqe`.
- Atlas domain: Kernel Services / io_uring.
- 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.