From patchwork Mon Apr 27 17:13:09 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 6281931 Return-Path: X-Original-To: patchwork-ceph-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 2D1EB9F1C2 for ; Mon, 27 Apr 2015 17:13:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 00208203C2 for ; Mon, 27 Apr 2015 17:13:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 20515203C1 for ; Mon, 27 Apr 2015 17:13:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964803AbbD0RNX (ORCPT ); Mon, 27 Apr 2015 13:13:23 -0400 Received: from mail-pd0-f177.google.com ([209.85.192.177]:35966 "EHLO mail-pd0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753467AbbD0RNU (ORCPT ); Mon, 27 Apr 2015 13:13:20 -0400 Received: by pdea3 with SMTP id a3so134950557pde.3 for ; Mon, 27 Apr 2015 10:13:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=sJ54YQ+xXqsMzdGh4YS2zifLFptS+EiYT+Px0bBepi8=; b=KUPynsV/M7eJQwK1olNeh3g2kjnHOvsziVRHQ68eStARjoKVCwiXcYHNjOyM9RHUrZ O7OEsRd7nJNqgfzBjDSoSQbE7dbEuMKqvJWfKxT2Mgegao2V28imw6I5U4ECFzZch6Co fDA3Q0j6Qms0FlwgiGXtd4IBxw1srCxA2d+xqGzyWoVGyeO0tep1EoP6Ri535PF9P1PM 95sYjFCgJ0D4wy1GQ472OIgVdYnm7V3D+GlB5xxBeNXUdPUaRiGQ0wfc6YwfY8oYEUlY /InntIf7SeFaQ8XVZWvBVR7CTwMRQv6JNXpYTrtchgmbU2RabezDgHRXwzrIveFdoElr OE9Q== X-Gm-Message-State: ALoCoQmnIyA2Nwr60D546It8JqAWwNagFw5P2SR4JX8NAsSkz3eyT/dLaX1GvPvkb+jf51/tgSgT X-Received: by 10.70.38.138 with SMTP id g10mr23917302pdk.98.1430154800299; Mon, 27 Apr 2015 10:13:20 -0700 (PDT) Received: from shibby.corp.google.com ([104.135.1.105]) by mx.google.com with ESMTPSA id ff10sm12124675pab.13.2015.04.27.10.13.19 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 27 Apr 2015 10:13:19 -0700 (PDT) From: Alex Elder To: ceph-devel@vger.kernel.org Subject: [PATCH 1/7] messenger: update state diagram Date: Mon, 27 Apr 2015 12:13:09 -0500 Message-Id: <1430154795-17123-2-git-send-email-elder@linaro.org> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1430154795-17123-1-git-send-email-elder@linaro.org> References: <1430154795-17123-1-git-send-email-elder@linaro.org> Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Update the fabulous state diagram in "messenger.c" to reflect the way the code operates. Two new transitions are added: CLOSED -> CLOSED CLOSING -> CLOSING Signed-off-by: Alex Elder --- net/ceph/messenger.c | 51 +++++++++++++++++++++++++-------------------------- 1 file changed, 25 insertions(+), 26 deletions(-) diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c index 967080a..9dfdb20 100644 --- a/net/ceph/messenger.c +++ b/net/ceph/messenger.c @@ -46,32 +46,31 @@ * | con_sock_state_init() * v * ---------- - * | CLOSED | initialized, but no socket (and no - * ---------- TCP connection) - * ^ \ - * | \ con_sock_state_connecting() - * | ---------------------- - * | \ - * + con_sock_state_closed() \ - * |+--------------------------- \ - * | \ \ \ - * | ----------- \ \ - * | | CLOSING | socket event; \ \ - * | ----------- await close \ \ - * | ^ \ | - * | | \ | - * | + con_sock_state_closing() \ | - * | / \ | | - * | / --------------- | | - * | / \ v v - * | / -------------- - * | / -----------------| CONNECTING | socket created, TCP - * | | / -------------- connect initiated - * | | | con_sock_state_connected() - * | | v - * ------------- - * | CONNECTED | TCP connection established - * ------------- + * | CLOSED | initialized, but no socket (and no TCP connection) + * ---------- + * ^ \ \ con_sock_state_connecting() + * | / ------------------------ + * +<-- \ + * |\ cen_sock_state_closed() \ + * | +<-------------------------- \ + * | \ \ \ + * | ----------- \ \ + * | | CLOSING | socket event; \ \ + * | ----------- await close \ \ + * | / ^ \ \ + * | \ | \ | + * | -->+ con_sock_state_closing() \ | + * | / \ | | + * | / ---------------------- | | + * | / \ | v + * | / -------------- + * | / ---------------------| CONNECTING | socket created, TCP + * | | / -------------- connect initiated + * | | | con_sock_state_connected() + * | | v + * ------------- + * | CONNECTED | TCP connection established + * ------------- * * State values for ceph_connection->sock_state; NEW is assumed to be 0. */