include/linux/blkdev.h
Source file repositories/reference/linux-study-clean/include/linux/blkdev.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/blkdev.h- Extension
.h- Size
- 55929 bytes
- Lines
- 1921
- Domain
- Representative Device Path
- Bucket
- PCIe NVMe Storage Path
- Inferred role
- Representative Device Path: operation-table or driver-model contract
- Status
- pattern implementation candidate
Why This File Exists
Part of the selected hardware vertical slice: PCI discovery, driver binding, NVMe queues, block requests, DMA, interrupts, and completion.
- Part of the selected hardware vertical slice: PCI discovery, driver binding, NVMe queues, block requests, DMA, interrupts, and completion.
- Defines an operation table; this is where Linux turns generic core objects into subsystem-specific behavior.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/types.hlinux/blk_types.hlinux/device.hlinux/list.hlinux/llist.hlinux/minmax.hlinux/timer.hlinux/workqueue.hlinux/completion.hlinux/wait.hlinux/bio.hlinux/gfp.hlinux/kdev_t.hlinux/rcupdate.hlinux/percpu-refcount.hlinux/blkzoned.hlinux/sched.hlinux/sbitmap.hlinux/uuid.hlinux/xarray.hlinux/file.hlinux/lockdep.h
Detected Declarations
struct modulestruct request_queuestruct elevator_queuestruct blk_tracestruct requeststruct sg_io_hdrstruct blkcg_gqstruct blk_flush_queuestruct kiocbstruct pr_opsstruct rq_qosstruct hd_geometrystruct blk_report_zones_argsstruct blk_queue_statsstruct blk_stat_callbackstruct blk_crypto_profilestruct partition_meta_infostruct disk_eventsstruct badblocksstruct blk_integritystruct gendiskstruct queue_limitsstruct blk_independent_access_rangestruct blk_independent_access_rangesstruct request_queuestruct rq_liststruct blk_plugstruct blk_plug_cbstruct blk_plug_cbstruct blk_plugstruct block_device_operationsstruct blk_holder_opsstruct io_comp_batchenum blk_integrity_checksumenum blk_default_limitsenum blk_unique_idfunction disk_openersfunction disk_has_partscanfunction disk_devtfunction blk_validate_block_sizefunction blk_op_is_passthroughfunction queue_is_mqfunction queue_rpm_statusfunction queue_rpm_statusfunction blk_queue_is_zonedfunction disk_zone_nofunction bdev_max_open_zonesfunction bdev_max_active_zones
Annotated Snippet
const struct blk_mq_ops *mq_ops;
/* sw queues */
struct blk_mq_ctx __percpu *queue_ctx;
/*
* various queue flags, see QUEUE_* below
*/
unsigned long queue_flags;
unsigned int __data_racy rq_timeout;
unsigned int queue_depth;
refcount_t refs;
/* hw dispatch queues */
unsigned int nr_hw_queues;
struct blk_mq_hw_ctx * __rcu *queue_hw_ctx __counted_by_ptr(nr_hw_queues);
struct percpu_ref q_usage_counter;
struct lock_class_key io_lock_cls_key;
struct lockdep_map io_lockdep_map;
struct lock_class_key q_lock_cls_key;
struct lockdep_map q_lockdep_map;
struct request *last_merge;
spinlock_t queue_lock;
int quiesce_depth;
struct gendisk *disk;
/*
* mq queue kobject
*/
struct kobject *mq_kobj;
struct queue_limits limits;
#ifdef CONFIG_PM
struct device *dev;
enum rpm_status rpm_status;
#endif
/*
* Number of contexts that have called blk_set_pm_only(). If this
* counter is above zero then only RQF_PM requests are processed.
*/
atomic_t pm_only;
struct blk_queue_stats *stats;
struct rq_qos *rq_qos;
struct mutex rq_qos_mutex;
/*
* ida allocated id for this queue. Used to index queues from
* ioctx.
*/
int id;
/*
* queue settings
*/
unsigned int nr_requests; /* Max # of requests */
unsigned int async_depth; /* Max # of async requests */
#ifdef CONFIG_BLK_INLINE_ENCRYPTION
struct blk_crypto_profile *crypto_profile;
struct kobject *crypto_kobject;
#endif
struct timer_list timeout;
struct work_struct timeout_work;
atomic_t nr_active_requests_shared_tags;
struct blk_mq_tags *sched_shared_tags;
struct list_head icq_list;
#ifdef CONFIG_BLK_CGROUP
DECLARE_BITMAP (blkcg_pols, BLKCG_MAX_POLS);
struct blkcg_gq *root_blkg;
struct list_head blkg_list;
struct mutex blkcg_mutex;
#endif
int node;
Annotation
- Immediate include surface: `linux/types.h`, `linux/blk_types.h`, `linux/device.h`, `linux/list.h`, `linux/llist.h`, `linux/minmax.h`, `linux/timer.h`, `linux/workqueue.h`.
- Detected declarations: `struct module`, `struct request_queue`, `struct elevator_queue`, `struct blk_trace`, `struct request`, `struct sg_io_hdr`, `struct blkcg_gq`, `struct blk_flush_queue`, `struct kiocb`, `struct pr_ops`.
- Atlas domain: Representative Device Path / PCIe NVMe Storage Path.
- Implementation status: pattern implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.