#include <linux/ceph/ceph_debug.h>
#include <linux/crc32c.h>
#include <linux/ctype.h>
#include <linux/highmem.h>
#include <linux/inet.h>
#include <linux/kthread.h>
#include <linux/net.h>
#include <linux/nsproxy.h>
#include <linux/sched/mm.h>
#include <linux/slab.h>
#include <linux/socket.h>
#include <linux/string.h>
#ifdef CONFIG_BLOCK
#include <linux/bio.h>
#endif
#include <linux/dns_resolver.h>
#include <net/tcp.h>
#include <trace/events/sock.h>
#include <linux/ceph/ceph_features.h>
#include <linux/ceph/libceph.h>
#include <linux/ceph/messenger.h>
#include <linux/ceph/decode.h>
#include <linux/ceph/pagelist.h>
#include <linux/export.h>
#define CON_SOCK_STATE_NEW …
#define CON_SOCK_STATE_CLOSED …
#define CON_SOCK_STATE_CONNECTING …
#define CON_SOCK_STATE_CONNECTED …
#define CON_SOCK_STATE_CLOSING …
static bool con_flag_valid(unsigned long con_flag)
{ … }
void ceph_con_flag_clear(struct ceph_connection *con, unsigned long con_flag)
{ … }
void ceph_con_flag_set(struct ceph_connection *con, unsigned long con_flag)
{ … }
bool ceph_con_flag_test(struct ceph_connection *con, unsigned long con_flag)
{ … }
bool ceph_con_flag_test_and_clear(struct ceph_connection *con,
unsigned long con_flag)
{ … }
bool ceph_con_flag_test_and_set(struct ceph_connection *con,
unsigned long con_flag)
{ … }
static struct kmem_cache *ceph_msg_cache;
#ifdef CONFIG_LOCKDEP
static struct lock_class_key socket_class;
#endif
static void queue_con(struct ceph_connection *con);
static void cancel_con(struct ceph_connection *con);
static void ceph_con_workfn(struct work_struct *);
static void con_fault(struct ceph_connection *con);
#define ADDR_STR_COUNT_LOG …
#define ADDR_STR_COUNT …
#define ADDR_STR_COUNT_MASK …
#define MAX_ADDR_STR_LEN …
static char addr_str[ADDR_STR_COUNT][MAX_ADDR_STR_LEN];
static atomic_t addr_str_seq = …;
struct page *ceph_zero_page;
const char *ceph_pr_addr(const struct ceph_entity_addr *addr)
{ … }
EXPORT_SYMBOL(…);
void ceph_encode_my_addr(struct ceph_messenger *msgr)
{ … }
static struct workqueue_struct *ceph_msgr_wq;
static int ceph_msgr_slab_init(void)
{ … }
static void ceph_msgr_slab_exit(void)
{ … }
static void _ceph_msgr_exit(void)
{ … }
int __init ceph_msgr_init(void)
{ … }
void ceph_msgr_exit(void)
{ … }
void ceph_msgr_flush(void)
{ … }
EXPORT_SYMBOL(…);
static void con_sock_state_init(struct ceph_connection *con)
{ … }
static void con_sock_state_connecting(struct ceph_connection *con)
{ … }
static void con_sock_state_connected(struct ceph_connection *con)
{ … }
static void con_sock_state_closing(struct ceph_connection *con)
{ … }
static void con_sock_state_closed(struct ceph_connection *con)
{ … }
static void ceph_sock_data_ready(struct sock *sk)
{ … }
static void ceph_sock_write_space(struct sock *sk)
{ … }
static void ceph_sock_state_change(struct sock *sk)
{ … }
static void set_sock_callbacks(struct socket *sock,
struct ceph_connection *con)
{ … }
int ceph_tcp_connect(struct ceph_connection *con)
{ … }
int ceph_con_close_socket(struct ceph_connection *con)
{ … }
static void ceph_con_reset_protocol(struct ceph_connection *con)
{ … }
static void ceph_msg_remove(struct ceph_msg *msg)
{ … }
static void ceph_msg_remove_list(struct list_head *head)
{ … }
void ceph_con_reset_session(struct ceph_connection *con)
{ … }
void ceph_con_close(struct ceph_connection *con)
{ … }
EXPORT_SYMBOL(…);
void ceph_con_open(struct ceph_connection *con,
__u8 entity_type, __u64 entity_num,
struct ceph_entity_addr *addr)
{ … }
EXPORT_SYMBOL(…);
bool ceph_con_opened(struct ceph_connection *con)
{ … }
void ceph_con_init(struct ceph_connection *con, void *private,
const struct ceph_connection_operations *ops,
struct ceph_messenger *msgr)
{ … }
EXPORT_SYMBOL(…);
u32 ceph_get_global_seq(struct ceph_messenger *msgr, u32 gt)
{ … }
void ceph_con_discard_sent(struct ceph_connection *con, u64 ack_seq)
{ … }
void ceph_con_discard_requeued(struct ceph_connection *con, u64 reconnect_seq)
{ … }
#ifdef CONFIG_BLOCK
static void ceph_msg_data_bio_cursor_init(struct ceph_msg_data_cursor *cursor,
size_t length)
{ … }
static struct page *ceph_msg_data_bio_next(struct ceph_msg_data_cursor *cursor,
size_t *page_offset,
size_t *length)
{ … }
static bool ceph_msg_data_bio_advance(struct ceph_msg_data_cursor *cursor,
size_t bytes)
{ … }
#endif
static void ceph_msg_data_bvecs_cursor_init(struct ceph_msg_data_cursor *cursor,
size_t length)
{ … }
static struct page *ceph_msg_data_bvecs_next(struct ceph_msg_data_cursor *cursor,
size_t *page_offset,
size_t *length)
{ … }
static bool ceph_msg_data_bvecs_advance(struct ceph_msg_data_cursor *cursor,
size_t bytes)
{ … }
static void ceph_msg_data_pages_cursor_init(struct ceph_msg_data_cursor *cursor,
size_t length)
{ … }
static struct page *
ceph_msg_data_pages_next(struct ceph_msg_data_cursor *cursor,
size_t *page_offset, size_t *length)
{ … }
static bool ceph_msg_data_pages_advance(struct ceph_msg_data_cursor *cursor,
size_t bytes)
{ … }
static void
ceph_msg_data_pagelist_cursor_init(struct ceph_msg_data_cursor *cursor,
size_t length)
{ … }
static struct page *
ceph_msg_data_pagelist_next(struct ceph_msg_data_cursor *cursor,
size_t *page_offset, size_t *length)
{ … }
static bool ceph_msg_data_pagelist_advance(struct ceph_msg_data_cursor *cursor,
size_t bytes)
{ … }
static void ceph_msg_data_iter_cursor_init(struct ceph_msg_data_cursor *cursor,
size_t length)
{ … }
static struct page *ceph_msg_data_iter_next(struct ceph_msg_data_cursor *cursor,
size_t *page_offset, size_t *length)
{ … }
static bool ceph_msg_data_iter_advance(struct ceph_msg_data_cursor *cursor,
size_t bytes)
{ … }
static void __ceph_msg_data_cursor_init(struct ceph_msg_data_cursor *cursor)
{ … }
void ceph_msg_data_cursor_init(struct ceph_msg_data_cursor *cursor,
struct ceph_msg *msg, size_t length)
{ … }
struct page *ceph_msg_data_next(struct ceph_msg_data_cursor *cursor,
size_t *page_offset, size_t *length)
{ … }
void ceph_msg_data_advance(struct ceph_msg_data_cursor *cursor, size_t bytes)
{ … }
u32 ceph_crc32c_page(u32 crc, struct page *page, unsigned int page_offset,
unsigned int length)
{ … }
bool ceph_addr_is_blank(const struct ceph_entity_addr *addr)
{ … }
EXPORT_SYMBOL(…);
int ceph_addr_port(const struct ceph_entity_addr *addr)
{ … }
void ceph_addr_set_port(struct ceph_entity_addr *addr, int p)
{ … }
static int ceph_pton(const char *str, size_t len, struct ceph_entity_addr *addr,
char delim, const char **ipend)
{ … }
#ifdef CONFIG_CEPH_LIB_USE_DNS_RESOLVER
static int ceph_dns_resolve_name(const char *name, size_t namelen,
struct ceph_entity_addr *addr, char delim, const char **ipend)
{ … }
#else
static inline int ceph_dns_resolve_name(const char *name, size_t namelen,
struct ceph_entity_addr *addr, char delim, const char **ipend)
{
return -EINVAL;
}
#endif
static int ceph_parse_server_name(const char *name, size_t namelen,
struct ceph_entity_addr *addr, char delim, const char **ipend)
{ … }
int ceph_parse_ips(const char *c, const char *end,
struct ceph_entity_addr *addr,
int max_count, int *count, char delim)
{ … }
void ceph_con_process_message(struct ceph_connection *con)
{ … }
static int queue_con_delay(struct ceph_connection *con, unsigned long delay)
{ … }
static void queue_con(struct ceph_connection *con)
{ … }
static void cancel_con(struct ceph_connection *con)
{ … }
static bool con_sock_closed(struct ceph_connection *con)
{ … }
static bool con_backoff(struct ceph_connection *con)
{ … }
static void con_fault_finish(struct ceph_connection *con)
{ … }
static void ceph_con_workfn(struct work_struct *work)
{ … }
static void con_fault(struct ceph_connection *con)
{ … }
void ceph_messenger_reset_nonce(struct ceph_messenger *msgr)
{ … }
void ceph_messenger_init(struct ceph_messenger *msgr,
struct ceph_entity_addr *myaddr)
{ … }
void ceph_messenger_fini(struct ceph_messenger *msgr)
{ … }
static void msg_con_set(struct ceph_msg *msg, struct ceph_connection *con)
{ … }
static void clear_standby(struct ceph_connection *con)
{ … }
void ceph_con_send(struct ceph_connection *con, struct ceph_msg *msg)
{ … }
EXPORT_SYMBOL(…);
void ceph_msg_revoke(struct ceph_msg *msg)
{ … }
void ceph_msg_revoke_incoming(struct ceph_msg *msg)
{ … }
void ceph_con_keepalive(struct ceph_connection *con)
{ … }
EXPORT_SYMBOL(…);
bool ceph_con_keepalive_expired(struct ceph_connection *con,
unsigned long interval)
{ … }
static struct ceph_msg_data *ceph_msg_data_add(struct ceph_msg *msg)
{ … }
static void ceph_msg_data_destroy(struct ceph_msg_data *data)
{ … }
void ceph_msg_data_add_pages(struct ceph_msg *msg, struct page **pages,
size_t length, size_t alignment, bool own_pages)
{ … }
EXPORT_SYMBOL(…);
void ceph_msg_data_add_pagelist(struct ceph_msg *msg,
struct ceph_pagelist *pagelist)
{ … }
EXPORT_SYMBOL(…);
#ifdef CONFIG_BLOCK
void ceph_msg_data_add_bio(struct ceph_msg *msg, struct ceph_bio_iter *bio_pos,
u32 length)
{ … }
EXPORT_SYMBOL(…);
#endif
void ceph_msg_data_add_bvecs(struct ceph_msg *msg,
struct ceph_bvec_iter *bvec_pos)
{ … }
EXPORT_SYMBOL(…);
void ceph_msg_data_add_iter(struct ceph_msg *msg,
struct iov_iter *iter)
{ … }
struct ceph_msg *ceph_msg_new2(int type, int front_len, int max_data_items,
gfp_t flags, bool can_fail)
{ … }
EXPORT_SYMBOL(…);
struct ceph_msg *ceph_msg_new(int type, int front_len, gfp_t flags,
bool can_fail)
{ … }
EXPORT_SYMBOL(…);
static int ceph_alloc_middle(struct ceph_connection *con, struct ceph_msg *msg)
{ … }
int ceph_con_in_msg_alloc(struct ceph_connection *con,
struct ceph_msg_header *hdr, int *skip)
{ … }
void ceph_con_get_out_msg(struct ceph_connection *con)
{ … }
static void ceph_msg_free(struct ceph_msg *m)
{ … }
static void ceph_msg_release(struct kref *kref)
{ … }
struct ceph_msg *ceph_msg_get(struct ceph_msg *msg)
{ … }
EXPORT_SYMBOL(…);
void ceph_msg_put(struct ceph_msg *msg)
{ … }
EXPORT_SYMBOL(…);
void ceph_msg_dump(struct ceph_msg *msg)
{ … }
EXPORT_SYMBOL(…);