Skip to content

Commit

Permalink
libceph: don't reset kvec in prepare_write_banner()
Browse files Browse the repository at this point in the history
Move the kvec reset for a connection out of prepare_write_banner and
into its only caller.

Signed-off-by: Alex Elder <elder@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
  • Loading branch information
Alex Elder authored and Alex Elder committed May 17, 2012
1 parent c047be0 commit d329156
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions net/ceph/messenger.c
Original file line number Diff line number Diff line change
Expand Up @@ -686,7 +686,6 @@ static int prepare_connect_authorizer(struct ceph_connection *con)
static void prepare_write_banner(struct ceph_messenger *msgr,
struct ceph_connection *con)
{
ceph_con_out_kvec_reset(con);
ceph_con_out_kvec_add(con, strlen(CEPH_BANNER), CEPH_BANNER);
ceph_con_out_kvec_add(con, sizeof (msgr->my_enc_addr),
&msgr->my_enc_addr);
Expand Down Expand Up @@ -726,10 +725,9 @@ static int prepare_write_connect(struct ceph_messenger *msgr,
con->out_connect.protocol_version = cpu_to_le32(proto);
con->out_connect.flags = 0;

ceph_con_out_kvec_reset(con);
if (include_banner)
prepare_write_banner(msgr, con);
else
ceph_con_out_kvec_reset(con);
ceph_con_out_kvec_add(con, sizeof (con->out_connect), &con->out_connect);

con->out_more = 0;
Expand Down

0 comments on commit d329156

Please sign in to comment.