From patchwork Wed Feb 10 11:24:05 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Dryomov X-Patchwork-Id: 8270351 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 EA95CBEEE5 for ; Wed, 10 Feb 2016 11:24:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 16FA6202D1 for ; Wed, 10 Feb 2016 11:24:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1EAD820374 for ; Wed, 10 Feb 2016 11:24:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754630AbcBJLYn (ORCPT ); Wed, 10 Feb 2016 06:24:43 -0500 Received: from mail-wm0-f67.google.com ([74.125.82.67]:33930 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753631AbcBJLYl (ORCPT ); Wed, 10 Feb 2016 06:24:41 -0500 Received: by mail-wm0-f67.google.com with SMTP id p63so3529027wmp.1 for ; Wed, 10 Feb 2016 03:24:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=38g0i4vwy3LQ86pUJns4oNKwSboBMGK4oSy84BBht9w=; b=GVhrBi1fy9M8QJt0QJDhcSCayNFwBsdq6g/S/3KvLZb2YTLJcnTgOZlVpE1HenMnHm W/IBUUAcpPtOkzTwyXSDZ4c2AwypbeXqJHIz8SYjvyZVveQxDyyfqiIKKJ27YwuC5oGw lioVDvhcqLyni+BGRU1hHL7BqZx/xfd942cBvf7T3oWchAcStwZAxMMEsw7max2rUFME o7M/AQAGJ6Q7UcCPG/yS4GOZumavFsVNIEtdoGv69OAFjoVCrxm7N4qW3NW5fqeIPHCJ hl/wfBtsPVABjzLEtjLnqI51xgiZN6nnd0OeAgFk0JqRD9T0xv3tMxmf/D5ssKRtxg7V mYFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=38g0i4vwy3LQ86pUJns4oNKwSboBMGK4oSy84BBht9w=; b=f1Qx1q576USuqy6LCP7LAqsgq5SEIi0Qg/SbW4hk3t8Y6YJXB3YUH8V9jTD8wNqsFq pX72sZoLRmRTHGz4/M0Op7WTIp18OCaIjr3KKDaXbX0e4bp22hB051Yw4gRg0b38utHW LN3zQz/8MDZrDgTjl/Hc2NwuFO7laT1rRqfhVC9WTeJRJf/jVCXgswH7gI/XpMUPeEt6 /Sb3i2Jola9g5vmq1Y2HdUPkE2yDxb2jIuziZnKdp41tlzhxihJdWkFvha7DnybM7KdX /XntF8lKhgN/A1l+b/1ZRpCbv0s/gZI70/DYnN1wF7X640k98ETvU3B+E323C7aG33ej 9CRA== X-Gm-Message-State: AG10YORmUGajZrDV1oeSGt8caFBK5hCU7U4rXoUE+jcfU3SEVijNkcwNAPgT9RNnh/VzMQ== X-Received: by 10.28.63.200 with SMTP id m191mr10104254wma.21.1455103480690; Wed, 10 Feb 2016 03:24:40 -0800 (PST) Received: from localhost.localdomain.com (ip-78-102-114-179.net.upcbroadband.cz. [78.102.114.179]) by smtp.gmail.com with ESMTPSA id l2sm2524819wjf.15.2016.02.10.03.24.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 10 Feb 2016 03:24:40 -0800 (PST) From: Ilya Dryomov To: ceph-devel@vger.kernel.org Cc: Zheng Yan Subject: [PATCH 2/4] libceph: move r_reply_op_{len, result} into struct ceph_osd_req_op Date: Wed, 10 Feb 2016 12:24:05 +0100 Message-Id: <1455103447-23559-3-git-send-email-idryomov@gmail.com> X-Mailer: git-send-email 2.4.3 In-Reply-To: <1455103447-23559-1-git-send-email-idryomov@gmail.com> References: <1455103447-23559-1-git-send-email-idryomov@gmail.com> Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org X-Spam-Status: No, score=-7.0 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 From: "Yan, Zheng" This avoids defining large array of r_reply_op_{len,result} in in struct ceph_osd_request. Signed-off-by: Yan, Zheng Signed-off-by: Ilya Dryomov --- drivers/block/rbd.c | 2 +- include/linux/ceph/osd_client.h | 5 +++-- net/ceph/osd_client.c | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index 4a876785b68c..94f31bde73e8 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c @@ -1854,7 +1854,7 @@ static void rbd_osd_req_callback(struct ceph_osd_request *osd_req, * passed to the block layer, which just supports a 32-bit * length field. */ - obj_request->xferred = osd_req->r_reply_op_len[0]; + obj_request->xferred = osd_req->r_ops[0].outdata_len; rbd_assert(obj_request->xferred < (u64)UINT_MAX); opcode = osd_req->r_ops[0].op; diff --git a/include/linux/ceph/osd_client.h b/include/linux/ceph/osd_client.h index 35c8b006916f..c6d1d603bacf 100644 --- a/include/linux/ceph/osd_client.h +++ b/include/linux/ceph/osd_client.h @@ -78,6 +78,9 @@ struct ceph_osd_req_op { u16 op; /* CEPH_OSD_OP_* */ u32 flags; /* CEPH_OSD_OP_FLAG_* */ u32 indata_len; /* request */ + u32 outdata_len; /* reply */ + s32 rval; + union { struct ceph_osd_data raw_data_in; struct { @@ -148,8 +151,6 @@ struct ceph_osd_request { struct ceph_eversion *r_request_reassert_version; int r_result; - int r_reply_op_len[CEPH_OSD_MAX_OP]; - s32 r_reply_op_result[CEPH_OSD_MAX_OP]; int r_got_reply; int r_linger; diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c index 38bdfafe9dd6..d92fd4ad5a66 100644 --- a/net/ceph/osd_client.c +++ b/net/ceph/osd_client.c @@ -1820,7 +1820,7 @@ static void handle_reply(struct ceph_osd_client *osdc, struct ceph_msg *msg) int len; len = le32_to_cpu(op->payload_len); - req->r_reply_op_len[i] = len; + req->r_ops[i].outdata_len = len; dout(" op %d has %d bytes\n", i, len); payload_len += len; p += sizeof(*op); @@ -1835,7 +1835,7 @@ static void handle_reply(struct ceph_osd_client *osdc, struct ceph_msg *msg) ceph_decode_need(&p, end, 4 + numops * 4, bad_put); retry_attempt = ceph_decode_32(&p); for (i = 0; i < numops; i++) - req->r_reply_op_result[i] = ceph_decode_32(&p); + req->r_ops[i].rval = ceph_decode_32(&p); if (le16_to_cpu(msg->hdr.version) >= 6) { p += 8 + 4; /* skip replay_version */