From patchwork Thu Apr 4 16:18:46 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 2393701 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 8BA483FD8C for ; Thu, 4 Apr 2013 16:18:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1762905Ab3DDQSt (ORCPT ); Thu, 4 Apr 2013 12:18:49 -0400 Received: from mail-ie0-f178.google.com ([209.85.223.178]:47977 "EHLO mail-ie0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1762531Ab3DDQSs (ORCPT ); Thu, 4 Apr 2013 12:18:48 -0400 Received: by mail-ie0-f178.google.com with SMTP id bn7so3293585ieb.9 for ; Thu, 04 Apr 2013 09:18:48 -0700 (PDT) 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=GeXhzf0rLWPE9iD3O9zO4pENt+kVkAyIDCcYzGR8IHY=; b=m34ud4OkOsnuj8PHS9RiNFZeVeOnbmf6yQAvrlMLwSyIOOc1XMqBOfMhHiq+knhGzX w3x4Zd1qXfXj0U7mXACIWGgBZMxJA8/cZQefHXhEIJ+ryQt2arTuVR4Ei26ROK60d9LD YjzLQl/Y6HUOUAUZ4JtEUbb3uMGuMokRc1EVedRJa8VwxHM3ToW5A9CAuKssHZm2br7B rALtksD8zlmHoj/u2SapuFihB715hlau1V+0YxxF66ZplZI5jVD2vKnCUbZbXgkFX3r8 irhXgsxg/CzC9WXacwQvqduIo5592D2seAlw6DhRFlp+ezZwXKzaz0LHf0sfOEHxqPvZ ILKg== X-Received: by 10.50.138.166 with SMTP id qr6mr10078926igb.45.1365092327999; Thu, 04 Apr 2013 09:18:47 -0700 (PDT) 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 qn10sm13343409igc.6.2013.04.04.09.18.46 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 04 Apr 2013 09:18:47 -0700 (PDT) Message-ID: <515DA7E6.5020200@inktank.com> Date: Thu, 04 Apr 2013 11:18:46 -0500 From: Alex Elder User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130308 Thunderbird/17.0.4 MIME-Version: 1.0 To: "ceph-devel@vger.kernel.org" Subject: [PATCH 3/9] libceph: record length of bio list with bio References: <515DA755.2090504@inktank.com> In-Reply-To: <515DA755.2090504@inktank.com> X-Gm-Message-State: ALoCoQnrx/U9flq8mw8B78qFvkyxLhhvTLg6uP4StTYtbS4stOe3ZD7I3Jn83N2hhyK327Rf3jGY Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org When assigning a bio pointer to an osd request, we don't have an efficient way of knowing the total length bytes in the bio list. That information is available at the point it's set up by the rbd code, so record it with the osd data when it's set. This and the next patch are related to maintaining the length of a message's data independent of the message header, as described here: http://tracker.ceph.com/issues/4589 Signed-off-by: Alex Elder --- drivers/block/rbd.c | 1 + include/linux/ceph/osd_client.h | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index 02d821e..9fb51b5 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c @@ -1352,6 +1352,7 @@ static struct ceph_osd_request *rbd_osd_req_create( rbd_assert(obj_request->bio_list != NULL); osd_data->type = CEPH_OSD_DATA_TYPE_BIO; osd_data->bio = obj_request->bio_list; + osd_data->bio_length = obj_request->length; break; case OBJ_REQUEST_PAGES: osd_data->type = CEPH_OSD_DATA_TYPE_PAGES; diff --git a/include/linux/ceph/osd_client.h b/include/linux/ceph/osd_client.h index 3b5ba31..fdda93e 100644 --- a/include/linux/ceph/osd_client.h +++ b/include/linux/ceph/osd_client.h @@ -71,7 +71,10 @@ struct ceph_osd_data { }; struct ceph_pagelist *pagelist; #ifdef CONFIG_BLOCK - struct bio *bio; + struct { + struct bio *bio; /* list of bios */ + size_t bio_length; /* total in list */ + }; #endif /* CONFIG_BLOCK */ }; };