#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 */
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 */
__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;