]> Pileus Git - ~andy/linux/blobdiff - fs/ocfs2/cluster/tcp_internal.h
Merge commit '900cfa46191a7d87cf1891924cb90499287fd235'; branches 'timers/nohz',...
[~andy/linux] / fs / ocfs2 / cluster / tcp_internal.h
index b2e832aca5679cc1bd52d05c826d59cff1954fbb..18307ff81b77ab478383657d76388f697564a0e3 100644 (file)
  * locking semantics of the file system using the protocol.  It should 
  * be somewhere else, I'm sure, but right now it isn't.
  *
+ * With version 11, we separate out the filesystem locking portion.  The
+ * filesystem now has a major.minor version it negotiates.  Version 11
+ * introduces this negotiation to the o2dlm protocol, and as such the
+ * version here in tcp_internal.h should not need to be bumped for
+ * filesystem locking changes.
+ *
+ * New in version 11
+ *     - Negotiation of filesystem locking in the dlm join.
+ *
  * New in version 10:
  *     - Meta/data locks combined
  *
@@ -66,7 +75,7 @@
  *     - full 64 bit i_size in the metadata lock lvbs
  *     - introduction of "rw" lock and pushing meta/data locking down
  */
-#define O2NET_PROTOCOL_VERSION 10ULL
+#define O2NET_PROTOCOL_VERSION 11ULL
 struct o2net_handshake {
        __be64  protocol_version;
        __be64  connector_id;
@@ -86,6 +95,8 @@ struct o2net_node {
        unsigned                        nn_sc_valid:1;
        /* if this is set tx just returns it */
        int                             nn_persistent_error;
+       /* It is only set to 1 after the idle time out. */
+       atomic_t                        nn_timeout;
 
        /* threads waiting for an sc to arrive wait on the wq for generation
         * to increase.  it is increased when a connecting socket succeeds
@@ -155,7 +166,9 @@ struct o2net_sock_container {
        /* original handlers for the sockets */
        void                    (*sc_state_change)(struct sock *sk);
        void                    (*sc_data_ready)(struct sock *sk, int bytes);
-
+#ifdef CONFIG_DEBUG_FS
+       struct list_head        sc_net_debug_item;
+#endif
        struct timeval          sc_tv_timer;
        struct timeval          sc_tv_data_ready;
        struct timeval          sc_tv_advance_start;
@@ -197,4 +210,56 @@ struct o2net_status_wait {
        struct list_head        ns_node_item;
 };
 
+#ifdef CONFIG_DEBUG_FS
+/* just for state dumps */
+struct o2net_send_tracking {
+       struct list_head                st_net_debug_item;
+       struct task_struct              *st_task;
+       struct o2net_sock_container     *st_sc;
+       u32                             st_id;
+       u32                             st_msg_type;
+       u32                             st_msg_key;
+       u8                              st_node;
+       struct timeval                  st_sock_time;
+       struct timeval                  st_send_time;
+       struct timeval                  st_status_time;
+};
+
+void o2net_init_nst(struct o2net_send_tracking *nst, u32 msgtype,
+                   u32 msgkey, struct task_struct *task, u8 node);
+void o2net_set_nst_sock_time(struct o2net_send_tracking *nst);
+void o2net_set_nst_send_time(struct o2net_send_tracking *nst);
+void o2net_set_nst_status_time(struct o2net_send_tracking *nst);
+void o2net_set_nst_sock_container(struct o2net_send_tracking *nst,
+                                 struct o2net_sock_container *sc);
+void o2net_set_nst_msg_id(struct o2net_send_tracking *nst, u32 msg_id);
+
+#else
+struct o2net_send_tracking {
+       u32     dummy;
+};
+
+static inline void o2net_init_nst(struct o2net_send_tracking *nst, u32 msgtype,
+                                 u32 msgkey, struct task_struct *task, u8 node)
+{
+}
+static inline void o2net_set_nst_sock_time(struct o2net_send_tracking *nst)
+{
+}
+static inline void o2net_set_nst_send_time(struct o2net_send_tracking *nst)
+{
+}
+static inline void o2net_set_nst_status_time(struct o2net_send_tracking *nst)
+{
+}
+static inline void o2net_set_nst_sock_container(struct o2net_send_tracking *nst,
+                                               struct o2net_sock_container *sc)
+{
+}
+static inline void o2net_set_nst_msg_id(struct o2net_send_tracking *nst,
+                                       u32 msg_id)
+{
+}
+#endif /* CONFIG_DEBUG_FS */
+
 #endif /* O2CLUSTER_TCP_INTERNAL_H */