From patchwork Tue Nov 20 19:56:18 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 1775381 Return-Path: X-Original-To: patchwork-ceph-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 5F26BDFF38 for ; Tue, 20 Nov 2012 19:56:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752157Ab2KTT4Z (ORCPT ); Tue, 20 Nov 2012 14:56:25 -0500 Received: from mail-ie0-f174.google.com ([209.85.223.174]:57965 "EHLO mail-ie0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751910Ab2KTT4Y (ORCPT ); Tue, 20 Nov 2012 14:56:24 -0500 Received: by mail-ie0-f174.google.com with SMTP id k13so9200749iea.19 for ; Tue, 20 Nov 2012 11:56:24 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding :x-gm-message-state; bh=SOAjziIEXjWtcoF1E1BPQgItCGiFIssRsV+r7Go0jXE=; b=MNIVUUr+XgLgD+DTGN8y6QxObT4wz5TNnJ1mzvUIeWknwQb9Q1b4k/z/Y1S5/W25e0 iXwWrPr1i21MPL8Sez7stHxDxc/CxtghWu/Kr/xsQ+2/i8PfP6uBppP2J9kSz+0aPFD1 tPp8v9s0kGNgCsruEk989FoQeccEFUt1ZILuZkUay+2NXkli3aavjIDaog/zor5HaKSa vLMWwRbgvd+19U9LQXOCbGu19iFGTkKBluNzrzU6J5AAM3i86lT8du3yPDeL4qJJYt8l H3Gz+cylkTVKUUFEOgaxtaihYoF9YvkGFc2Vw9r1OHN6CVvKBj2BMevkgCZFrMZUDFF/ 5/VA== Received: by 10.42.176.194 with SMTP id bf2mr15232859icb.50.1353441384289; Tue, 20 Nov 2012 11:56:24 -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 uj6sm11155869igb.4.2012.11.20.11.56.19 (version=SSLv3 cipher=OTHER); Tue, 20 Nov 2012 11:56:23 -0800 (PST) Message-ID: <50ABE062.6000401@inktank.com> Date: Tue, 20 Nov 2012 13:56:18 -0600 From: Alex Elder User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121028 Thunderbird/16.0.2 MIME-Version: 1.0 To: "ceph-devel@vger.kernel.org" Subject: [PATCH 2/6] rbd: don't assign extent info in rbd_req_sync_op() References: <50ABDF8A.4080206@inktank.com> In-Reply-To: <50ABDF8A.4080206@inktank.com> X-Gm-Message-State: ALoCoQle1Iio8XX6AXu4wBqp/D+hoouGnenuyzwBnQ85/WQSDMwEBwuBLsZ1TJUoSBwcEFEPZ2Ev 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 37b39c1..b2e819c 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,