From patchwork Thu Jan 7 14:05:24 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yan, Zheng" X-Patchwork-Id: 7977611 Return-Path: X-Original-To: patchwork-ceph-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 83AFD9F3E6 for ; Thu, 7 Jan 2016 14:05:56 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A76F120172 for ; Thu, 7 Jan 2016 14:05:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AE536200DE for ; Thu, 7 Jan 2016 14:05:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752254AbcAGOFx (ORCPT ); Thu, 7 Jan 2016 09:05:53 -0500 Received: from mx1.redhat.com ([209.132.183.28]:40947 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752010AbcAGOFw (ORCPT ); Thu, 7 Jan 2016 09:05:52 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 92FF95BA2B; Thu, 7 Jan 2016 14:05:52 +0000 (UTC) Received: from localhost.localdomain (vpn1-4-93.pek2.redhat.com [10.72.4.93]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u07E5cWj003807; Thu, 7 Jan 2016 09:05:49 -0500 From: "Yan, Zheng" To: ceph-devel@vger.kernel.org Cc: idryomov@gmail.com, "Yan, Zheng" Subject: [PATCH 2/6] libceph: move r_reply_op_{len, result} into struct ceph_osd_req_op Date: Thu, 7 Jan 2016 22:05:24 +0800 Message-Id: <1452175528-20751-3-git-send-email-zyan@redhat.com> In-Reply-To: <1452175528-20751-1-git-send-email-zyan@redhat.com> References: <1452175528-20751-1-git-send-email-zyan@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 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, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 This avoids defining large array of r_reply_op_{len,result} in in 'struct ceph_osd_request' Signed-off-by: Yan, Zheng --- 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 4a87678..22cfc01 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].reply_op_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 5bf428a..fda3a05 100644 --- a/include/linux/ceph/osd_client.h +++ b/include/linux/ceph/osd_client.h @@ -116,6 +116,9 @@ struct ceph_osd_req_op { u64 expected_write_size; } alloc_hint; }; + /* reply */ + int reply_op_len; + s32 reply_op_result; }; /* an in-flight request */ @@ -150,8 +153,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 8499a36..c76cbe1 100644 --- a/net/ceph/osd_client.c +++ b/net/ceph/osd_client.c @@ -1839,7 +1839,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].reply_op_len = len; dout(" op %d has %d bytes\n", i, len); payload_len += len; p += sizeof(*op); @@ -1854,7 +1854,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].reply_op_result = ceph_decode_32(&p); if (le16_to_cpu(msg->hdr.version) >= 6) { p += 8 + 4; /* skip replay_version */