All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alex Elder <elder@dreamhost.com>
To: ceph-devel@vger.kernel.org
Subject: [PATCH] libceph: move prepare_write_banner()
Date: Tue, 28 Feb 2012 20:43:24 -0800	[thread overview]
Message-ID: <4F4DACEC.4000400@dreamhost.com> (raw)

One of the arguments to prepare_write_connect() indicates whether it
is being called immediately after a call to prepare_write_banner().
Move the prepare_write_banner() call inside prepare_write_connect(),
and reinterpret (and rename) the "after_banner" argument so it
indicates that prepare_write_connect() should *make* the call
rather than should know it has already been made.

This was split out from the next patch to highlight this change in
logic.

Signed-off-by: Alex Elder <elder@dreamhost.com>
---
  net/ceph/messenger.c |    7 ++++---
  1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c
index c410c55..2404a5a 100644
--- a/net/ceph/messenger.c
+++ b/net/ceph/messenger.c
@@ -672,7 +672,7 @@ static void prepare_write_banner(struct 
ceph_messenger *msgr,

  static int prepare_write_connect(struct ceph_messenger *msgr,
  				 struct ceph_connection *con,
-				 int after_banner)
+				 int include_banner)
  {
  	unsigned global_seq = get_global_seq(con->msgr, 0);
  	int proto;
@@ -701,7 +701,9 @@ static int prepare_write_connect(struct 
ceph_messenger *msgr,
  	con->out_connect.protocol_version = cpu_to_le32(proto);
  	con->out_connect.flags = 0;

-	if (!after_banner) {
+	if (include_banner)
+		prepare_write_banner(msgr, con);
+	else {
  		con->out_kvec_left = 0;
  		con->out_kvec_bytes = 0;
  	}
@@ -1842,7 +1844,6 @@ more:

  	/* open the socket first? */
  	if (con->sock == NULL) {
-		prepare_write_banner(msgr, con);
  		prepare_write_connect(msgr, con, 1);
  		prepare_read_banner(con);
  		set_bit(CONNECTING, &con->state);
-- 
1.7.5.4


             reply	other threads:[~2012-02-29  4:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-29  4:43 Alex Elder [this message]
2012-03-02 21:38 ` [PATCH] libceph: move prepare_write_banner() Sage Weil

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F4DACEC.4000400@dreamhost.com \
    --to=elder@dreamhost.com \
    --cc=ceph-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.