}
}
+__u32 AsyncMessenger::get_global_seq(__u32 old)
+{
+ std::lock_guard<ceph::spinlock> lg(global_seq_lock);
+
+ if (old > global_seq) {
+ ldout(cct, 10) << __func__ << " old=" << old
+ << " > global_seq=" << global_seq
+ << "; new global_seq=" << old << dendl;
+ global_seq = old;
+ }
+ __u32 ret = ++global_seq;
+ ldout(cct, 10) << __func__ << " increment to global_seq=" << global_seq << dendl;
+ return ret;
+}
+
int AsyncMessenger::get_proto_version(int peer_type, bool connect) const
{
int my_type = my_name.type();
*
* @return a global sequence ID that nobody else has seen.
*/
- __u32 get_global_seq(__u32 old=0) {
- std::lock_guard<ceph::spinlock> lg(global_seq_lock);
+ __u32 get_global_seq(__u32 old=0);
- if (old > global_seq)
- global_seq = old;
- __u32 ret = ++global_seq;
-
- return ret;
- }
/**
* Get the protocol version we support for the given peer type: either
* a peer protocol (if it matches our own), the protocol version for the
<< " conn("
<< connection << " " << this
<< " :" << connection->port << " s=" << get_state_name(state)
- << " pgs=" << peer_global_seq << " cs=" << connect_seq
- << " l=" << connection->policy.lossy << ").";
+ << " pgs=" << peer_global_seq << " gs=" << global_seq
+ << " cs=" << connect_seq << " l=" << connection->policy.lossy << ").";
}
#define WRITE(B, C) write(CONTINUATION(C), B)
<< " " << ceph_con_mode_name(auth_meta->con_mode)
<< " :" << connection->port
<< " s=" << get_state_name(state) << " pgs=" << peer_global_seq
- << " cs=" << connect_seq << " l=" << connection->policy.lossy
+ << " gs=" << global_seq << " cs=" << connect_seq
+ << " l=" << connection->policy.lossy
<< " rev1=" << HAVE_MSGR2_FEATURE(peer_supported_features,
REVISION_1)
<< " crypto rx=" << session_stream_handlers.rx.get()