From 1132a1c7a24beb4a57eda2a617ddb66eded2e447 Mon Sep 17 00:00:00 2001 From: patiencew Date: Wed, 24 Oct 2007 19:30:16 +0000 Subject: [PATCH] git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@1991 29311d96-e01e-0410-9327-a35deaab8ce9 --- trunk/ceph/kernel/kmsg.h | 39 ++++++++++++++++++++++----------------- 1 file changed, 22 insertions(+), 17 deletions(-) diff --git a/trunk/ceph/kernel/kmsg.h b/trunk/ceph/kernel/kmsg.h index ed0364f05ae01..f3650e3a59f5c 100644 --- a/trunk/ceph/kernel/kmsg.h +++ b/trunk/ceph/kernel/kmsg.h @@ -11,52 +11,57 @@ /* dispatch function type */ typedef void (*ceph_kmsg_work_dispatch_t)(struct work_struct *); -extern struct workqueue_struct *wq; /* work queue (worker threads) */ +extern struct workqueue_struct *rwq; /* receive work queue (worker threads) */ +extern struct workqueue_struct *swq; /* send work queue (worker threads) */ struct ceph_kmsgr { void *m_parent; struct radix_tree_root mpipes; /* other nodes talk to */ struct ceph_accepter accepter; /* listener or select thread info */ - struct work_struct *work; /* received work */ -/* note: work->func = dispatch func */ }; struct ceph_message { atomic_t nref; + int mflags; struct ceph_message_header *msghdr; /* header */ - struct ceph_bufferlist payload; + struct ceph_bufferlist *payload; struct list_head m_list_head; }; struct ceph_connection { - int p_sd; /* socket descriptor */ - __u64 p_out_seq; /* last message sent */ - __u64 p_in_seq; /* last message received */ + struct socket sock; /* connection socket */ + __u64 out_seq; /* last message sent */ + __u64 in_seq; /* last message received */ /* out queue */ - struct list_head p_out_queue; - struct ceph_message *p_out_partial; /* partially sent message */ - struct ceph_bufferlist_iterator p_out_pos; - struct list_head p_out_sent; /* sent but unacked; may need resend if connection drops */ + struct list_head out_queue; + spinlock_t out_queue_lock; + struct ceph_message *out_partial; /* partially sent message */ + struct ceph_bufferlist_iterator out_pos; + struct list_head out_sent; /* sent but unacked; may need resend if connection drops */ /* partially read message contents */ - struct ceph_message *p_in_partial; + struct ceph_message *in_partial; + struct work_struct *rwork; /* received work */ + struct work_struct *swork; /* send work */ +/* note: work->func = dispatch func */ + int retries; }; /* * function prototypes */ -extern void ceph_read_message(struct ceph_message *message); -extern void ceph_write_message(struct ceph_message *message); +extern struct ceph_message *ceph_read_message(void); +extern int ceph_send_message(struct ceph_message *message); -__inline__ void ceph_put_msg(struct ceph_message *msg) { +static __inline__ void ceph_put_msg(struct ceph_message *msg) { if (atomic_dec_and_test(&msg->nref)) { - ceph_bufferlist_clear(msg->payload); + ceph_bl_clear(msg->payload); kfree(msg); } } -__inline__ void ceph_get_msg(struct ceph_message *msg) { +static __inline__ void ceph_get_msg(struct ceph_message *msg) { atomic_inc(&msg->nref); } -- 2.39.5