From patchwork Fri Jan 4 15:06:11 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 1933441 Return-Path: X-Original-To: patchwork-ceph-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 21BED3FDDA for ; Fri, 4 Jan 2013 15:06:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754939Ab3ADPGP (ORCPT ); Fri, 4 Jan 2013 10:06:15 -0500 Received: from mail-ie0-f173.google.com ([209.85.223.173]:34089 "EHLO mail-ie0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754818Ab3ADPGO (ORCPT ); Fri, 4 Jan 2013 10:06:14 -0500 Received: by mail-ie0-f173.google.com with SMTP id e13so19717643iej.4 for ; Fri, 04 Jan 2013 07:06:14 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:message-id:date:from:user-agent:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding :x-gm-message-state; bh=vkmVr5YOBhudxMNv13NH7fIKi2Me+8IkJWlhNfuQMAo=; b=CniFllougXdif5lEFSuvRddrc6Gpg8s+m97at4Yrgu9Zl5GYox9ocm8Wm/o3BzlH+J UeSckfVFNoNMIF5a8uTg9mJ/RaLIqFbdKZ8w9rNIOHav/9I+0fSY4WuJoQ6/kBCkmdl+ BwjsqEiDj01GHs72gGThHuQUca4vx+VaHbs5bEak35znSP7MhkexW9nGwfFK9y/B663b GfcmeFS7C6FK0wMfOZ8nzyLnIelcKhgQ8Ufaz5uizEYUdpDgftwv3V1PA1VZRlocTi+a 1/0BKkwkGfx73gBXmZOUEJR8zKpbp98Zi7kVzfOKpjVteKMkd+Ju7roXM+6deUnWcbSk aPTg== X-Received: by 10.50.0.171 with SMTP id 11mr39340565igf.105.1357311974489; Fri, 04 Jan 2013 07:06:14 -0800 (PST) Received: from [172.22.22.4] (c-71-195-31-37.hsd1.mn.comcast.net. [71.195.31.37]) by mx.google.com with ESMTPS id s20sm44000641igs.10.2013.01.04.07.06.11 (version=SSLv3 cipher=OTHER); Fri, 04 Jan 2013 07:06:12 -0800 (PST) Message-ID: <50E6EFE3.1040103@inktank.com> Date: Fri, 04 Jan 2013 09:06:11 -0600 From: Alex Elder User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: "ceph-devel@vger.kernel.org" Subject: [PATCH REPOST 2/6] rbd: don't assign extent info in rbd_req_sync_op() References: <50E6EF5F.9080200@inktank.com> In-Reply-To: <50E6EF5F.9080200@inktank.com> X-Gm-Message-State: ALoCoQmHrJV7UNllSsU75An90rrtTvSsZUYR7qa7u0sUY+x/E9VOlMfSLLLXRP2oQatK29x+5wNv Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org Move the assignment of the extent offset and length and payload length out of rbd_req_sync_op() and into its caller in the one spot where a read (and note--no write) operation might be initiated. Signed-off-by: Alex Elder --- drivers/block/rbd.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) pages, num_pages, @@ -1373,6 +1366,9 @@ static int rbd_req_sync_read(struct rbd_device *rbd_dev, op = rbd_create_rw_op(CEPH_OSD_OP_READ, 0); if (!op) return -ENOMEM; + op->extent.offset = ofs; + op->extent.length = len; + op->payload_len = 0; ret = rbd_req_sync_op(rbd_dev, CEPH_OSD_FLAG_READ, op, object_name, ofs, len, buf, NULL, ver); diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index 4ce9981..49e500f 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c @@ -1262,13 +1262,6 @@ static int rbd_req_sync_op(struct rbd_device *rbd_dev, if (IS_ERR(pages)) return PTR_ERR(pages); - if (op->op == CEPH_OSD_OP_READ || op->op == CEPH_OSD_OP_WRITE) { - op->extent.offset = ofs; - op->extent.length = inbound_size; - if (op->op == CEPH_OSD_OP_WRITE) - op->payload_len = inbound_size; - } - ret = rbd_do_request(NULL, rbd_dev, NULL, CEPH_NOSNAP, object_name, ofs, inbound_size, NULL,