/* convert_state() - Converts the peer's view of the cluster state to our point of view @ps: The state as seen by the peer.  */
static union drbd_state convert_state(union drbd_state ps)
/* convert_state() - Converts the peer's view of the cluster state to our point of view @ps: The state as seen by the peer.  */
static union drbd_state convert_state(union drbd_state ps)
{
	union drbd_state ms;
	static enum drbd_conns c_tab[] = {
		[C_CONNECTED] = C_CONNECTED,
		[C_STARTING_SYNC_S] = C_STARTING_SYNC_T,
		[C_STARTING_SYNC_T] = C_STARTING_SYNC_S,
		[C_DISCONNECTING] = C_TEAR_DOWN,
		[C_VERIFY_S]       = C_VERIFY_T,
		[C_MASK]   = C_MASK,
	};
	ms.i = ps.i;
	ms.conn = c_tab[ps.conn];
	ms.peer = ps.role;
	ms.role = ps.peer;
	ms.pdsk = ps.disk;
	ms.disk = ps.pdsk;
	ms.peer_isp = (ps.aftr_isp | ps.user_isp);
	return ms;
}