From patchwork Mon Oct 19 16:29:00 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shraddha Barke X-Patchwork-Id: 7438411 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 154DABEEA4 for ; Mon, 19 Oct 2015 16:29:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1E756206E2 for ; Mon, 19 Oct 2015 16:29:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 374D6206B5 for ; Mon, 19 Oct 2015 16:29:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752012AbbJSQ3K (ORCPT ); Mon, 19 Oct 2015 12:29:10 -0400 Received: from mail-pa0-f41.google.com ([209.85.220.41]:34880 "EHLO mail-pa0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750905AbbJSQ3J (ORCPT ); Mon, 19 Oct 2015 12:29:09 -0400 Received: by pasz6 with SMTP id z6so34684477pas.2 for ; Mon, 19 Oct 2015 09:29:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id; bh=9HASOQoOMvwADO+yuPFseKzHOhtfWdoIOqxnYp9TSOY=; b=B2ey3wU48AwfhkzzgZk6HeztCoAMs7fOogF1tZBGTTuXaiHSSssyUGcKteGGT6OHBg d+oNZQZwqjqEg4TK6zGNj5no4UCqgHMBQzHIjngvXCiOrHbLLHjdbuS4LMB5KWXe0er6 LD8/FLdqeELAcCy9ubCfLWRLNruWvmIyWp1ulewvwi7Xfcmq0tepAi8yrUiQAsSVZWli 98BjPNT0mIl5GYacd4sHSuJVEVYVprcU4bJKY6Q9xNruBGEJWcAVXS2WL9BVKZQdH25R kFPO+Nv3f9oKvKyFEWND2++XS9PNH8c0WBK6GmexIcwmiYqwuCpP8vCgNPA2F3rvpJG+ Pn8Q== X-Received: by 10.66.66.196 with SMTP id h4mr34246500pat.77.1445272148520; Mon, 19 Oct 2015 09:29:08 -0700 (PDT) Received: from shraddha-370R4E-370R4V-370R5E-3570RE-370R5V.bits-goa.ac.in ([103.225.100.51]) by smtp.gmail.com with ESMTPSA id cs5sm37184789pbc.15.2015.10.19.09.29.06 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 19 Oct 2015 09:29:07 -0700 (PDT) From: Shraddha Barke To: , Alex Elder Subject: [PATCH v3] net: ceph: messenger: Use local variable cursor instead of &msg->cursor Date: Mon, 19 Oct 2015 21:59:00 +0530 Message-Id: <1445272140-7084-1-git-send-email-shraddha.6596@gmail.com> X-Mailer: git-send-email 2.1.4 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.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 Use local variable cursor in place of &msg->cursor in read_partial_msg_data() and write_partial_msg_data() Signed-off-by: Shraddha Barke --- Changes in v3- Replace &msg->cursor with cursor in write_partial_msg_data() too net/ceph/messenger.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c index b9b0e3b..01b567b 100644 --- a/net/ceph/messenger.c +++ b/net/ceph/messenger.c @@ -1552,8 +1552,8 @@ static int write_partial_message_data(struct ceph_connection *con) bool need_crc; int ret; - page = ceph_msg_data_next(&msg->cursor, &page_offset, &length, - &last_piece); + page = ceph_msg_data_next(cursor, &page_offset, &length, + &last_piece); ret = ceph_tcp_sendpage(con->sock, page, page_offset, length, !last_piece); if (ret <= 0) { @@ -1564,7 +1564,7 @@ static int write_partial_message_data(struct ceph_connection *con) } if (do_datacrc && cursor->need_crc) crc = ceph_crc32c_page(crc, page, page_offset, length); - need_crc = ceph_msg_data_advance(&msg->cursor, (size_t)ret); + need_crc = ceph_msg_data_advance(cursor, (size_t)ret); } dout("%s %p msg %p done\n", __func__, con, msg); @@ -2246,8 +2246,8 @@ static int read_partial_msg_data(struct ceph_connection *con) if (do_datacrc) crc = con->in_data_crc; while (cursor->resid) { - page = ceph_msg_data_next(&msg->cursor, &page_offset, &length, - NULL); + page = ceph_msg_data_next(cursor, &page_offset, &length, + NULL); ret = ceph_tcp_recvpage(con->sock, page, page_offset, length); if (ret <= 0) { if (do_datacrc) @@ -2258,7 +2258,7 @@ static int read_partial_msg_data(struct ceph_connection *con) if (do_datacrc) crc = ceph_crc32c_page(crc, page, page_offset, ret); - (void) ceph_msg_data_advance(&msg->cursor, (size_t)ret); + (void) ceph_msg_data_advance(cursor, (size_t)ret); } if (do_datacrc) con->in_data_crc = crc;