libceph: don't reset kvec in prepare_write_banner()
authorAlex Elder <elder@inktank.com>
Wed, 16 May 2012 20:16:38 +0000 (15:16 -0500)
committerAlex Elder <elder@dreamhost.com>
Thu, 17 May 2012 13:18:12 +0000 (08:18 -0500)
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>
net/ceph/messenger.c

index a659b4de64aaacba7dd851ffc7de44d2c2e2a82b..bcbd409b5ca75e42fa15cbaefe66f399c6c52560 100644 (file)
@@ -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);
@@ -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;