diff options
author | Alex Elder <elder@dreamhost.com> | 2012-02-14 15:05:33 -0500 |
---|---|---|
committer | Alex Elder <elder@dreamhost.com> | 2012-03-22 11:47:50 -0400 |
commit | 963be4d7709f84d865f76d12d5b0ec7edad1c498 (patch) | |
tree | 798e98459427acc942228c42a69c3bc4ff3308bd /net/ceph | |
parent | 32eec68d2f233e8a6ae1cd326022f6862e2b9ce3 (diff) |
libceph: move prepare_write_banner()
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>
Signed-off-by: Sage Weil <sage@newdream.net>
Diffstat (limited to 'net/ceph')
-rw-r--r-- | 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 3917847ad8e5..0665945b6468 100644 --- a/net/ceph/messenger.c +++ b/net/ceph/messenger.c | |||
@@ -676,7 +676,7 @@ static void prepare_write_banner(struct ceph_messenger *msgr, | |||
676 | 676 | ||
677 | static int prepare_write_connect(struct ceph_messenger *msgr, | 677 | static int prepare_write_connect(struct ceph_messenger *msgr, |
678 | struct ceph_connection *con, | 678 | struct ceph_connection *con, |
679 | int after_banner) | 679 | int include_banner) |
680 | { | 680 | { |
681 | unsigned global_seq = get_global_seq(con->msgr, 0); | 681 | unsigned global_seq = get_global_seq(con->msgr, 0); |
682 | int proto; | 682 | int proto; |
@@ -705,7 +705,9 @@ static int prepare_write_connect(struct ceph_messenger *msgr, | |||
705 | con->out_connect.protocol_version = cpu_to_le32(proto); | 705 | con->out_connect.protocol_version = cpu_to_le32(proto); |
706 | con->out_connect.flags = 0; | 706 | con->out_connect.flags = 0; |
707 | 707 | ||
708 | if (!after_banner) { | 708 | if (include_banner) |
709 | prepare_write_banner(msgr, con); | ||
710 | else { | ||
709 | con->out_kvec_left = 0; | 711 | con->out_kvec_left = 0; |
710 | con->out_kvec_bytes = 0; | 712 | con->out_kvec_bytes = 0; |
711 | } | 713 | } |
@@ -1846,7 +1848,6 @@ more: | |||
1846 | 1848 | ||
1847 | /* open the socket first? */ | 1849 | /* open the socket first? */ |
1848 | if (con->sock == NULL) { | 1850 | if (con->sock == NULL) { |
1849 | prepare_write_banner(msgr, con); | ||
1850 | prepare_write_connect(msgr, con, 1); | 1851 | prepare_write_connect(msgr, con, 1); |
1851 | prepare_read_banner(con); | 1852 | prepare_read_banner(con); |
1852 | set_bit(CONNECTING, &con->state); | 1853 | set_bit(CONNECTING, &con->state); |