]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@2025 29311d96-e01e-0410-9327-a35deaa...
authorpatiencew <patiencew@29311d96-e01e-0410-9327-a35deaab8ce9>
Tue, 6 Nov 2007 22:16:26 +0000 (22:16 +0000)
committerpatiencew <patiencew@29311d96-e01e-0410-9327-a35deaab8ce9>
Tue, 6 Nov 2007 22:16:26 +0000 (22:16 +0000)
trunk/ceph/kernel/kmsg.h

index 59266032c01e62764b332de0ac447a7a876bc44c..1cc4549cee93380b8ce3b89e1564bed76bb988a6 100644 (file)
@@ -8,17 +8,27 @@
 #include <linux/ceph_fs.h>
 #include "bufferlist.h"
 
-/* TBD:  this will be filled into ceph_kmsgr.athread during mount */
-extern struct task_struct *athread;
 
 typedef void (*ceph_kmsgr_dispatch_t)(void *, struct ceph_message *);
 
+/* list of pollable file descriptors , this will probably change a bit */
+struct ceph_pollable {
+        struct list_head poll_list;
+       struct pollfd *pollfd;
+       struct file *file;
+       poll_table *pwait;
+};
+
+struct ceph_poll_task {
+        struct task_struct *poll_task;
+       struct ceph_pollable pds;
+        int nfds;
+}
+
 struct ceph_kmsgr {
        void *parent;
        ceph_kmsgr_dispatch_t dispatch;
-
-       struct task_struct *athread;
-
+        struct ceph_poll_task *poll_task;
        spinlock_t con_lock;
        struct list_head con_all;        /* all connections */
        struct list_head con_accepting;  /* doing handshake */
@@ -34,21 +44,21 @@ struct ceph_message {
        atomic_t nref;
 };
 
-/* current state of connection, probably won't need all these.. */
+/* current state of connection */
 enum ceph_connection_state {
-       NEW,
-       ACCEPTING,
-       CONNECTING,
-       OPEN,
-       REJECTING,
-       CLOSED
+       NEW = 1,
+       ACCEPTING = 2,
+       CONNECTING = 4,
+       OPEN = 8,
+       REJECTING = 16,
+       CLOSED = 32
 };
 
 struct ceph_connection {
        struct socket *sock;    /* connection socket */
        
        atomic_t nref;
-       spinlock_t con_lock;    /* TDB: may need a mutex here depending if */
+       spinlock_t con_lock;    /* connection lock */
 
        struct list_head list_all;   /* msgr->con_all */
        struct list_head list_peer;  /* msgr->con_open or con_accepting */
@@ -60,7 +70,6 @@ struct ceph_connection {
        __u32 in_seq, in_seq_acked;  /* last message received, acked */
 
        /* out queue */
-       /* note: need to adjust queues because we have a work queue for the message */ 
        struct list_head out_queue;
        struct ceph_bufferlist out_partial;  /* refereces existing bufferlists; do not free() */
        struct ceph_bufferlist_iterator out_pos;