From patchwork Mon Apr 27 17:13:11 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 6281981 Return-Path: X-Original-To: patchwork-ceph-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 22182BEEE1 for ; Mon, 27 Apr 2015 17:13:40 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 20C94203C4 for ; Mon, 27 Apr 2015 17:13:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 181F7203C2 for ; Mon, 27 Apr 2015 17:13:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964833AbbD0RNZ (ORCPT ); Mon, 27 Apr 2015 13:13:25 -0400 Received: from mail-pd0-f169.google.com ([209.85.192.169]:34040 "EHLO mail-pd0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753197AbbD0RNX (ORCPT ); Mon, 27 Apr 2015 13:13:23 -0400 Received: by pdbqa5 with SMTP id qa5so134828658pdb.1 for ; Mon, 27 Apr 2015 10:13:22 -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=GUbYpEGKourpV4aynnizWWWkTIK6Dza6/3f0U8XIiZk=; b=UoIgsov/ohfqqMMQgwQ+GO4vaFCxJy165ASVU3EKKYkhepcaE0p+jWq8RZ9gz4tr1H yvTjxo0FgiDlIfAJQxQx8Nu0wYyorNHlDOSI8OoZ/Vysr1cWzp6Rf1acv2QS0ADeKJ3n 5DJOH3kwTP7aVLM7IhvOVldStq4CO0lKuUgtbLLOB1Z1nXvZLxjM50/r5H5QhDfC/tX4 Rv//KcaiO7fXsxinMGJj8rBh7MHL7LC+Odl0VJcQpX0ORrv96k6vN8pD64sX4TwfokDo C8duehSIsoPioaNSs3Rdf8un0kgloL9gslIsha/SmmuNgQTsx1QngtouDsGT2OT8BW9h eBmg== X-Gm-Message-State: ALoCoQnlq/L0lrFImVjwF3EcA5mqMPIE77qyiPY1egugCO4vGV1TGNagcO1z0a8OdU4RdeIHFB/n X-Received: by 10.70.90.162 with SMTP id bx2mr23954745pdb.60.1430154801964; Mon, 27 Apr 2015 10:13:21 -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.21 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 27 Apr 2015 10:13:21 -0700 (PDT) From: Alex Elder To: ceph-devel@vger.kernel.org Subject: [PATCH 3/7] messenger: rename "out_kvec_left" field Date: Mon, 27 Apr 2015 12:13:11 -0500 Message-Id: <1430154795-17123-4-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 The name "out_kvec_left" in the ceph_connection structure is sort of ambiguous. It represents the number of the entries of the out_kvec[] array that are filled with data to send. The name can easily be misinterpreted to mean the number of such entries that are available. Change the name to "out_kvec_used" to avoid misunderstanding. Signed-off-by: Alex Elder --- include/linux/ceph/messenger.h | 2 +- net/ceph/messenger.c | 22 +++++++++++----------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/include/linux/ceph/messenger.h b/include/linux/ceph/messenger.h index e154994..c457f13 100644 --- a/include/linux/ceph/messenger.h +++ b/include/linux/ceph/messenger.h @@ -230,7 +230,7 @@ struct ceph_connection { struct kvec out_kvec[8], /* sending header/footer data */ *out_kvec_cur; - int out_kvec_left; /* kvec's left in out_kvec */ + int out_kvec_used; /* kvec's used in out_kvec */ int out_skip; /* skip this many bytes */ int out_kvec_bytes; /* total bytes left */ bool out_kvec_is_msg; /* kvec refers to out_msg */ diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c index 37b0fa7..a0d2673 100644 --- a/net/ceph/messenger.c +++ b/net/ceph/messenger.c @@ -773,7 +773,7 @@ static u32 get_global_seq(struct ceph_messenger *msgr, u32 gt) static void con_out_kvec_reset(struct ceph_connection *con) { - con->out_kvec_left = 0; + con->out_kvec_used = 0; con->out_kvec_bytes = 0; con->out_kvec_cur = &con->out_kvec[0]; } @@ -783,12 +783,12 @@ static void con_out_kvec_add(struct ceph_connection *con, { int index; - index = con->out_kvec_left; + index = con->out_kvec_used; BUG_ON(index >= ARRAY_SIZE(con->out_kvec)); con->out_kvec[index].iov_len = size; con->out_kvec[index].iov_base = data; - con->out_kvec_left++; + con->out_kvec_used++; con->out_kvec_bytes += size; } @@ -1194,7 +1194,7 @@ static void prepare_message_data(struct ceph_msg *msg, u32 data_len) static void prepare_write_message_footer(struct ceph_connection *con) { struct ceph_msg *m = con->out_msg; - int v = con->out_kvec_left; + int v = con->out_kvec_used; m->footer.flags |= CEPH_MSG_FOOTER_COMPLETE; @@ -1213,7 +1213,7 @@ static void prepare_write_message_footer(struct ceph_connection *con) con->out_kvec[v].iov_len = sizeof(m->old_footer); con->out_kvec_bytes += sizeof(m->old_footer); } - con->out_kvec_left++; + con->out_kvec_used++; con->out_more = m->more_to_follow; con->out_msg_done = true; } @@ -1462,7 +1462,7 @@ static int write_partial_kvec(struct ceph_connection *con) dout("write_partial_kvec %p %d left\n", con, con->out_kvec_bytes); while (con->out_kvec_bytes > 0) { ret = ceph_tcp_sendmsg(con->sock, con->out_kvec_cur, - con->out_kvec_left, con->out_kvec_bytes, + con->out_kvec_used, con->out_kvec_bytes, con->out_more); if (ret <= 0) goto out; @@ -1472,10 +1472,10 @@ static int write_partial_kvec(struct ceph_connection *con) /* account for full iov entries consumed */ while (ret >= con->out_kvec_cur->iov_len) { - BUG_ON(!con->out_kvec_left); + BUG_ON(!con->out_kvec_used); ret -= con->out_kvec_cur->iov_len; con->out_kvec_cur++; - con->out_kvec_left--; + con->out_kvec_used--; } /* and for a partially-consumed entry */ if (ret) { @@ -1483,12 +1483,12 @@ static int write_partial_kvec(struct ceph_connection *con) con->out_kvec_cur->iov_base += ret; } } - con->out_kvec_left = 0; + con->out_kvec_used = 0; con->out_kvec_is_msg = false; ret = 1; out: dout("write_partial_kvec %p %d left in %d kvecs ret = %d\n", con, - con->out_kvec_bytes, con->out_kvec_left, ret); + con->out_kvec_bytes, con->out_kvec_used, ret); return ret; /* done! */ } @@ -2497,7 +2497,7 @@ more_kvec: if (ret <= 0) goto out; } - if (con->out_kvec_left) { + if (con->out_kvec_used) { ret = write_partial_kvec(con); if (ret <= 0) goto out;