linux/net/ceph/messenger_v1.c

// SPDX-License-Identifier: GPL-2.0
#include <linux/ceph/ceph_debug.h>

#include <linux/bvec.h>
#include <linux/crc32c.h>
#include <linux/net.h>
#include <linux/socket.h>
#include <net/sock.h>

#include <linux/ceph/ceph_features.h>
#include <linux/ceph/decode.h>
#include <linux/ceph/libceph.h>
#include <linux/ceph/messenger.h>

/* static tag bytes (protocol control messages) */
static char tag_msg =;
static char tag_ack =;
static char tag_keepalive =;
static char tag_keepalive2 =;

/*
 * If @buf is NULL, discard up to @len bytes.
 */
static int ceph_tcp_recvmsg(struct socket *sock, void *buf, size_t len)
{}

static int ceph_tcp_recvpage(struct socket *sock, struct page *page,
		     int page_offset, size_t length)
{}

/*
 * write something.  @more is true if caller will be sending more data
 * shortly.
 */
static int ceph_tcp_sendmsg(struct socket *sock, struct kvec *iov,
			    size_t kvlen, size_t len, bool more)
{}

/*
 * @more: MSG_MORE or 0.
 */
static int ceph_tcp_sendpage(struct socket *sock, struct page *page,
			     int offset, size_t size, int more)
{}

static void con_out_kvec_reset(struct ceph_connection *con)
{}

static void con_out_kvec_add(struct ceph_connection *con,
				size_t size, void *data)
{}

/*
 * Chop off a kvec from the end.  Return residual number of bytes for
 * that kvec, i.e. how many bytes would have been written if the kvec
 * hadn't been nuked.
 */
static int con_out_kvec_skip(struct ceph_connection *con)
{}

static size_t sizeof_footer(struct ceph_connection *con)
{}

static void prepare_message_data(struct ceph_msg *msg, u32 data_len)
{}

/*
 * Prepare footer for currently outgoing message, and finish things
 * off.  Assumes out_kvec* are already valid.. we just add on to the end.
 */
static void prepare_write_message_footer(struct ceph_connection *con)
{}

/*
 * Prepare headers for the next outgoing message.
 */
static void prepare_write_message(struct ceph_connection *con)
{}

/*
 * Prepare an ack.
 */
static void prepare_write_ack(struct ceph_connection *con)
{}

/*
 * Prepare to share the seq during handshake
 */
static void prepare_write_seq(struct ceph_connection *con)
{}

/*
 * Prepare to write keepalive byte.
 */
static void prepare_write_keepalive(struct ceph_connection *con)
{}

/*
 * Connection negotiation.
 */

static int get_connect_authorizer(struct ceph_connection *con)
{}

/*
 * We connected to a peer and are saying hello.
 */
static void prepare_write_banner(struct ceph_connection *con)
{}

static void __prepare_write_connect(struct ceph_connection *con)
{}

static int prepare_write_connect(struct ceph_connection *con)
{}

/*
 * write as much of pending kvecs to the socket as we can.
 *  1 -> done
 *  0 -> socket full, but more to do
 * <0 -> error
 */
static int write_partial_kvec(struct ceph_connection *con)
{}

/*
 * Write as much message data payload as we can.  If we finish, queue
 * up the footer.
 *  1 -> done, footer is now queued in out_kvec[].
 *  0 -> socket full, but more to do
 * <0 -> error
 */
static int write_partial_message_data(struct ceph_connection *con)
{}

/*
 * write some zeros
 */
static int write_partial_skip(struct ceph_connection *con)
{}

/*
 * Prepare to read connection handshake, or an ack.
 */
static void prepare_read_banner(struct ceph_connection *con)
{}

static void prepare_read_connect(struct ceph_connection *con)
{}

static void prepare_read_ack(struct ceph_connection *con)
{}

static void prepare_read_seq(struct ceph_connection *con)
{}

static void prepare_read_tag(struct ceph_connection *con)
{}

static void prepare_read_keepalive_ack(struct ceph_connection *con)
{}

/*
 * Prepare to read a message.
 */
static int prepare_read_message(struct ceph_connection *con)
{}

static int read_partial(struct ceph_connection *con,
			int end, int size, void *object)
{}

/*
 * Read all or part of the connect-side handshake on a new connection
 */
static int read_partial_banner(struct ceph_connection *con)
{}

static int read_partial_connect(struct ceph_connection *con)
{}

/*
 * Verify the hello banner looks okay.
 */
static int verify_hello(struct ceph_connection *con)
{}

static int process_banner(struct ceph_connection *con)
{}

static int process_connect(struct ceph_connection *con)
{}

/*
 * read (part of) an ack
 */
static int read_partial_ack(struct ceph_connection *con)
{}

/*
 * We can finally discard anything that's been acked.
 */
static void process_ack(struct ceph_connection *con)
{}

static int read_partial_message_chunk(struct ceph_connection *con,
				      struct kvec *section,
				      unsigned int sec_len, u32 *crc)
{}

static inline int read_partial_message_section(struct ceph_connection *con,
					       struct kvec *section,
					       unsigned int sec_len, u32 *crc)
{}

static int read_partial_sparse_msg_extent(struct ceph_connection *con, u32 *crc)
{}

static int read_partial_sparse_msg_data(struct ceph_connection *con)
{}

static int read_partial_msg_data(struct ceph_connection *con)
{}

static int read_partial_msg_data_bounce(struct ceph_connection *con)
{}

/*
 * read (part of) a message.
 */
static int read_partial_message(struct ceph_connection *con)
{}

static int read_keepalive_ack(struct ceph_connection *con)
{}

/*
 * Read what we can from the socket.
 */
int ceph_con_v1_try_read(struct ceph_connection *con)
{}

/*
 * Write something to the socket.  Called in a worker thread when the
 * socket appears to be writeable and we have something ready to send.
 */
int ceph_con_v1_try_write(struct ceph_connection *con)
{}

void ceph_con_v1_revoke(struct ceph_connection *con)
{}

void ceph_con_v1_revoke_incoming(struct ceph_connection *con)
{}

bool ceph_con_v1_opened(struct ceph_connection *con)
{}

void ceph_con_v1_reset_session(struct ceph_connection *con)
{}

void ceph_con_v1_reset_protocol(struct ceph_connection *con)
{}