summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/transport.h
diff options
context:
space:
mode:
authorAnand V. Avati <avati@amp.gluster.com>2009-05-07 01:24:41 +0530
committerAnand V. Avati <avati@amp.gluster.com>2009-05-07 01:24:41 +0530
commitf9f5519b66a25651eb03de577f68d481abdd4c40 (patch)
treeb87c19fa62033da1dbc8a11ce6dbd5a9cb3b3ad8 /libglusterfs/src/transport.h
parent12eb832e255a1abb90434ab3e0d1e1632ae7ce03 (diff)
transport shortcut b/w client and server
This patch makes the server pass back the transport pointer of the client. If the UUID matches, the client makes the local transport 'shortcut' with the remote transport (pointer received from server) The shortcut simulates a socket queue. Instead of serialized messages going over the network and getting queued in the tcp socket queue, the messages get queued in a transport specific queue picked by a polling thread.
Diffstat (limited to 'libglusterfs/src/transport.h')
-rw-r--r--libglusterfs/src/transport.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/libglusterfs/src/transport.h b/libglusterfs/src/transport.h
index a7cd5ec8f41..2d85c76cca1 100644
--- a/libglusterfs/src/transport.h
+++ b/libglusterfs/src/transport.h
@@ -40,6 +40,13 @@ typedef struct peer_info {
char identifier[UNIX_PATH_MAX];
}peer_info_t;
+struct transport_msg {
+ struct list_head list;
+ char *hdr;
+ int hdrlen;
+ struct iobuf *iobuf;
+};
+
struct transport {
struct transport_ops *ops;
void *private;
@@ -55,6 +62,16 @@ struct transport {
/* int (*notify) (transport_t *this, int event, void *data); */
peer_info_t peerinfo;
peer_info_t myinfo;
+
+ transport_t *peer_trans;
+ struct {
+ pthread_mutex_t mutex;
+ pthread_cond_t cond;
+ pthread_t thread;
+ struct list_head msgs;
+ struct transport_msg *msg;
+ } handover;
+
};
struct transport_ops {
@@ -84,4 +101,6 @@ transport_t *transport_load (dict_t *options, xlator_t *xl);
transport_t *transport_ref (transport_t *trans);
int32_t transport_unref (transport_t *trans);
+int transport_setpeer (transport_t *trans, transport_t *trans_peer);
+
#endif /* __TRANSPORT_H__ */