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.

Dependency Surface

Detected Declarations

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

Implementation Notes