include/linux/ceph/messenger.h
Source file repositories/reference/linux-study-clean/include/linux/ceph/messenger.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/ceph/messenger.h- Extension
.h- Size
- 19879 bytes
- Lines
- 630
- 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
crypto/sha2.hlinux/bvec.hlinux/crypto.hlinux/kref.hlinux/mutex.hlinux/net.hlinux/radix-tree.hlinux/uio.hlinux/workqueue.hnet/net_namespace.hlinux/ceph/types.hlinux/ceph/buffer.h
Detected Declarations
struct ceph_msgstruct ceph_connectionstruct ceph_msg_data_cursorstruct ceph_connection_operationsstruct ceph_messengerstruct ceph_bio_iterstruct ceph_bvec_iterstruct ceph_msg_datastruct ceph_msg_data_cursorstruct ceph_msgstruct ceph_connection_v1_infostruct ceph_frame_descstruct ceph_gcm_noncestruct ceph_connection_v2_infostruct ceph_connectionenum ceph_msg_data_type
Annotated Snippet
struct ceph_connection_operations {
struct ceph_connection *(*get)(struct ceph_connection *);
void (*put)(struct ceph_connection *);
/* handle an incoming message. */
void (*dispatch) (struct ceph_connection *con, struct ceph_msg *m);
/* authorize an outgoing connection */
struct ceph_auth_handshake *(*get_authorizer) (
struct ceph_connection *con,
int *proto, int force_new);
int (*add_authorizer_challenge)(struct ceph_connection *con,
void *challenge_buf,
int challenge_buf_len);
int (*verify_authorizer_reply) (struct ceph_connection *con);
int (*invalidate_authorizer)(struct ceph_connection *con);
/* there was some error on the socket (disconnect, whatever) */
void (*fault) (struct ceph_connection *con);
/* a remote host as terminated a message exchange session, and messages
* we sent (or they tried to send us) may be lost. */
void (*peer_reset) (struct ceph_connection *con);
struct ceph_msg * (*alloc_msg) (struct ceph_connection *con,
struct ceph_msg_header *hdr,
int *skip);
void (*reencode_message) (struct ceph_msg *msg);
int (*sign_message) (struct ceph_msg *msg);
int (*check_message_signature) (struct ceph_msg *msg);
/* msgr2 authentication exchange */
int (*get_auth_request)(struct ceph_connection *con,
void *buf, int *buf_len,
void **authorizer, int *authorizer_len);
int (*handle_auth_reply_more)(struct ceph_connection *con,
void *reply, int reply_len,
void *buf, int *buf_len,
void **authorizer, int *authorizer_len);
int (*handle_auth_done)(struct ceph_connection *con,
u64 global_id, void *reply, int reply_len,
u8 *session_key, int *session_key_len,
u8 *con_secret, int *con_secret_len);
int (*handle_auth_bad_method)(struct ceph_connection *con,
int used_proto, int result,
const int *allowed_protos, int proto_cnt,
const int *allowed_modes, int mode_cnt);
/**
* sparse_read: read sparse data
* @con: connection we're reading from
* @cursor: data cursor for reading extents
* @buf: optional buffer to read into
*
* This should be called more than once, each time setting up to
* receive an extent into the current cursor position, and zeroing
* the holes between them.
*
* Returns amount of data to be read (in bytes), 0 if reading is
* complete, or -errno if there was an error.
*
* If @buf is set on a >0 return, then the data should be read into
* the provided buffer. Otherwise, it should be read into the cursor.
*
* The sparse read operation is expected to initialize the cursor
* with a length covering up to the end of the last extent.
*/
int (*sparse_read)(struct ceph_connection *con,
struct ceph_msg_data_cursor *cursor,
char **buf);
};
/* use format string %s%lld */
#define ENTITY_NAME(n) ceph_entity_type_name((n).type), le64_to_cpu((n).num)
struct ceph_messenger {
struct ceph_entity_inst inst; /* my name+address */
struct ceph_entity_addr my_enc_addr;
atomic_t stopping;
possible_net_t net;
/*
* the global_seq counts connections i (attempt to) initiate
* in order to disambiguate certain connect race conditions.
*/
u32 global_seq;
Annotation
- Immediate include surface: `crypto/sha2.h`, `linux/bvec.h`, `linux/crypto.h`, `linux/kref.h`, `linux/mutex.h`, `linux/net.h`, `linux/radix-tree.h`, `linux/uio.h`.
- Detected declarations: `struct ceph_msg`, `struct ceph_connection`, `struct ceph_msg_data_cursor`, `struct ceph_connection_operations`, `struct ceph_messenger`, `struct ceph_bio_iter`, `struct ceph_bvec_iter`, `struct ceph_msg_data`, `struct ceph_msg_data_cursor`, `struct ceph_msg`.
- 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.