include/linux/ceph/osd_client.h
Source file repositories/reference/linux-study-clean/include/linux/ceph/osd_client.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/ceph/osd_client.h- Extension
.h- Size
- 18284 bytes
- Lines
- 644
- 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/bitrev.hlinux/completion.hlinux/kref.hlinux/mempool.hlinux/rbtree.hlinux/refcount.hlinux/ktime.hlinux/ceph/types.hlinux/ceph/osdmap.hlinux/ceph/messenger.hlinux/ceph/msgpool.hlinux/ceph/auth.hlinux/ceph/pagelist.h
Detected Declarations
struct ceph_msgstruct ceph_snap_contextstruct ceph_osd_requeststruct ceph_osd_clientstruct ceph_sparse_extentstruct ceph_sparse_readstruct ceph_osdstruct ceph_osd_datastruct ceph_osd_req_opstruct ceph_osd_request_targetstruct ceph_osd_requeststruct ceph_request_redirectstruct ceph_osd_reqidstruct ceph_blkin_trace_infostruct ceph_osd_linger_requeststruct ceph_watch_itemstruct ceph_spg_mappingstruct ceph_hobject_idstruct ceph_osd_backoffstruct ceph_osd_clientenum ceph_sparse_read_stateenum ceph_osd_data_typefunction ceph_hoid_build_hash_cachefunction ceph_osdmap_flagfunction ceph_alloc_sparse_ext_mapfunction ceph_sparse_ext_map_end
Annotated Snippet
struct ceph_sparse_extent {
u64 off;
u64 len;
} __packed;
/* Sparse read state machine state values */
enum ceph_sparse_read_state {
CEPH_SPARSE_READ_HDR = 0,
CEPH_SPARSE_READ_EXTENTS,
CEPH_SPARSE_READ_DATA_LEN,
CEPH_SPARSE_READ_DATA_PRE,
CEPH_SPARSE_READ_DATA,
};
/*
* A SPARSE_READ reply is a 32-bit count of extents, followed by an array of
* 64-bit offset/length pairs, and then all of the actual file data
* concatenated after it (sans holes).
*
* Unfortunately, we don't know how long the extent array is until we've
* started reading the data section of the reply. The caller should send down
* a destination buffer for the array, but we'll alloc one if it's too small
* or if the caller doesn't.
*/
struct ceph_sparse_read {
enum ceph_sparse_read_state sr_state; /* state machine state */
u64 sr_req_off; /* orig request offset */
u64 sr_req_len; /* orig request length */
u64 sr_pos; /* current pos in buffer */
int sr_index; /* current extent index */
u32 sr_datalen; /* length of actual data */
u32 sr_count; /* extent count in reply */
int sr_ext_len; /* length of extent array */
struct ceph_sparse_extent *sr_extent; /* extent array */
};
/*
* A given osd we're communicating with.
*
* Note that the o_requests tree can be searched while holding the "lock" mutex
* or the "o_requests_lock" spinlock. Insertion or removal requires both!
*/
struct ceph_osd {
refcount_t o_ref;
int o_sparse_op_idx;
struct ceph_osd_client *o_osdc;
int o_osd;
int o_incarnation;
struct rb_node o_node;
struct ceph_connection o_con;
spinlock_t o_requests_lock;
struct rb_root o_requests;
struct rb_root o_linger_requests;
struct rb_root o_backoff_mappings;
struct rb_root o_backoffs_by_id;
struct list_head o_osd_lru;
struct ceph_auth_handshake o_auth;
unsigned long lru_ttl;
struct list_head o_keepalive_item;
struct mutex lock;
struct ceph_sparse_read o_sparse_read;
};
#define CEPH_OSD_SLAB_OPS 2
#define CEPH_OSD_MAX_OPS 16
enum ceph_osd_data_type {
CEPH_OSD_DATA_TYPE_NONE = 0,
CEPH_OSD_DATA_TYPE_PAGES,
CEPH_OSD_DATA_TYPE_PAGELIST,
#ifdef CONFIG_BLOCK
CEPH_OSD_DATA_TYPE_BIO,
#endif /* CONFIG_BLOCK */
CEPH_OSD_DATA_TYPE_BVECS,
CEPH_OSD_DATA_TYPE_ITER,
};
struct ceph_osd_data {
enum ceph_osd_data_type type;
union {
struct {
struct page **pages;
u64 length;
u32 alignment;
bool pages_from_pool;
bool own_pages;
};
struct ceph_pagelist *pagelist;
#ifdef CONFIG_BLOCK
struct {
Annotation
- Immediate include surface: `linux/bitrev.h`, `linux/completion.h`, `linux/kref.h`, `linux/mempool.h`, `linux/rbtree.h`, `linux/refcount.h`, `linux/ktime.h`, `linux/ceph/types.h`.
- Detected declarations: `struct ceph_msg`, `struct ceph_snap_context`, `struct ceph_osd_request`, `struct ceph_osd_client`, `struct ceph_sparse_extent`, `struct ceph_sparse_read`, `struct ceph_osd`, `struct ceph_osd_data`, `struct ceph_osd_req_op`, `struct ceph_osd_request_target`.
- 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.