diff options
author | Alex Elder <elder@inktank.com> | 2012-05-22 12:41:43 -0400 |
---|---|---|
committer | Alex Elder <elder@dreamhost.com> | 2012-06-01 09:37:56 -0400 |
commit | 928443cd9644e7cfd46f687dbeffda2d1a357ff9 (patch) | |
tree | 09112335af82c7ce01d93caa55567341f9468c3f /include/linux/ceph/messenger.h | |
parent | 15d9882c336db2db73ccf9871ae2398e452f694c (diff) |
libceph: start separating connection flags from state
A ceph_connection holds a mixture of connection state (as in "state
machine" state) and connection flags in a single "state" field. To
make the distinction more clear, define a new "flags" field and use
it rather than the "state" field to hold Boolean flag values.
Signed-off-by: Alex Elder <elder@inktank.com>
Reviewed-by: Sage Weil<sage@inktank.com>
Diffstat (limited to 'include/linux/ceph/messenger.h')
-rw-r--r-- | include/linux/ceph/messenger.h | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/include/linux/ceph/messenger.h b/include/linux/ceph/messenger.h index 3fbd4be804ed..920235e114ad 100644 --- a/include/linux/ceph/messenger.h +++ b/include/linux/ceph/messenger.h | |||
@@ -103,20 +103,25 @@ struct ceph_msg_pos { | |||
103 | #define MAX_DELAY_INTERVAL (5 * 60 * HZ) | 103 | #define MAX_DELAY_INTERVAL (5 * 60 * HZ) |
104 | 104 | ||
105 | /* | 105 | /* |
106 | * ceph_connection state bit flags | 106 | * ceph_connection flag bits |
107 | */ | 107 | */ |
108 | |||
108 | #define LOSSYTX 0 /* we can close channel or drop messages on errors */ | 109 | #define LOSSYTX 0 /* we can close channel or drop messages on errors */ |
109 | #define CONNECTING 1 | ||
110 | #define NEGOTIATING 2 | ||
111 | #define KEEPALIVE_PENDING 3 | 110 | #define KEEPALIVE_PENDING 3 |
112 | #define WRITE_PENDING 4 /* we have data ready to send */ | 111 | #define WRITE_PENDING 4 /* we have data ready to send */ |
112 | #define SOCK_CLOSED 11 /* socket state changed to closed */ | ||
113 | #define BACKOFF 15 | ||
114 | |||
115 | /* | ||
116 | * ceph_connection states | ||
117 | */ | ||
118 | #define CONNECTING 1 | ||
119 | #define NEGOTIATING 2 | ||
113 | #define STANDBY 8 /* no outgoing messages, socket closed. we keep | 120 | #define STANDBY 8 /* no outgoing messages, socket closed. we keep |
114 | * the ceph_connection around to maintain shared | 121 | * the ceph_connection around to maintain shared |
115 | * state with the peer. */ | 122 | * state with the peer. */ |
116 | #define CLOSED 10 /* we've closed the connection */ | 123 | #define CLOSED 10 /* we've closed the connection */ |
117 | #define SOCK_CLOSED 11 /* socket state changed to closed */ | ||
118 | #define OPENING 13 /* open connection w/ (possibly new) peer */ | 124 | #define OPENING 13 /* open connection w/ (possibly new) peer */ |
119 | #define BACKOFF 15 | ||
120 | 125 | ||
121 | /* | 126 | /* |
122 | * A single connection with another host. | 127 | * A single connection with another host. |
@@ -133,7 +138,8 @@ struct ceph_connection { | |||
133 | 138 | ||
134 | struct ceph_messenger *msgr; | 139 | struct ceph_messenger *msgr; |
135 | struct socket *sock; | 140 | struct socket *sock; |
136 | unsigned long state; /* connection state (see flags above) */ | 141 | unsigned long flags; |
142 | unsigned long state; | ||
137 | const char *error_msg; /* error message, if any */ | 143 | const char *error_msg; /* error message, if any */ |
138 | 144 | ||
139 | struct ceph_entity_addr peer_addr; /* peer address */ | 145 | struct ceph_entity_addr peer_addr; /* peer address */ |