drivers/block/rnbd/rnbd-proto.h
Source file repositories/reference/linux-study-clean/drivers/block/rnbd/rnbd-proto.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/block/rnbd/rnbd-proto.h- Extension
.h- Size
- 7973 bytes
- Lines
- 322
- Domain
- Driver Families
- Bucket
- drivers/block
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/types.hlinux/blk-mq.hlinux/limits.hlinux/inet.hlinux/in.hlinux/in6.hrdma/ib.h
Detected Declarations
struct rnbd_msg_hdrstruct rnbd_msg_sess_infostruct rnbd_msg_sess_info_rspstruct rnbd_msg_openstruct rnbd_msg_closestruct rnbd_msg_open_rspstruct rnbd_msg_ioenum rnbd_msg_typeenum rnbd_access_modeenum rnbd_cache_policyenum rnbd_io_flagsfunction rnbd_opfunction rnbd_flagsfunction rnbd_to_bio_flagsfunction rq_to_rnbd_flags
Annotated Snippet
struct rnbd_msg_hdr {
__le16 type;
/* private: */
__le16 __padding;
};
/*
* We allow to map RO many times and RW only once. We allow to map yet another
* time RW, if MIGRATION is provided (second RW export can be required for
* example for VM migration)
*/
enum rnbd_access_mode {
RNBD_ACCESS_RO,
RNBD_ACCESS_RW,
RNBD_ACCESS_MIGRATION,
};
static const __maybe_unused struct {
enum rnbd_access_mode mode;
const char *str;
} rnbd_access_modes[] = {
[RNBD_ACCESS_RO] = {RNBD_ACCESS_RO, "ro"},
[RNBD_ACCESS_RW] = {RNBD_ACCESS_RW, "rw"},
[RNBD_ACCESS_MIGRATION] = {RNBD_ACCESS_MIGRATION, "migration"},
};
/**
* struct rnbd_msg_sess_info - initial session info from client to server
* @hdr: message header
* @ver: RNBD protocol version
*/
struct rnbd_msg_sess_info {
struct rnbd_msg_hdr hdr;
u8 ver;
/* private: */
u8 reserved[31];
};
/**
* struct rnbd_msg_sess_info_rsp - initial session info from server to client
* @hdr: message header
* @ver: RNBD protocol version
*/
struct rnbd_msg_sess_info_rsp {
struct rnbd_msg_hdr hdr;
u8 ver;
/* private: */
u8 reserved[31];
};
/**
* struct rnbd_msg_open - request to open a remote device.
* @hdr: message header
* @access_mode: the mode to open remote device, valid values see:
* enum rnbd_access_mode
* @dev_name: device path on remote side
*/
struct rnbd_msg_open {
struct rnbd_msg_hdr hdr;
u8 access_mode;
/* private: */
u8 resv1;
/* public: */
s8 dev_name[NAME_MAX];
/* private: */
u8 reserved[3];
};
/**
* struct rnbd_msg_close - request to close a remote device.
* @hdr: message header
* @device_id: device_id on server side to identify the device
*/
struct rnbd_msg_close {
struct rnbd_msg_hdr hdr;
__le32 device_id;
};
enum rnbd_cache_policy {
RNBD_FUA = 1 << 0,
RNBD_WRITEBACK = 1 << 1,
};
/**
* struct rnbd_msg_open_rsp - response message to RNBD_MSG_OPEN
* @hdr: message header
* @device_id: device_id on server side to identify the device
* @nsectors: number of sectors in the usual 512b unit
* @max_hw_sectors: max hardware sectors in the usual 512b unit
* @max_write_zeroes_sectors: max sectors for WRITE ZEROES in the 512b unit
Annotation
- Immediate include surface: `linux/types.h`, `linux/blk-mq.h`, `linux/limits.h`, `linux/inet.h`, `linux/in.h`, `linux/in6.h`, `rdma/ib.h`.
- Detected declarations: `struct rnbd_msg_hdr`, `struct rnbd_msg_sess_info`, `struct rnbd_msg_sess_info_rsp`, `struct rnbd_msg_open`, `struct rnbd_msg_close`, `struct rnbd_msg_open_rsp`, `struct rnbd_msg_io`, `enum rnbd_msg_type`, `enum rnbd_access_mode`, `enum rnbd_cache_policy`.
- Atlas domain: Driver Families / drivers/block.
- 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.